Visual Studio 2010 vs command line conversion

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, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Post Reply
ase technologies
User
Posts: 22
Joined: Wed Mar 21, 2012 10:55 pm

Visual Studio 2010 vs command line conversion

Post by ase technologies »

I'm consistently running a word to PDF/A conversion (walking through the debugger) in Visual Studio 2010 with the attached code and test file. My output looks good and has the correct text watermark.

I run into an issue, however, when I run the application from a command line. I'm calling the same project executable file from my project\bin directory with the same license file that visual studio references. Using the same input (file name) and output (output directory) parameters the Tracker API produces the attached pdf with a demo watermark, and does not use the watermark, and conversion options that are set in my code.

I have attached my project files, test word doc, and the output that is generated when calling the code from a command line.

Thank you for your support.
ASE tech
Attachments
ConversionFiles.rar
(55 KiB) Downloaded 236 times
Walter-Tracker Supp
User
Posts: 381
Joined: Mon Jun 13, 2011 5:10 pm

Re: Visual Studio 2010 vs command line conversion

Post by Walter-Tracker Supp »

I am assuming that you have correctly placed your license key and developer code in the source file, here:

PDFPrinter = (PXCComLib.CPXCPrinter)prnFactory.get_Printer("", "Simple PDF-XChange", "<REG KEY>" "<DEV CODE>"// "<YOUR REG KEY>", "<YOUR DEV CODE>")))

(Please do not post it to this forum).

If not, you should check to ensure that you have, and that the code and key are correct.

I will look into the other issues you have reported and get back to you shortly.
Walter-Tracker Supp
User
Posts: 381
Joined: Mon Jun 13, 2011 5:10 pm

Re: Visual Studio 2010 vs command line conversion

Post by Walter-Tracker Supp »

You may wish to try setting the flags to 14 (binary: 1110) instead of 15. Bit 1 sets the watermark to be on the background of the page. In this case I think it should be visible there, but I'm not 100% certain.
Walter-Tracker Supp
User
Posts: 381
Joined: Mon Jun 13, 2011 5:10 pm

Re: Visual Studio 2010 vs command line conversion

Post by Walter-Tracker Supp »

Also, what is this PDF class:

using PDF = Aspose.Pdf.Kit;

Does this tie in with the (Tracker) developer's license for the driver API somehow?
ase technologies
User
Posts: 22
Joined: Wed Mar 21, 2012 10:55 pm

Re: Visual Studio 2010 vs command line conversion

Post by ase technologies »

Walter,
Yes, as I specified in my posting I am able to get correct output when I debug through Visual Studio 2010. I removed my license key when I posted the attachment to your forum. The key is setup correctly, and produces valid output through Visual Studio, but when I run the same executable from my debug\bin directory with the same parameters I am not getting the same output. It seems as if the Tracker API does not recognize my license and it does not apply my any of my PDFPrinter options.

The Aspose class is used to extract OLE objects from the word document and does not tie in with the Tracker license.

As to your posting about the flag setting, within Visual Studio we have produced numerous correctly formed output PDF's with the current setting (15), but I will test with it set to 14.
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Visual Studio 2010 vs command line conversion

Post by Ivan - Tracker Software »

I'm afraid the problem is because printer object is released before printed document is spooled.
There are two solution:
a) add some delay after printJob.Start();
not the best solution as you never know how much time it is ok to wait;

b) handle event OnDocumentSpooled or OnFileSaved from the printer.
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.
ase technologies
User
Posts: 22
Joined: Wed Mar 21, 2012 10:55 pm

Re: Visual Studio 2010 vs command line conversion

Post by ase technologies »

Ivan,
Thank you for your response. What is involved in handling the OnDocumentSpooled and OnFileSaved events? Does it make a difference which one I use?
Walter-Tracker Supp
User
Posts: 381
Joined: Mon Jun 13, 2011 5:10 pm

Re: Visual Studio 2010 vs command line conversion

Post by Walter-Tracker Supp »

OnDocSpooled is triggered once the document has been sent to the print driver (but possibly before it has been saved as a PDF) - e.g. before the user is requested to input a filename for an interactive job. OnFileSaved is not triggered until the file has been completely written to disk. In either case I believe your application can exit and the print driver can still finish saving the file.

-Walter
Post Reply