Export to Image using OLEAutomation

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

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

Post Reply
andymk
User
Posts: 6
Joined: Fri Sep 18, 2015 9:19 am

Export to Image using OLEAutomation

Post by andymk »

Hi,
I have a PdfXChange Viewer running within a Eclipse-Plugin and I am trying to use OleAutomation now to "Export to Image" programmatically. I was guessing that using ExportDocument should work. So what I tried was:

getAutomation().invoke(getId("ExportDocument"), new Variant[]{new Variant(0), new Variant(0)});

The method "getId" returns 8 and the function is - apparently - called, but all I get back is

OLE Automation Error Exception code = -2112673933

Am I just missing a few properties that I should set or is "ExportDocument" the wrong way to do it in my case?

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

Re: Export to Image using OLEAutomation

Post by Tracker Supp-Stefan »

Hi Andy,

I will ask a colleague from the dev team to take a look at this and give you some advise!

Regards,
Stefan
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: Export to Image using OLEAutomation

Post by John - Tracker Supp »

Can you also please conform that you have a license for the PDF-XChange Viewer SDK - rather than the end user version ?
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
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3549
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: Export to Image using OLEAutomation

Post by Ivan - Tracker Software »

That error code means "No document opened".
Can you please make sure you have open PDF document before exporting it ?
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.
andymk
User
Posts: 6
Joined: Fri Sep 18, 2015 9:19 am

Re: Export to Image using OLEAutomation

Post by andymk »

Hello,
and thank you for your quick reply. As it turns out the example I posted does not fit with the error message I posted. Sorry, my debugger must have played a trick on me on Friday.

When I execute the call

getAutomation().invoke(getId("ExportDocument"), new Variant[]{new Variant(0), new Variant(0)});

I get the "Export to Image" dialog. The question now is: What do I have to do to trigger a TIFF-Export without the dialog popping up (i.e. without any user interaction)? Are there any properties I have to set?

Also, I don't really care how I can trigger an automatic export to image. Javascript or command line call would be fine as well, but I want to use the Pdf-XChange rendering engine, because of the high quality of the resulting images.

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

Re: Export to Image using OLEAutomation

Post by Tracker Supp-Stefan »

Hi Andy,

If you do not want any UI - then I would recommend you to take a look at either the Viewer Simple DLL SDK:
https://www.pdf-xchange.com/produc ... le-dll-sdk
As the Viewer AX will not export to images without UI,

Or take a look at our new SDK Products - the Editor SDK
https://www.pdf-xchange.com/produc ... editor-sdk

And the Core API SDK:
https://www.pdf-xchange.com/produc ... re-api-sdk

The Core API is a subset of the Editor SDK (lacking the UI part) - but it will allow you to generate the needed images without any UI. The Editor SDK gives you access to our most comprehensive SDK product so far, and we will continue to add new features to it from here on and not to the Viewer SDK products.

Regards,
Stefan
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: Export to Image using OLEAutomation

Post by John - Tracker Supp »

Also Andy - I note you have not answered the question whether or not you own one of our SDK's and therefore assume you do not - attempting to directly utilise our products API as opposed to using the app as intended via the UI is a breach of the license terms and you should be aware of this.
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
andymk
User
Posts: 6
Joined: Fri Sep 18, 2015 9:19 am

Re: Export to Image using OLEAutomation

Post by andymk »

Hi John,
to clarify: we purchased the PdfXChange Viewer SDK (25.000 CDLPs). Usually we just display PDF documents within an Eclipse RCP Client. We have a solution in place to convert PDFs to TIFF using PDFBox, but we are having some trouble with some special PDFs, which we then have to convert manually. I realised that Pdf-XChange can convert them without any problems, which is why I thought I could try and use PdfXChange instead of PdfBox. Would that be overstepping the licence? So far, it does not work for me anyway.

Regards,
Andy
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: Export to Image using OLEAutomation

Post by John - Tracker Supp »

Hi Andy,

No that would not be a problem - provided always that you don't exceed your CDLP limit of 25k installations.

cheers

John
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
andymk
User
Posts: 6
Joined: Fri Sep 18, 2015 9:19 am

Re: Export to Image using OLEAutomation

Post by andymk »

Hi John,
we are one order of magnitude below the licence limit.

Did I understand you correctly that it would require to purchase another SDK in order to be able to do the TIFF-conversion programmatically?

Regards,
Andreas
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom
Contact:

Re: Export to Image using OLEAutomation

Post by John - Tracker Supp »

Hi Andy,

I am not sure what you mean by 'one order of magnitude' .... so cannot really answer the question - might be best if you email support@pdf-xchange.com and ask the question in more detail ..

cheers
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
andymk
User
Posts: 6
Joined: Fri Sep 18, 2015 9:19 am

Re: Export to Image using OLEAutomation

Post by andymk »

Hi John,
I meant that we use less than 2500 of our 25000 CDLPs.

Also, I would like to share some code that does what I need:

iPDFXChange.setProperty("Export.Image.Type", "TIFF");
iPDFXChange.setProperty("Export.Image.FileName", "MyFile_<Auto Number>");
iPDFXChange.setProperty("Export.Image.Mode", "EachToOneImage");
getAutomation().invoke(getId("ExportDocument"), new Variant[]{new Variant(0), new Variant(2)});

It would also be useful for me to set the color mode (e.g. Black & White), but I could not find the property for this so far. Can you give me a hint? I may also be able to do this via a settings-import, but the property would be better.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Export to Image using OLEAutomation

Post by Vasyl-Tracker Dev Team »

Hi andymk.
It would also be useful for me to set the color mode (e.g. Black & White), but I could not find the property for this so far. Can you give me a hint? I may also be able to do this via a settings-import, but the property would be better.
Unfortunately, but currently is no way to set B/W color programmatically. Its possible only by new Editor SDK.

Best
Regards.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Export to Image using OLEAutomation

Post by Vasyl-Tracker Dev Team »

I get the "Export to Image" dialog. The question now is: What do I have to do to trigger a TIFF-Export without the dialog popping up (i.e. without any user interaction)? Are there any properties I have to set?
Its possible to suppress dialog. As I see you already found solution:
getAutomation().invoke(getId("ExportDocument"), new Variant[]{new Variant(0), new Variant(2)});
// "new Variant(2)" == "new Variant(PXCVA_NoUI)"
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Post Reply