Not getting "PDFXC3_StartDoc" on 64 bit Windows

This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - Please use the PDF-Tools SDK Forum for Library DLL assistance.

Moderators: Tracker Support, TrackerSupp-Daniel, Chris - Tracker Supp, Vasyl-Tracker Dev Team, Sean - Tracker, Andrew - Tracker Support, Tracker - Clarion Support, John - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software, Support Staff, moderators

Post Reply
DISystemer
User
Posts: 29
Joined: Fri Feb 18, 2005 2:23 pm
Location: Trondheim, Norway
Contact:

Not getting "PDFXC3_StartDoc" on 64 bit Windows

Post by DISystemer » Fri Jul 13, 2007 11:50 am

Hello,

When running our (32-bits Windows) application on 64-bit Windows Server 2003, pdf printing fails. To be precise: The printing itself runs ok, but our communication with the printer driver does not work so the user gets the driver's save dialog.

The driver installed is "PDF-XChange Driver for Microsoft Windows XP/2003 x64 Edition".

Our application normally uses the ActiveX control to communicate with the driver. This fails, and I have understood from this forum that it is not possible for this to work with a 32 bit application and 64-bit printer driver.

Because of this we changed our application to communicate with Windows messages, but unfortunately this fails too. Our application does not receive the 'PDFXC3_StartDoc' and 'PDFXC3_EndDoc' messages when running on 64 bit Windows. It works fine when running on 32 bit Windows, however.

