Skip to content
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

linking images in PDF #222

Closed
chubz opened this issue Oct 7, 2014 · 3 comments
Closed

linking images in PDF #222

chubz opened this issue Oct 7, 2014 · 3 comments

Comments

@chubz
Copy link

chubz commented Oct 7, 2014

Hi,
I'm unsure whether this is related to weasyprint or underlying library but you guys could maybe answer this:
I've run weasy on my local env and on a server env and got same results but on my own html this issue is distributed differently. You have two images that are used in the test run of weasy print from docs.
weasyprint http://weasyprint.org ./weasyprint-website.pdf
This command produces a pdf which has this issue when analyzed ...
3_photoshop images import

So of the two png images only one is recognized as a link and a separate image in Photoshop. Other issue is when manipulating with the image in Illustrator with following behaviour
2_illustrator_second link
1_illustrator_fist link

as you see the logo image not recognized as an image in Photoshop repeats while the smiley ong image behaves normal.

This issue with images not being linked is what is happening with my custom html where images not linked are done with an img tag (like the smiley png). Any help or ideas as to what might be causing this would be helpful

@SimonSapin
Copy link
Member

I’m sorry, I don’t really understand what the problem is. Please explain what you’re trying to accomplish, how step by step you’re doing it, what result you expect, and what result you obtain instead. Note that I don’t know Photoshop or Illustrator, and I especially don’t know what they do to import PDF files.

In particular:

I've run weasy on my local env and on a server env and got same results but on my own html this issue is distributed differently.

What is the same as what? What is different from what? What does "distributed" mean here?

You have two images that are used in the test run of weasy print from docs.
weasyprint http://weasyprint.org ./weasyprint-website.pdf
This command produces a pdf which has this issue when analyzed ...

What is the issue?

So of the two png images only one is recognized as a link and a separate image in Photoshop.

What does "recognized as a link" mean? "separate" from what?

Other issue is when manipulating with the image in Illustrator with following behaviour

as you see the logo image not recognized as an image in Photoshop repeats while the smiley ong image behaves normal.
This issue with images not being linked is what is happening with my custom html where images not linked are done with an img tag (like the smiley png). Any help or ideas as to what might be causing this would be helpful

Again, I’m not sure what you’re saying here.

What I can tell you is that the logo on the home page is set with a CSS background-image property, while the Acid2 smiley is an HTML <img> element. WeasyPrint implements them differently, because CSS background images can be repeated. background-repeat can be set to repeat in only one of the X or Y dimensions, while PDF patterns repetition is all (both dimensions) or nothing. So, for simplicity, WeasyPrint always makes PDF patterns for background images, but may set the repeating stride and clipping rectangle so that the repetition is invisible in the given dimension, based on the background-repeat property. The relevant code is in weasyprint.draw.draw_background_image.

Now, why is it a problem to you that background-image and <img> are implemented differently?

@chubz
Copy link
Author

chubz commented Nov 25, 2014

This is not weasyprints issue but rather it is related to one of the underlying libraries.
No need to have this issue open.

@chubz chubz closed this as completed Nov 25, 2014
@SimonSapin
Copy link
Member

Thanks for following up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants