![]() |
#16 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,574
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Ahh... Ok. I often lose track of which files the actual slot procedures can be found in. Those connect statements tend to be so vague!
|
![]() |
![]() |
![]() |
#17 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,765
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Okay there was a signal/slot connection inside the CodeViewEditor for its print slot that was not quite correct (needed identical type match not a type inherited from).
I just pushed the fix to master. So print preview of the front open tab via the menu should work again in the next release. Thank you everyone for your bug report and help in tracking this one down. |
![]() |
![]() |
![]() |
#18 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,574
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Will it print the background css colors as well? I added a dismissable warning to PageEdit's print feature so that people could fully understand that they could waste a ton of ink depending on the css. I used a WebEngine procedure to do it for PageEdit. Is Sigil's feature simpler?
|
![]() |
![]() |
![]() |
#19 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,765
Karma: 6000000
Join Date: Nov 2009
Device: many
|
It just uses QPlainTextEdit print(QPrinter*) so on my screen when running "print preview" it just shows syntax coloured html source code of the current Tab on a white background for me.
This is much easier stuff than printing from a QtWebEngine webview which is what you do in PageEdit. We still need to fix that when printing Image Tabs and Audio Video tabs. The current code only broke because how signals and slots changed in Qt over the years and, not because of QtWebEngine vs QtWebKit as far as I can tell. Last edited by KevinH; 02-10-2023 at 11:03 AM. |
![]() |
![]() |
![]() |
#20 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,765
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Just to test, I put my macOS into dark mode and fired up Sigil master and even though the CodeView tab showed white text on a black background (dark mode) when I hit Print Preview, it showed dark text on a light background in the PrintPreview dialog (suitable for printing on white paper) which makes sense.
So this appears to just work unlike trying to print the contents of a QtWebEnginePage. |
![]() |
![]() |
![]() |
#21 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,765
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Just for the record, I used the Print Preview to print the CodeView tab from the pd Alice in Wonderland xhtml page and after previewing it, I was able to then print directly from that dialog and redirect it to a pdf (long a built in feature of the os Print dialog on a mac).
Here is what I get. If I change to dark mode, all that changes are the syntax highlighting colours, not the text. The text stays black on a white background. So this all appears to work as desired at least on my mac. |
![]() |
![]() |
![]() |
#22 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Spoiler:
|
|
![]() |
![]() |
![]() |
#23 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,771
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
|
|
![]() |
![]() |
![]() |
#24 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,574
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
![]() |
![]() |
![]() |
#25 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,771
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
![]() |
![]() |
![]() |
#26 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,765
Karma: 6000000
Join Date: Nov 2009
Device: many
|
@DiapDealer, when you get a free moment:
In order to properly print the contents of the PreviewWindow, and the Image tab and AV tabs, we really should bring your webviewprinter code over from PageEdit and put it into Sigil (maybe into Misc/ or ViewEditors/ or ...) so that we can fix the Print Preview and Print actions for the remaining Tab types and add it to the PreviewWindow as well (since the old BookView had that capability). Thanks! KevinH |
![]() |
![]() |
![]() |
#27 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,574
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#28 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,574
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
![]() |
![]() |
![]() |
#29 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,765
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Yes, Print Preview in the old Sigil (0.9.8) would print the top tab, so it would print the code if in CodeView and print the rendered webkit view if the top tab was in BookView.
PageEdit does properly handle that now. But the ability to print the PreviewWindow directly in Sigil would be nice. |
![]() |
![]() |
![]() |
#30 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,765
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Perhaps we add a Printer icon to the PreviewWindow lower icon bar to enable it printing? As printing from the PreviewWindow only makes sense when it is visible. Then the css swap in/out code code we added last time could be used to help control how things print.
Just a thought. ps: Also we need to be worried about mathjax and mathml and make sure to copy the contents of the current page source code from PreviewWindow to get mathml enabled properly. To get that but skip the darkmode css that is injected might not be straightforward. Last edited by KevinH; 02-10-2023 at 12:51 PM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
table in reader doesn't look like preview in Sigil | gib65 | Sigil | 11 | 11-15-2013 05:32 PM |
Print Preview Problem | townsend | Sigil | 3 | 05-11-2013 05:11 PM |
preview vs print preview | isalherbo | Sigil | 7 | 04-23-2013 03:52 PM |
Print Preview problems | illustrata | Sigil | 5 | 10-25-2011 02:50 PM |
eBook viewer Print Preview settings not saved | Agama | Calibre | 3 | 08-22-2010 08:04 PM |