-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Background images become unoptimized PNGs in PDFs #751
Comments
Two things:
|
I've only been using Chrome. Tried safari simply to see if that would change anything (it was worse so there's that). Share link: |
When using Chrome to print. The destination is set to "Save as PDF" page size to "Letter" and "background Graphics" is enabled. Clicking the save button causes the page to crash after a few moments. |
I'm facing a similar issue, using Chrome and et cetera. Looks like the Save as PDF cannot handle larger brews anymore. I have exported to PDF a +200 page before, but right now, I can't export a book of 140 pages I made. Not a big issue, as I can break the brew in smaller ones and merge then with ilovepdf.com, but would be nice if someone finds a way for to make it work again. |
Sorry I haven't replied in a while. I think @RKuerten is right. It may be an issue with large documents. For now, I would recommend following his solution of breaking the document into smaller parts, but we also noticed that the PDFs generated by the Homebrewery tend to be rather large. There may be some bloat we can get rid of to make it work better. |
That’s exactly what was happening.
I’ve since broken it into separate documents.
This prevents linking pages in the table of contents but using a pdf merger I can still have a complete document.
Still a great program I use all the time.
Thanks for the response.
… On Nov 10, 2018, at 5:15 PM, Trevor Buckner ***@***.***> wrote:
Sorry I haven't replied in a while. I think @RKuerten <https://github.com/RKuerten> is right. It may be an issue with large documents. For now, I would recommend following his solution of breaking the document into smaller parts, but we also noticed that the PDFs generated by the Homebrewery tend to be rather large. There may be some bloat we can get rid of to make it work better.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <https://github.com/stolksdorf/homebrewery/issues/751#issuecomment-437635307>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AnmufQW3h40Ne7aRYZipFA_9sIhy6zQoks5ut3pGgaJpZM4Wl1Jq>.
|
Looking into this a little more, apparently there is a bug with Chrome and the way it handles background images when printing PDFs. Any other image using an <style> .phb{ background : white;} .phb:before { position: absolute; top: 0px; left: 0px; z-index: -1; content: url(https://i.imgur.com/77CNx8a.jpg); } </style> This seems to cut down the PDF size to about 1/3 for entirely blank documents with just background, and the PDF generates much more quickly. I don't plan to keep that imgur link up indefinitely though, so don't count on that code working forever. Any thoughts on this method? |
For what it's worth, I tried the original linked example here just now, from Chrome macOS, and had no issue printing to pdf besides just taking awhile to load. Was able to save it just fine. Not sure if the chrome bug @calculuschild is still an issue, but I don't see anything wrong with using :before except it is a little obtuse (even if necessary). |
The original bug from Chrome was here: https://bugs.chromium.org/p/chromium/issues/detail?id=801430. Looks like this was solved back in April 2018, but we were still noticing the bug after that according to the date of my post above. Just tested it and the issue still exists. 20 empty pages (background only) is ~11.6 MB. Replacing background-image with a normal image cuts it to ~3.2 MB. 20 pages - Background-image.pdf On further inspection, it looks like there is a remaining bug in Chrome that it is converting Relevant Chrome issues here. Star them to bring more attention: |
Just noting here that the current Chrome Canary has a fix for this. https://issues.chromium.org/issues/40759668#comment14 |
I think this Chrome update is for duplicate images, not unoptimized bitmaps. |
I've been trying to export my homebrew for a while (96 pages) and each time it fails to work.
I followed the guidelines listed on the homepage and it still didn't work.
The closest I've gotten is a saved file on my desktop which "won't open because the file is empty"
The normal message from Chrome is simply "printer failed check your settings and try again" and if it's opened in Safari the program just bogs down and does nothing.
Please help. I'd really like an offline version of my work.
The text was updated successfully, but these errors were encountered: