how to use the print driver in C++ Builder

PDF-XChange Drivers API (only) V4/V5
This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - VERSION 4 & 5 - Please use the PDF-Tools SDK Forum for Library DLL assistance.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan

Post Reply
j.halder
User
Posts: 7
Joined: Fri Nov 11, 2011 11:36 am

how to use the print driver in C++ Builder

Post by j.halder » Fri Nov 11, 2011 12:20 pm

Is there an example available how to use the print driver 4.0 in C++ Builder?
I have seen and tried the code in the file MainDlg.c. But it doesn't work. Some symbols like PXC::... are not defined.

Are there header files for C++ available?
Where ist the ActiveX and how to implement?

In the help file (PDFX4DRV_API) ist written:
"...you should manually reference the type library (pxccom.tlb) located in the PDF-XChange installation directory."
Where ist the file pxccom.tlb? I can't find it.

I use PDF-XChange 3.0 for many years and it works great.
I hope smoebody can help me, so I can use PDF-XChange 4.0 for Win7.

Thanks
Josef

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14196
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: how to use the print driver in C++ Builder

Post by Tracker Supp-Stefan » Fri Nov 11, 2011 12:29 pm

Hello Josef,

The baths below are from my machine (I have the full PRO SDK pacakge - but if you used the default path, the only difference should be the name of the SDK package.

You can find the C examples in
C:\Program Files\Tracker Software\PDF-XChange PRO 4 SDK\Examples\APIExamples\CExamples\CExAPI subfolders

The type library (pxccom.tlb) you can find in
C:\Program Files\Tracker Software\PDF-XChange PRO 4 SDK\pdfSaver\

Best,
Stefan
Tracker

j.halder
User
Posts: 7
Joined: Fri Nov 11, 2011 11:36 am

Re: how to use the print driver in C++ Builder

Post by j.halder » Fri Nov 11, 2011 12:45 pm

Hello Stefan,

in my pdfSaver directoy is no pxccom.tlb file.
I have installed at first PDFX4API.exe and then PDFSDKPRO4.exe.
Did I install the wrong?

In such cases usually I have to include a *.lib or ActiveX.
How is it here?

Regards
Josef

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14196
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: how to use the print driver in C++ Builder

Post by Tracker Supp-Stefan » Fri Nov 11, 2011 1:24 pm

Hello Josef,

Not sure what's happening - but see attached the contents of the whole
C:\Program Files\Tracker Software\PDF-XChange PRO 4 SDK\pdfSaver\ directory from my machine

Best,
Stefan
Attachments
pdfSaver.zip
(4.4 MiB) Downloaded 217 times

j.halder
User
Posts: 7
Joined: Fri Nov 11, 2011 11:36 am

Re: how to use the print driver in C++ Builder

Post by j.halder » Mon Nov 14, 2011 11:45 am

Hello Stefan,

thanks for the type library (pxccom.tlb).
Now I have it imported in the IDE as a type library.
Two header files were generated and I can see the TCPXCControlEx in the component list.
But I don't manage to integrate it in my software.

I'm using Borland (Embarcadero) C++ Builder.
I found two examples. One for Delphi and one for Microsoft Visual++ (CExAPI).
Is there also an example or a description for C++ Builder available?

Regards
Josef

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14196
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: how to use the print driver in C++ Builder

Post by Tracker Supp-Stefan » Mon Nov 14, 2011 11:57 am

Hello Josef,

Nope I think there isn't a C++ Builder sample, but will try to ask the guys if they have anything not officially included in the samples with the SDK that we can send to you.

Best,
Stefan

Ivan - Tracker Software
Site Admin
Posts: 3630
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: how to use the print driver in C++ Builder

Post by Ivan - Tracker Software » Mon Nov 14, 2011 12:51 pm

No, sorry - there are no C++ Builder samples - we very rarely get requests for such samples. You have to use PXCControlEx and PXCPrinter as with any other ActiveX....
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.

j.halder
User
Posts: 7
Joined: Fri Nov 11, 2011 11:36 am

Re: how to use the print driver in C++ Builder

Post by j.halder » Wed Nov 16, 2011 8:22 am

Hello Stefan,
can you please help me.
I don't manage to integrate the "PDF-XChange Drivers API SDK - V4" in the Borland C++ Builder IDE. I've already included some of ActiveX, but it's not my daily work. Maybe I'm using the wrong library.

I have a (completed) reporting module and want to create a PDF instead of the print outs.
I think "PDF-XChange Drivers API SDK - V4" is the right !?

Now I have uninstalled everything, new downloaded and new installed.
The installation package PDFX4API.zip/PDFX4API.exe doesn't contain the type library pxccom.tlb. I've used the one you have sent last week.

The import as ActiveX in the Borland IDE worked perfectly. The following class was created:

class PACKAGE TCPXCControlEx : public Oleserver::TOleServer
{
IPXCControlEx2Ptr m_DefaultIntf;
_di_IUnknown __fastcall GetDunk();
public:
__fastcall TCPXCControlEx(TComponent* owner) : Oleserver::TOleServer(owner)
{}
IPXCControlEx2Ptr& GetDefaultInterface();
void __fastcall InitServerData();
void __fastcall Connect();
void __fastcall Disconnect();
void __fastcall BeforeDestruction();
void __fastcall ConnectTo(IPXCControlEx2Ptr intf);
void __fastcall RemoveOrphanPrinters(BSTR pServerName/*[in]*/,
BSTR pPrinterName/*[in]*/);
};

The methods I need (f.e. get_Printer()) are available in the interface declaration but missing in the TCPXCControlEx class.

What can I do?
Any idea?

greetings
Josef

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14196
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: how to use the print driver in C++ Builder

Post by Tracker Supp-Stefan » Wed Nov 16, 2011 1:01 pm

Hello Josef,

I am not a C++ Builder expert myself, so I have asked our devs to take a further look at this topic and we will answer as soon as possible what could be wrong or needs to be tweaked to make our SDK work for you.

Best,
Stefan

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14196
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: how to use the print driver in C++ Builder

Post by Tracker Supp-Stefan » Thu Nov 17, 2011 1:05 pm

Hi Josef,

I got this snippet from our devs and they told me that it should work:

Code: Select all

void __fastcall TForm1::FormShow(TObject *Sender)
{
 CPXCControlEx1->Connect();
 IPXCControlEx2Ptr pp = CPXCControlEx1->GetDefaultInterface();
 if (pp)
 {
  IPXCPrinter2Ptr prnt;
  prnt = pp->get_Printer(L"", L"Simple PDF-XChange", L"<REG CODE>", L"<DEV CODE>");
  CPXCPrinter1->ConnectTo(prnt);
 }
 IPXCPrinter2Ptr  p = CPXCPrinter1->GetDefaultInterface();
 if (p)
 {
  BSTR str = p->get_Name();
  ShowMessage(str);
 }
}

Code: Select all

<<< __published: // IDE-managed Components
 TCPXCPrinter *CPXCPrinter1;
 TCPXCControlEx *CPXCControlEx1;

j.halder
User
Posts: 7
Joined: Fri Nov 11, 2011 11:36 am

Re: how to use the print driver in C++ Builder

Post by j.halder » Fri Nov 18, 2011 8:41 am

Hello Stefan,

I can't find the class TCPXCPrinter.
The header files that the Borland IDE has generated from the pxccom.tlb contains only one class. It is the TCPXCControlEx.
Is the pxccom.tlb you've sent me the right for this job?
I remind the installation package doesn't contain a pxccom.tlb.

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14196
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: how to use the print driver in C++ Builder

Post by Tracker Supp-Stefan » Fri Nov 18, 2011 1:39 pm

Hello j.halder,

I've passed this to our devs and they will check the file I have provided and advise what could be wrong at your end.

Best,
Stefan

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14196
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: how to use the print driver in C++ Builder

Post by Tracker Supp-Stefan » Fri Nov 18, 2011 3:03 pm

Hello again j.halder,

Please take a look at the attached files - this is what our devs sent me as the steps you need to perform to include a .tlb file to your project, and the none I've provided above should be the correct one.

Best,
Stefan
Attachments
screenshots.zip
(33.22 KiB) Downloaded 207 times

j.halder
User
Posts: 7
Joined: Fri Nov 11, 2011 11:36 am

Re: how to use the print driver in C++ Builder

Post by j.halder » Mon Nov 21, 2011 6:47 am

Hello Stefan,

that's exactly what I've done.
The attached files were generated (my IDE is a german version).

But I havn't noticed that there is an comment at line 60 in the file PXCComLib_OCX.cpp: "skip of COCLASS: CPXCPrinter - Lacks 'CanCreate' flag.
I'm using borland c++ Builder 2006. It's a slightly older version. Can it be the problem?

Best,
Josef
Attachments
PXCComLib_OCX.zip
(13.84 KiB) Downloaded 185 times

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14196
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: how to use the print driver in C++ Builder

Post by Tracker Supp-Stefan » Mon Nov 21, 2011 11:44 am

Hello Josef,

I am not "into it" with C++ Builder, so I am only guessing, but certainly if you could try with a newer version - it will show whether the problem is in the environment.

Best,
Stefan

j.halder
User
Posts: 7
Joined: Fri Nov 11, 2011 11:36 am

Re: how to use the print driver in C++ Builder

Post by j.halder » Mon Nov 21, 2011 2:38 pm

Hello Stefan,

now I have installed the latest version of C++ Builder XE on a new machine. The import of the pxccom.tlb was here no problem - no error. The classes TCPXCControlEx and TCPXCPrinter are available.
It seems the pxccom.tlb is not suitable for the C++ Builder 2006.

However I need a solution for Windows7 soon as possible and I can't change my development system so fast.
The PDF-XChange 3 doesn't work with Windows7.

Is it possible for your devs to make a pxccom.tlb which is compatible to C++ Builder 2006?
It would be great!

Best,
Josef

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14196
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: how to use the print driver in C++ Builder

Post by Tracker Supp-Stefan » Mon Nov 21, 2011 2:49 pm

Hello Josef,

I will ask them, but can't promise anything, as we are dedicating pretty much all our development resources for finalizing ver5 - so support and fixes could be delayed for such issues, and it might be most optimal for you to consider an upgrade of your development environment.

Best,
Stefan

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14196
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: how to use the print driver in C++ Builder

Post by Tracker Supp-Stefan » Tue Nov 22, 2011 9:26 am

Hello Josef,

Please install the package attached to this post in C++ Builder 2006 and it should work.

Best,
Stefan
Attachments
PDFX4API.ZIP
(17.2 KiB) Downloaded 189 times

Post Reply