MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   PageEdit new feature... (https://www.mobileread.com/forums/showthread.php?t=336862)

RbnJrg 01-25-2021 09:56 AM

PageEdit new feature...
 
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

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.

RbnJrg 01-25-2021 03:07 PM

Quote:

Originally Posted by DiapDealer (Post 4086065)
I don't think it would be too difficult (famous last words!). I can take a stab at this.

Many thanks!

BetterRed 01-25-2021 04:38 PM

Quote:

Originally Posted by RbnJrg (Post 4086062)
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

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!

Tex2002ans 01-25-2021 10:40 PM

1 Attachment(s)
Quote:

Originally Posted by DiapDealer (Post 4086266)
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!

:thumbsup: 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:

Attachment 184952

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

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.

RbnJrg 01-26-2021 11:50 AM

Quote:

Originally Posted by DNSB (Post 4086393)
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!

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:

Originally Posted by DNSB (Post 4086393)
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.

DiapDealer 03-19-2021 04:04 PM

This has been incorporated into the new PageEdit 1.5.0 release. Please give it a try and see what you think. None of Sigil's own dark mode features will print, but it's still going to print whatever is specified in the ebook's css. So there's a dismissable warning to be certain to note that the subsequent print preview will show you exactly what IS going to print. From there you can change margins, and print to any configured printer (including a PDF printer).


All times are GMT -4. The time now is 09:25 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.