Welcome Guest Search | Active Topics | Sign In | Register

SVG image Options
abx
Posted: Monday, February 11, 2013 2:29:40 PM
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?
eo_support
Posted: Monday, February 11, 2013 2:36:13 PM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.