Write MagickImageCollection to PDF with images of different sizes. #1622
Unanswered
harleygnuya
asked this question in
Help
Replies: 2 comments 5 replies
-
That is probably how your PDF viewer works? If you would wand to have the same size you probably need to resize all the images? Or you could play around with the density of the image? |
Beta Was this translation helpful? Give feedback.
3 replies
-
I haven't had time to investigate this yet. Still not clear what causes this. Do you have any updates? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have 14 MagickImage images in a MagickImageCollection that I wish to save as a multi-page PDF with each image on its own page. This is a view from Visual Studio 2022 of the contents of the collection at the point where I am about to write the collection to a PDF file:
`
<title>Document</title>As you can see, two of the images are 5100x3300 pixels and the rest are all 2550x3300.
When I execute this statement:
Images.Write(PageImages[1].ImageFileName.PDFPathName, MagickFormat.Pdf);
where PageImages[1].ImageFileName.PDFPathName is the filename and MagickFormat.Pdf is the format, a good, proper and readable pdf file is generated with all of the images on their own pages and in proper sequence, but all of the images are the same size: 5100x3300 pixels. The smaller (2550x3300) images appear in the PDF as if they were drawn onto a 5100x3300 canvas with northwest gravity.
How can write the PDF file so that all of the images retain their original sizes in the PDF file?
.NET 8.0, C# 12.0, Magick.NET-Q8-AnyCPU(13.6.0), Magick.NET.SystemWindosMedia (7.2.2), Visual Studio 2022
Beta Was this translation helpful? Give feedback.
All reactions