
PDFXpress™ FAQ |
![]() |
| Q1: How can I determine if I have the latest version of a Pegasus control? |
| Q2: What is the minimum code needed to open and render a PDF file? |
| Q3: How do I create a RenderOptions Object? |
| Q4: How do I distribute my application(in Delphi, .NET, VB, C++ etc.)? |
| Q5: What DLL's do I need to distribute with my application? |
| Q6: I am trying to open a PDF file and am supplying a valid password, but am not able to render the PDF document. |
| Q7: Why is the output file blank when rendering PDF files at particular resolutions (via the ResolutionX and ResolutionY properties of the RenderOptions object), but the PDF in question renders successfully in Adobe Acrobat? |
| Q8: What version of PDF files does PDFXpress support? |
| Q9: I am using a trial version of PDFXpress, however when I try to use certain methods I get a licensing message. Why is this and how do I resolve? |
Q1: How can I determine if I have the latest version of a Pegasus control? |
| Please download the PegConnect utility program from the following link: PegConnect or reference the Latest Builds page. |
Q2: What is the minimum code needed to open and render a PDF file? |
| VB 6: PdfXpress1.Initialize Dim currentDoc As New PegasusImagingActiveXPdfXpress1LibCtl.PdfDocument PdfXpress1.Documents.Clear Set currentDoc = PdfXpress1.Documents.Add("C:\pdfsample.pdf", " ") ImagXpress1.hDIB = currentDoc.RenderPageToDib(0) Set currentDoc = Nothing C#: pdfXpress1.Initialize(); pdfXpress1.Documents.Add("C:\\pdfsample.pdf"); picImagXpress1.hDIB = pdfXpress1.Documents[0].RenderPageToDib(0); pdfXpress1.Documents.Clear(); Delphi: var pdfdoc : PdfDocument; begin PDFXpress1.Initialize(); PdfXpress1.Documents.Clear; pdfdoc := pdfxpress1.Documents.Add('C:\pdfsample.pdf',''); Xpress1.hDIB := pdfdoc.RenderPageToDib(0); |
Q3: How do I create a RenderOptions Object? |
| VB: Dim opt As New PegasusImagingActiveXPdfXpress1LibCtl.RenderOptions opt.HorizontalResolution = 200 opt.VerticalResolution = 200 C#: PegasusImaging.WinForms.PdfXpress1.RenderOption renderoption; renderoption = new PegasusImaging.WinForms.PdfXpress1.RenderOption(); renderoption.HorizontalResolution = 300; renderoption.VerticalResolution = 300; Delphi: var render1 : IRenderOptions; begin PDFXpress1.Initialize(); render1 := RenderOptions(CreateComObject(CLASS_RenderOptions)); render1.HorizontalResolution := 100; render1.VerticalResolution := 100; |
Q4: How do I distribute my application(in Delphi, .NET, VB, C++ etc.)? |
| PLEASE NOTE: You must have your unlock codes to distribute your application in the majority of the scenarios outlined below. If you do not have these please complete the form at: http://www.pegasusimaging.com/lostcodes.htm and the codes will be sent to you. 1) Add a declaration to the UnlockRuntime method where your program starts up and pass the 4 unlock codes as the parameters to the method. 2) If you are using .NET as your development tool you must do # 1 AND call the PegasusImaging.WinForms.PdfXpress1.Licensing.UnlockControl function and pass as the parameters the same 4 unlock codes that are passed as the parameters to the UnlockRuntime method as mentioned in #1. Please refer to the code samples below for the specific .NET development environments: For C# Developers: Call the static UnlockControl function in the class constructor BEFORE the generated call to InitializeComponent () as follows: Public FormMain() { PegasusImaging.WinForms.PdfXpress1.Licensing.UnlockControl(1234,1234,1234,1234); InitializeComponent(); } For Visual Basic. NET Developers: Call the static UnlockControl function in the class constructor (i.e. New function) BEFORE the generated call to InitializeComponent () as follows: Public Sub New () MyBase.New () PegasusImaging.WinForms.PdfXpress1.Licensing.UnlockControl(1234,1234,1234,1234); InitializeComponent() End Sub 2) If you are using the PDFXpress COM object in VC++ as your development tool you must do #1 and declare the UnlockControl function as outlined below: The PDFXpress COM Object contains a locking mechanism that does not permit you to distribute applications created with evaluation versions of PDFXpress. When you purchase PDFXpress runtimes, you are given a set of 4 numeric registration codes that are your individual password set for unlocking PDFXpress for distribution. If you do not unlock PDFXpress, applications will not run on end user machines. Before distributing an application, you must unlock PDFXpress. pd1_open.cpp is included with PDFXpress to handle licensing for the COM Object. You can find pd1_open.cpp in the PDFXpress ActiveX-COM \Include directory. In the PD_Open() function, locate the call to UnlockControl (). Replace the four parameters in that call with the four registration codes you obtained when you purchased the PDFXpress runtimes. When you compile your project, PDFXpress should be unlocked meaning that you should no longer see the "Evaluation" message boxes. 4) If you are using the PDFXpress control as a COM object in VB you must do #1 and declare the UnlockControl function as outlined below: 1) Add a reference to the PDFXpress control via Project|References. 2) Declare the UnlockControl function as follows: Private Declare Sub PDFUnlock Lib "PegasusImaging.ActiveX.PdfXpress1.dll" Alias "UnlockControl" (ByVal pw1 As Long, ByVal pw2 As Long, ByVal pw3 As Long, ByVal pw4 As Long) 3) Dim the PDFXpress control object: Dim PdfXpress1 As PegasusImagingActiveXPdfXpress1Lib.PdfXpress 4) Call the unlock method BEFORE creating the PDFXpress object: PDFUnlock 1234,1234,1234,1234 Set PdfXpress1 = New PegasusImagingActiveXPdfXpress1Lib.PdfXpress 5) If you are using the control within HTML you must obtain a web license string. This web license string is received from Pegasus Imaging when the web license is purchased. The web license string is passed as the parameter to the IntegratorWeb method. Please refer to http://www.pegasusimaging.com/weblicfaq.htm for more information on using the control within a web environment. |
Q5: What DLL's do I need to distribute with my application? |
| PLEASE NOTE: The CMap and CFont files installed under the Support folder in the PDF Xpress install tree need to be distributed if you do not want to render the PDF files with the system fonts and maps. If these are not distributed then the PDF file will be rendered with the system fonts and maps. For .NET Windows Forms Applications PegasusImaging.WinForms.PdfXpress1.dll For All Other Applications: PegasusImaging.Worker.PdfXpress1.dll PegasusImaging.ActiveX.PdfXpress1.dll - ActiveX Control If you are using the PegasusImaging.ActiveX.PdfXpress1.dll, it needs to be registered after it is installed. Make sure that your installation program registers the PegasusImaging.ActiveX.PdfXpress1.dll COM component before you run your application. |
Q6: I am trying to open a PDF file and am supplying a valid password, but am not able to render the PDF document. |
| The most likely reason this happens is that the PDF file under the Security Section has the “Content Copying or Extraction” set to Not Allowed. This setting needs to be changed to Allowed so PDFXpress can render the file. This can be changed in Adobe by checking the box under the Settings dialog that reads, “Enable copying of text, images, and other content.” |
Q7: Why is the output file blank when rendering PDF files at particular resolutions (via the ResolutionX and ResolutionY properties of the RenderOptions object), but the PDF in question renders successfully in Adobe Acrobat? |
| This is because Adobe Acrobat v7.x most likely does not use the same version of the PDF Library that PDFXpress relies upon. Because of this limitation, using higher resolutions may result in a blank page being generated depending on the specific PDF file being rendered. Our recommendation is to lower the resolution and then try rendering the file. |
Q8: What version of PDF files does PDFXpress support? |
| PDFXpress v1 will open a well-formed PDF document of any version, if a valid user- or owner-password is provided, as required. The PDF specification is designed to be backwards compatible. Even earlier versions of Adobe Reader should open the newest PDFs; unknown features are typically ignored. Operations such as printing to EPS, rendering, etc are governed by the permissions associated with the password (if any) used to successfully open the PDF. PDFXpress will create PDF v1.5 documents due to the version of the Adobe PDF Library that it employs. PDFXpress v1 will modify an open PDF document if permissions associated with the password used to open the document permit changes can be made. |
Q9: I am using a trial version of PDFXpress, however when I try to use certain methods I get a licensing message. Why is this and how do I resolve? |
| Certain features of PDFXpress are limited by what edition of PDFXpress one is using, i.e. there are certain features in the Professional Edition which can't be used in the Reader Edition. You must set the LicenseEdition type to PDF_ProfessionalEdition to use the Professional Edition features. |