Using pdfcreactivex.dll in cpp program

If you are a C/C++/C# developer and have any questions about using our products from your application here is the place to post them.
Post Reply
mrtflv
Posts: 21
Joined: Tue Apr 20 2004

Using pdfcreactivex.dll in cpp program

Post by mrtflv » Tue Mar 13 2007

Is there anyone that used pdfcreactivex.dll inside a cpp program, without including it in a form, and can give me a sample.
What I want to do is to use the pdfcreactivex to load a specific page from a pdf and send to a printer hDC.
Thanks for any help.
Flavio

Jose
Amyuni Team
Posts: 549
Joined: Tue Oct 01 2002
Contact:

Post by Jose » Tue Mar 13 2007

Hello,

To obtain the .h and cpp files for the object and pdfcreator classes please follow the steps below:

In VS 6.0, from the top menu select “Add to Project” then “Components and Controls”. In the resulting dialog box select the “Registered ActiveX Controls” folder and insert the “PDFCreactiveX class”. This will also create the .h and cpp files for the object and pdfcreator classes and add them to your project.

This will give you access the PDF Creator without adding the component a form.

Hope this helps?

kschmidt
Posts: 13
Joined: Thu Feb 02 2006

Post by kschmidt » Tue Aug 28 2007

Alternately you can do it all in code using a #import directive like:

Code: Select all

#import "pdfcreactivex.dll" rename("GetObject", "PDFGetObject") rename("TextOut", "PDFTextOut") rename("GetCharWidth", "PDFGetCharWidth") rename("DrawText", "PDFDrawText")

and then create your objects like:

Code: Select all

  HRESULT hr = m_PdfObj.CreateInstance(_T("PDFCreactiveX.PDFCreactiveX.4"));
  ASSERT(SUCCEEDED(hr));

  _bstr_t name = _T("PDF Creator Evaluation license");
  _bstr_t key = _T("Long license snipped");
  hr = m_PdfObj->SetLicenseKey(name, key);
  ASSERT(SUCCEEDED(hr));
You may not have to include those renames depending on the headers you have included.

Post Reply