I have an issue with converting pdf to png image. My pdf contains barcode, that's why I need the best possible quality.
My code:
- Code: Select all
Random rand = new Random();
Spire.Pdf.PdfDocument doc = new Spire.Pdf.PdfDocument();
doc.LoadFromFile(@"C:\temp\paczkaWRuchu.pdf");
Image emf = doc.SaveAsImage(0, Spire.Pdf.Graphics.PdfImageType.Bitmap, 300, 300);
emf.Save(@"C:\temp\paczkaWRuchu" + rand.Next() + ".bmp", ImageFormat.Png);
I tried different dpix/dpiy settings, but the lines in barcode are always blurry.
When I tried using online converter (pdf2jpg) letters in my pdf were in worse quality, but barcode was crystal clear. How can I achieve that with Spire.Pdf? I attached my pdf file and output png file.