Does anyone have a sample of using the simple dll to export a PDF to a JPG or some other raster format?
Thanks
Sample request for simple dll: Rasterize to file
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 4
- Joined: Mon Apr 27, 2009 6:55 pm
-
- Site Admin
- Posts: 2449
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Sample request for simple dll: Rasterize to file
In pseudocode:
For details about it please see ActiveX SDK Help.
Code: Select all
SetProperty("Export.Image.Type", "PNG"); // "TIFF", "JPEG", "JPEG2000", "BMP" and more
SetProperty("Export.Image.RangeType", "All");
SetProperty("Export.Image.RangeFilter", "All");
SetProperty("Export.Image.PageZoom", "150%");
SetProperty("Export.Image.Resolution", "100");
SetProperty("Export.Image.Background", RGB(255,0,0) | 0xFF000000); // opaque red, 0xFFFFFFFF(white), etc.
SetProperty("Export.Image.FolderName", L"C:\\Pdf2Img"); // destination folder
SetProperty("Export.Image.FileName", L"<File Name>_<PAGE>"); // destination file title, some macros can be used
ExportDocument(nActiveDocID, PXCVA_NoUI);
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: Sample request for simple dll: Rasterize to file
If you have installed PDF-XChange Viewer SDK, then you can easily find samples in your "...\Tracker Software\PDF-XChange Viewer SDK\Examples\" directory.
-
- User
- Posts: 4
- Joined: Mon Apr 27, 2009 6:55 pm
Re: Sample request for simple dll: Rasterize to file
So I have tested the ActiveX version and the performance is lacking. I've been using another PDF toolkit that is a lot faster. Using the attached file, my current toolkit can load and export in under 4 seconds vs 20 seconds with the PDF - XChange Viewer ActiveX. I have another document that takes well over a minute to export.
Current code for VB6:
I'm looking for a new toolkit because my current toolkit does not support PDF v1.7. I can deal with a small performance hit, but 20 seconds is too much to handle. I had already looked at using the ActiveX version before posting this request. That is why I wanted to see if I could get a sample for the "Simple DLL" to see if it had better performance. All I need is to rasterize a PDF to disk. I have no need for an interface or a way to view the PDF. Let me know if there is anything I can do.
Current code for VB6:
Code: Select all
Call CoPDFXCview1.SetProperty("Export.Image.Type", "JPEG", 0)
Call CoPDFXCview1.SetProperty("Export.Image.RangeType", "All", 0)
Call CoPDFXCview1.SetProperty("Export.Image.RangeFilter", "All", 0)
Call CoPDFXCview1.SetProperty("Export.Image.PageZoom", "100%", 0)
Call CoPDFXCview1.SetProperty("Export.Image.Resolution", "150", 0)
Call CoPDFXCview1.SetProperty("Export.Image.FolderName", "C:\", 0)
Call CoPDFXCview1.SetProperty("Export.Image.FileName", "TEST", 0)
Call CoPDFXCview1.ExportDocument(iActiveDocID, PXCVA_Flags.PXCVA_NoUI)
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 2449
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Sample request for simple dll: Rasterize to file
Possible reason: your sample document contains large raster image - ~14000x10000 pixels...my current toolkit can load and export in under 4 seconds vs 20 seconds with the PDF - XChange Viewer ActiveX
You can try to use Viewer Simple SDK for this: to obtain standard HBITMAP resource from page and save manually to file (by GDI+ for example). This method can be faster.
Also, please let me - what is your current PDF-toolkit? We have become interested in its results.

Thank You.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 4
- Joined: Mon Apr 27, 2009 6:55 pm
Re: Sample request for simple dll: Rasterize to file
Many of my customers have PDFs that are nothing more than raster files 
The toolkit I am running right now is from LeadTools: http://www.leadtools.com/SDK/Raster/Ras ... on-PDF.htm
The quality of output from XChange Viewer when working with the previously attached PDF is far superior to LeadTools. I have attached some samples. This output from LeadTools is not typically that bad with 99% of PDFs, but that is why this PDF is a good test.
I have attached some other output samples that are a closer in quality. LeadTools converts these in less than 4 seconds and XChange Viewer in 10 seconds.

The toolkit I am running right now is from LeadTools: http://www.leadtools.com/SDK/Raster/Ras ... on-PDF.htm
The quality of output from XChange Viewer when working with the previously attached PDF is far superior to LeadTools. I have attached some samples. This output from LeadTools is not typically that bad with 99% of PDFs, but that is why this PDF is a good test.
I have attached some other output samples that are a closer in quality. LeadTools converts these in less than 4 seconds and XChange Viewer in 10 seconds.
You do not have the required permissions to view the files attached to this post.
-
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: Sample request for simple dll: Rasterize to file
Have you seen this sample?
"...\Tracker Software\PDF-XChange Viewer SDK\Examples\VBExamples\PXCView36\"
It shows how you can rasterize PDF with pxcview library (not the ActiveX component) using VB6.
"...\Tracker Software\PDF-XChange Viewer SDK\Examples\VBExamples\PXCView36\"
It shows how you can rasterize PDF with pxcview library (not the ActiveX component) using VB6.
-
- User
- Posts: 4
- Joined: Mon Apr 27, 2009 6:55 pm
Re: Sample request for simple dll: Rasterize to file
I have checked it out. I just need to cobble together a way to take the rendered image and save it to disk. If anyone has a reliable method to do this with GDI+ I would appreciate it.