Rank: Newbie Groups: Member
Joined: 2/11/2013 Posts: 1
|
I am able to export correctly SVG images to a PDF but when I retrieve a page image from the PageImage property the quality is very poor and the all the labels are nothing more than black squares. This is the code I am using: Quote: var options = new HtmlToPdfOptions();
options.PageSize = new SizeF(PdfPageSizes.A4.Width, PdfPageSizes.A4.Height); options.OutputArea = new RectangleF(0f, 0f, PdfPageSizes.A4.Width, PdfPageSizes.A4.Height); options.GeneratePageImages = true; options.JpegQualityLevel = 100; options.PreserveHighResImages = true; var result = HtmlToPdf.ConvertUrl(url, outputFileName, options); result.PageImages.ToList().ForEach((i)=> { i.Save("C:\\TEST\\img" + Guid.NewGuid() + ".png"); });
Any tip?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
Labels becoming back sounds like a bug. Please provide a svg sample file and we will look into it. We will PM you the email address for sending the files.
Poor image quality is normal. That's exactly why SVG is a better option than pixel based images. SVG is in vector format, so you can zoom in infinitely without losing quality. Where as if you use GeneratePageImages, everything is flattened out as bitmap in screen resolution. So if you zoom in the result image anything bigger than screen resolution, you will notice visible quality loss.
Thanks!
|