I have read another article on this problem on this forum (http://www.tracker-software.com/forum/v ... php?t=2455), and here you suggest trying to put the message loop in a separate thread. I have tried that, but as of yet I have not been able to make this work neither in 32 bit nor 64 bit Windows.

I hope you can help me save this problem.

Arnstein

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

Post by Ivan - Tracker Software » Fri Jul 13, 2007 12:53 pm

you can try to get COM Object's dll (pxc30com.dll) from 32-bit installation and register it (using regsvr32) in x64 OS.
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.

DISystemer
User
Posts: 29
Joined: Fri Feb 18, 2005 2:23 pm
Location: Trondheim, Norway
Contact:

Post by DISystemer » Fri Jul 13, 2007 12:57 pm

I have already tried this.
The error message when instantiating the ActiveX control ("Class not registered") disappears after registering the 32 bit control, but it still doesn't communicate with the driver. In other words: The user still gets the save dialog from the driver.

Regards,
Arnstein

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

Post by Ivan - Tracker Software » Fri Jul 13, 2007 1:21 pm

Do you use VB ?
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.

DISystemer
User
Posts: 29
Joined: Fri Feb 18, 2005 2:23 pm
Location: Trondheim, Norway
Contact:

Post by DISystemer » Fri Jul 13, 2007 1:23 pm

No, we use Delphi 2007 for Windows 32.

Arnstein

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

Post by Ivan - Tracker Software » Fri Jul 13, 2007 1:41 pm

Just tested under Vista x64. Had register x32 pxc30com.dll and VB example works (except Native printing, while VB blocks messages/events during handling controls commands).
Can you send me simple Delphi sample for testing?
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.

DISystemer
User
Posts: 29
Joined: Fri Feb 18, 2005 2:23 pm
Location: Trondheim, Norway
Contact:

Post by DISystemer » Fri Jul 13, 2007 1:48 pm

The Delphi sample application in the SDK (exDrvAPI) has the same problem - it works under Windows 32, but not under Windows 64. It uses Windows messaging to communicate with the driver.

Please let me know if you don't have the .exe file and want me to send it to you.

Regards,
Arnstein

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

Post by Ivan - Tracker Software » Fri Jul 13, 2007 2:04 pm

Thanks, I have .exe for sure.
Into both examples (DrvActiveX.exe and exDrvAPI.exe) works almost all except "Native Printing" in DrvActiveX.exe and "obj.Print" into exDrvAPI.exe.

Will take a look now why this happens
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.

DISystemer
User
Posts: 29
Joined: Fri Feb 18, 2005 2:23 pm
Location: Trondheim, Norway
Contact:

Post by DISystemer » Mon Jul 16, 2007 6:33 am

Ok. We have more or less used the code from the "obj.Print" example in our application, so if we can make this method work then I'm convinced that our application will work as well.

Arnstein

John - Tracker Supp
Site Admin
Posts: 8201
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Post by John - Tracker Supp » Wed Aug 01, 2007 9:30 pm

Hi,

unless we hear otherwise - assume all is good here now ?
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com

DISystemer
User
Posts: 29
Joined: Fri Feb 18, 2005 2:23 pm
Location: Trondheim, Norway
Contact:

Post by DISystemer » Mon Aug 06, 2007 6:35 am

No, our problem is not solved.

Ivan said on July 8th: "Will take a look now why this happens". After that nothing has happened, so we are waiting to hear from you.

Arnstein

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

Post by Ivan - Tracker Software » Tue Aug 07, 2007 2:24 pm

I'm reproducing trouble with Delphi, and as I see trouble is inside Windows -- it doesn't send messages from x64 process into x32 process while x32 process is into message handler. I will need to install Checked/Debug version of the Windows to find why this happens and how to workarround this. And I'm afraid it can takes some time.

For now, while you have access to the printer's DC (Hanlde), you can use ExtEscape function to pass required commands to the printer -- this method works fine on both x32 and x64 OSes.
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.

Arnold Trost
User
Posts: 43
Joined: Thu Jul 22, 2004 12:43 pm
Location: Salzburg/Austria
Contact:

Post by Arnold Trost » Fri Sep 21, 2007 11:22 am

Hello,

so what's the best solution to print in a x64 environment with a 32 bit application like VB6 ? COM and Windows Messaging don't work. ExtEscape funtions is the only way ? I have also problems in x64 environments. Could you give me a VB6 example (like the SDK VBExCOM) with ExtEscape functions, events (i'm not a pure VB6 developer). I'm using the PDF-XChange COM Event OnFileSaved which should also work with x64 Windows 2003.

best regards

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

Post by Ivan - Tracker Software » Fri Sep 21, 2007 12:34 pm

For first, you need to declare ExtEscape function like this

Code: Select all

Private Declare Function ExtEscape Lib "Gdi32" (ByVal hDC As Long, _
        ByVal nEscape As Long, ByVal cbInput As Long, ByVal lpInData As String, _
        ByVal cbOutput As Long, ByVal lpOutData As Long) As Long
And now using this function:

Code: Select all

        Dim s As String
        Dim P As Printer
        Dim D As Long
        '
        For Each P In Printers
            If P.DeviceName = "PDF-XChange 3.0" Then
                ' Set printer as default for current session
                Set Printer = P
                ' Stop looking for a printer
                Exit For
            End If
        Next
        '
        'initialize printer
        D = Printer.TwipsPerPixelX
        Printer.Orientation = vbPRORPortrait
        'initialized
        D = Printer.hDC
        '
        s = "Save.FullFileName: " & fName.Text
        ExtEscape D, -5650, Len(s) + 1, s, 0, 0
        s = "Save.ShowSaveDialog: No"
        ExtEscape D, -5650, Len(s) + 1, s, 0, 0
        s = "Save.WhenExists: Overwrite"
        ExtEscape D, -5650, Len(s) + 1, s, 0, 0
        '... any other escapes required ...
        '
        Printer.FontName = "Arial"
        Printer.FontSize = 12
        Printer.CurrentX = 1000
        Printer.CurrentY = 1000
        Printer.Print "Sample printing from VB using PDF-XChange 3.0"
        Printer.Circle (3000, 3000), 1000
        Printer.NewPage
        Printer.EndDoc
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.

Arnold Trost
User
Posts: 43
Joined: Thu Jul 22, 2004 12:43 pm
Location: Salzburg/Austria
Contact:

Post by Arnold Trost » Mon Sep 24, 2007 11:10 am

Hello Ivan,

thanks for the example. But how do we realize the COM events (OnPrintingStarted, OnPageStarted, OnPageFinished, OnFileSaved, which don't work in x64 (incl. API method) ?

- Arnold

Arnold Trost
User
Posts: 43
Joined: Thu Jul 22, 2004 12:43 pm
Location: Salzburg/Austria
Contact:

Post by Arnold Trost » Tue Sep 25, 2007 8:37 am

Hello Ivan,

i did some experiments with the VBExAPI Example. Setting Printer Paramter works via API method in Windows 2003 x64. It is also possible to use the COM events (we need the OnFileSaved Event). The main disadvantage is the performance. It takes 5-10 seconds to produce the Native Printing Example page. Without COM events the page is finished immediatley. Any idea ?

- Arnold

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

Post by Ivan - Tracker Software » Tue Sep 25, 2007 8:50 am

The problem is in sending messages between pdfSaver -> COM object -> VB application.
Did you declare only OnFileSaved event handler, or others too ?
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.

Arnold Trost
User
Posts: 43
Joined: Thu Jul 22, 2004 12:43 pm
Location: Salzburg/Austria
Contact:

Post by Arnold Trost » Wed Sep 26, 2007 11:48 am

I tested several combinations. The PDF creation takes to long.

- Arnold

Post Reply