-
Notifications
You must be signed in to change notification settings - Fork 221
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
Make a PDF with an image in memory #252
Comments
You could use I do however not really understand the part about "without .... and compiling the library with png support". png support is required for reading png images regardless of whether the source of png image data is from - disk or memory. it's required in order to decode png data to raw binary color data which can then be compressed to one of the compression formats available with PDF. There's an option to compile the library without PNG support, if you don't expect png image input. check this section of the readme document. |
Thanks for answering me. Today I have compiled the library without any image support because I am using it to read existing PDF files. But now I am planning to use it to write small PDF file containing just only image in it. I was wondering how can I do that by just using my raw buffer. |
oh gotcha. ok...so you got the raw image data and you want to write an image object. You can learn how to do such a thing from the PNG implementation actually, or otherwise read the PDF format and look for Image XObject definition. then you can use the ObjectsContext to build the image. So you can track https://github.com/galkahana/PDF-Writer/blob/master/PDFWriter/PNGImageHandler.cpp specifically CreateFormXObjectFromPNGStream, and even more specifically CreateImageXObjectForData which directly writes the image object. i normally like to surround the image with a form xobject scaling the image, so it's later convenient to just place it. |
Thx |
Hi
I have compiled the library without any image libraries (tif, png, jpeg).
I would like to make a pdf and put only one image in it. My image is a raw buffer in memory.
How can I add it without the need to write my image on the disk as a png file and compiling the library with png support ?
The text was updated successfully, but these errors were encountered: