Looking into Properties and APIs
PDF File Loading
You may easily load a PDF document to read into your .NET program by two means.
- Load and read a local PDF file.
public bool LoadPDF(string fileName);
- Load and read PDF using stream. Both memory stream and file stream are supported.
public bool LoadPDF(Stream stream);
If your PDF file loading is completed with no error, it will return true. And false is for wrong loading.
PDF Page Counting
pqScan .NET PDF to Image Component allows you to count and get the amount of PDF document pages in .NET project. Please use the code below to perform this function.
DPI (Dots per Inch) Setting
It's quite easy to change the rendered image definition via setting DPI property. Our .NET PDF to Image Conversion Library will render the output image according to user-defined DPI property.
Obtain Page Size Detail
The original size of PDF document page can be obtained by using the codes below.
public int GetPageHeight(int pageIndex);
public int GetPageWidth(int pageIndex);
Control PDF to PNG Conversion
pqScan .NET PDF to Image SDK allows you to control the way of PDF to PNG conversion. For instance, you may choose to convert a certain page of PDF to PNG only. Of course, a range of PDF pages or the whole file can also be changed to PNG image files.
public Bitmap ToImage(int pageIndex);
Moreover, you can control and reset the rendered PNG image width and height.
public Bitmap ToImage(int pageIndex, int width, int height);