Mobileread
PageEdit new feature...
#1  RbnJrg 01-25-2021, 09:56 AM
Would it be possible to add the command "Print..." to the "File" menu?

Sigil has that command but prints the source code of the xhtml file. In some cases, I'd like to print the output of one xhtml file (and not its source code) and with PageEdit so far I can't do it.

Thanks in advance.
Rubén
Reply 

#2  DiapDealer 01-25-2021, 10:13 AM
I don't think it would be too difficult (famous last words!). I can take a stab at this.
Reply 

#3  RbnJrg 01-25-2021, 03:07 PM
Quote DiapDealer
I don't think it would be too difficult (famous last words!). I can take a stab at this.
Many thanks!
Reply 

#4  BetterRed 01-25-2021, 04:38 PM
Quote RbnJrg
Would it be possible to add the command "Print..." to the "File" menu?
Great idea!

Sometimes proofreading needs every page to be visible, e.g. spread out on a table. What I've been doing is using calibre to convert the Book to DOCX, and then print the Chapter from Word.

BR
Reply 

#5  DiapDealer 01-25-2021, 06:14 PM
Well it's not at all as simple as WebKit's view()->print(), but it's not impossible either.

One thing to keep in mind is that QWebEnginePage::print() first renders the page into a temporary PDF and then prints that. Which means that everything will be printed exactly as it's seen on your screen. That includes light text on a dark background if someone happens to have the "Make PageEdit simulate a dark appearance in Dark Mode" option checked in PageEdit's preferences.

So while I have a working proof of concept, I'm probably going to put a few guardrails on this thing so people can choose whether or not they really, really, really want to empty their black ink cartridge when printing under certain conditions!
Reply 

#6  Tex2002ans 01-25-2021, 10:40 PM
Quote DiapDealer
So while I have a working proof of concept, I'm probably going to put a few guardrails on this thing so people can choose whether or not they really, really, really want to empty their black ink cartridge when printing under certain conditions!
I once printed out of Notepad++, thinking it would appear as a basic text... it printed the entire black background + line numbers + everything else, with a few white words.

Horrible, and I'll never make that mistake again!

LibreOffice 7 has a few checkboxes:

show attachment »

The two key settings being "Page Background" and "Print text in black".
Reply 

#7  DNSB 01-26-2021, 01:12 AM
Would it be easier to have the print function do a print to PDF and then have the user do the physical print from a PDF viewer? I often find doing that an easier way to print a range of pages instead of the whole document.
Reply 

#8  RbnJrg 01-26-2021, 11:50 AM
Quote DNSB
Would it be easier to have the print function do a print to PDF and then have the user do the physical print from a PDF viewer?
With the "Print..." command you can do also that if you has, for example, a program like pdfFactory (that allows you to print with a major quality that the Print as pdf command). And with the Windows print dialog, you can disable the printing of the background graphics. Lastly, we can "tweak" (disable) temporally in Sigil (before sending the xhtml file to PageEdit) any css code that would be able to generate some troubles when printing under certain conditions!
Reply 

#9  DiapDealer 01-26-2021, 11:59 AM
I'm not seeing much ability to change the pdf that's being generated/printed by QPrinter (other than margins, orientation and such), I'm afraid. What is is seen is what will be printed.

Quote DNSB
Would it be easier to have the print function do a print to PDF and then have the user do the physical print from a PDF viewer? I often find doing that an easier way to print a range of pages instead of the whole document.
I think I'd rather leave this up to the user. If they have need of such granularity, they can always choose to "print" to a file using any configured PDF printer. The built-in QWebEnginePage::printToPdf() function has its own quirks that I'd like to avoid.
Reply 

Today's Posts | Search this Thread | Login | Register