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

Get image dimensions in library? #5

Closed
RibalGZ opened this issue Mar 4, 2018 · 2 comments
Closed

Get image dimensions in library? #5

RibalGZ opened this issue Mar 4, 2018 · 2 comments

Comments

@RibalGZ
Copy link
Contributor

RibalGZ commented Mar 4, 2018

Hi,

First I want to thank you for work in this library :)
I'm currently working on a html2pdf converter in ANSI-C, and when it comes to drawing an img without dimensions, I needed to create a function to get its original height and width.

Since to draw an image with PDFGen the dimensions are mandatory, do you think it would be useful to include that function in the library or would you prefer it to be a feature to be implemented in the client?

If you want, I can send a pull request implementing this feature.

@AndreRenaud
Copy link
Owner

Hi,
The dimensions that you specify when adding an image are not the pixel dimensions of the image, they're the displayed width/height of the image when it is rendered in the PDF, specified in points. So they don't really have anything to do with how large the image itself it. Extracting dimensions from the image seems like something that should be done outside of PDFGen.

@RibalGZ
Copy link
Contributor Author

RibalGZ commented Mar 4, 2018

Perfect, thanks

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