We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Font sizes/weight in rendered images

Hi All,

If anyone can help me here it would be immensely appreciated! I wanted to know if there was anyway to control what font sizes or font weight is chosen when ASPOSE renders images from a PDF, what we are seeing is that the font is not as eligible as the pdf.

Thanks!

Hi,


Thanks for contacting support.

I am afraid currently Aspose.Pdf does not support the feature to control Font size & Weight when converting PDF pages to Image format. However if you are facing any issue while converting PDF pages to Image format, please share the resource files, so that we can test the scenario in our environment.

Thanks for your quick reply, okay thanks for the info, do you know if there is a plan to support floating point zoom factors rather than integer zoom factors when rendering the page?

Thanks!<?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" />

Hi,


Can you please share the code snippet so that we can properly understand your requirement.

Sure,

MemoryStream imageStream = new MemoryStream();<?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" />

// Create Resolution object – It is here we would like the Resolution object to support a floating point Zoom parameter for more precise sizing of the resulting image

Resolution resolution = new Resolution(Convert.ToInt32(Zoom))

BmpDevice bmpDevice = new BmpDevice(resolution);

bmpDevice.Process(page, imageStream);<o:p></o:p>

imageStream.Seek(0, SeekOrigin.Begin);<o:p></o:p>

System.Drawing.Image rawImage = System.Drawing.Image.FromStream(imageStream);

Also is there a way to get the
pixel width and height of the image created when Zoom = 100.

We can’t seem to find a formula
to convert the page rectangle to pixels.

Currently we rendering a 100%
image to get the pixel width and height.

Many thanks!<o:p></o:p>


<o:p></o:p>

thereachagency:

MemoryStream imageStream = new MemoryStream();

// Create Resolution object – It is here we would like the Resolution object to support a floating point Zoom parameter for more precise sizing of the resulting image

Resolution resolution = new Resolution(Convert.ToInt32(Zoom))

BmpDevice bmpDevice = new BmpDevice(resolution);

bmpDevice.Process(page, imageStream);<o:p></o:p>

imageStream.Seek(0, SeekOrigin.Begin);<o:p></o:p>

System.Drawing.Image rawImage = System.Drawing.Image.FromStream(imageStream);

Hi,

Thanks for sharing code. I am afraid currently Resolution object only supports integer parameter. We have logged a ticket PDFNEWNET-38459 in our issue tracking system for your requirements. We will notify you as soon as it is implemented.

thereachagency:

Also is there a way to get the pixel width and height of the image created when Zoom = 100.

We can’t seem to find a formula to convert the page rectangle to pixels.

Currently we rendering a 100% image to get the pixel width and height.


Please note Aspose.Pdf measuring unit is point. You can convert point to pixel as suggested in this post.


Best Regards,