Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Read PDF - 4 times the number of pages in collection

$
0
0
Hello everyone,

My aim is to convert PDF documents to Jpeg files. Simple for now.

My Csharp application reads the PDF file and saves a jpg version using Magick.NET
(I use version 7 of Magick.NET running .NET 4.5)

I've found out recently that for some PDF files that customers drop into my app that I end up with 4 times the amount of pages that the PDF file has.

All i'm doing is pretty basic and just comes down to this:

using (var imageCollection = new MagickImageCollection())
{
imageCollection.Read(<PathToThePDFFile>, new MagickReadSettings { Density = new PointD(<myDPISettings>, <myDPISettings>)});

// further processing code down there ...
}

It is behaving fine for some PDFs, but for some that have background images or more slightly evolved layout in the pages, i end up with the collection having items being 4 times the number of PDF pages.

So if i look at one PDF page, the 4 corresponding images have differences in them. So for instance the first one only has the original text, then the second has the text plus part of the background image and so on.

I have tried flattening the images, but again it doesn't really work as I want to end up with the same amount of Jpegs than PDF pages.
I've also played with various DPI settings, but with no luck

I'm basically wondering if Magick.NET and ImageMagick can convert more complex PDF files.
This is really important for my application as a lot of users are now feeding these types of PDF into my system.

Have you ever run into this problem before?
If so any advice? or another third party solution that could help (free or not is not problem)

Thank you

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>