-
-
Notifications
You must be signed in to change notification settings - Fork 706
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
Problems rendering objects independently in PDF #1501
Comments
Hello!
That’s strange… We’ve changed the way PDFs are generated since version 53, as we decided to use our own PDF generator instead of relying on Cairo. So, it’s totally normal to get something different between version 52 and version 53. But the objects included in the PDF file should be quite close. We don’t embed everything in one big image, and we actually create the same types of objects as before: text, vector drawing, etc. The PDF files also include fonts, for sure. In the PDF file you attached, the content is actually an image. But this PDF is generated by Ghostscript, and this is why it’s only an image: Ghostscript, for some reason, transformed the whole content into a single image. The reason why Ghostscript was able to keep the objects with version 52 but not with 53 is a mystery. Do you have any message in Ghostscript’s logs related to this topic? |
Hello! Did you find the time to check Ghostscript’s logs? |
Feel free to reopen if needed. |
Hello, @liZe sorry i cannot reopen this issue should i create a new one or could you reopen it? i am realy sorry i totally forgott about my issue, because i reverted weasyprint to the older 52.5 version. But know because of some word break errors in 52.5 i had to switch back to the newer version. I tried it again with weasyprint version 54 and the problem occured again. It seems this problem occures if you convert the pdf to an ps using ghostscript. I need this step to convert rgb to cmyk with plain black instead of rich black. Ghostscript doesn't realy say that an error occured:
Additionally i had the same problem converting a pdf with an transparent image in my pdf files, but in this particular test i didn't had one. Here is a quote from the ghostscript documentation. I added a zip with my newest test with all the converted pdfs and postscript files. Perhaps you could find a difference between them. Would be nice if Weasyprint would add an option to convert the pdf to CMYK :D so that the ghostscript step is not needed. Here is my ghostscript code:
|
Yes, that would be awesome. There’s already an open issue for that: #1091. We really don’t know why Ghostscript generates an image with this PDF. Asking the Ghostscript devs is probably the best solution to know what’s going on, and to see if it’s possible to "fix" that in WeasyPrint. |
Ah okei how is the progress going on this issue? Would it also be possible to convert the rich black texts to plain black? I opend a issue and asked the developer for help: https://bugs.ghostscript.com/show_bug.cgi?id=704872 Update: It seems that the new engine is creating the pdf with images having an alpha channel set to 1. Ghostscript tries to identify all images which use pointless transperency, but because of the new engine it does not detect it anymore.
|
Thanks for the ticket open for Ghostscript. As explained by the gs devs, using PostScript as an intermediate format looks like a bad idea, as PostScript misses a lot of features that PDF has, including transparency management. We could try to avoid useless transparency, but that would require a lot of work: we’ve tried to add a quick fix, but the problem is complicated to "solve" (and even Cairo didn’t "solve" it)… And again, there’s no bug in WeasyPrint or in Ghostscript, there’s just an optimization in Ghostscript for Cairo that doesn’t work anymore now that we don’t use Cairo. (For the record: we tried to avoid to call |
Hello,
since the Weasyprint Update 53.3 all images, texts etc. are rendered as one big image in the PDF.
Using Adobe Acrobat Pro in the preflight mode, no texts objects, image objects and vectore objects are shown anymore. For better understanding i attached both files. The first file showes the created PDF using Weasyprint Version 52.5 and the second Version 53.3. Futhermore Fonts are also not detected anymore in the preflight mode.
The problem with this is that i am converting my PDF using ghostscript to a CMYK format. Now that the whole document is just one big image, ghostscript cannot detect any textelements and is formating it not correctly. On Version 52.5 this worked without any problems.
Here is my Code for generating the pdf. All my styles are directly inserted into the html.:
Do i need to configure something else to render them seperately? Or is this now the standard?
I attached both pdfs and the preflight mode of Adobe Acrobat Pro(PDF-Analyze-> List Siteobjects, grouped by object type).
Best Regards,
David
converted_newest_weasy.pdf
![image (6)](https://user-images.githubusercontent.com/4179598/142620836-a20a8421-4926-42cb-bb73-69eaef937ad6.png)
converted_old_weasyprint.pdf
The text was updated successfully, but these errors were encountered: