Setting a file name

PDF-XChange Viewer SDK
Simple DLL and ActiveX

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

Post Reply
Parps
User
Posts: 70
Joined: Mon Sep 28, 2009 10:06 am

Setting a file name

Post by Parps » Mon Oct 29, 2012 4:16 pm

Hi Craig,

In my viewer the document is opened with PXCVAX.OpenDocumentFromHGlobal. In the ‘Save as’ dialog the name presented is ‘Document from Stream.pdf’.

How can I change this to a more meaningful name? So far I tried this with
PXCVAX.SetDocumentPropertySTR(PXCVA_PN_DOCFILENAME, PXCVAX5:DocID, DocumentName) but that didn’t work.

It must be simple, but I don’t see a solution.

Cheers,
Koen

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Re: Setting a file name

Post by Tracker - Clarion Support » Mon Oct 29, 2012 4:26 pm

Hi Koen!

The document starts in memory and gets read in properly. You then want to save the document to a file.

Is there a User password on this file? If so are there any permissions denied, such as Save?

Ctrl-D on the document opens the Document Properties screen and I believe you can check this there.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

Parps
User
Posts: 70
Joined: Mon Sep 28, 2009 10:06 am

Re: Setting a file name

Post by Parps » Mon Oct 29, 2012 4:57 pm

Hi Craig,

Yep the document is read properly. I can navigate through the pages etc. There is no password. For some reason ‘Save’ is denied, but ‘Save as’ is allowed.

In the document properties screen I also get the file name ‘Document from Stream.pdf’. There must be a way to change that name, but unfortunate I don’t see how.

Cheers,
Koen

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Re: Setting a file name

Post by Tracker - Clarion Support » Mon Oct 29, 2012 9:56 pm

Hi Koen!

I'll have to check this out. It should be possible to save the document to any name you wish.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

Parps
User
Posts: 70
Joined: Mon Sep 28, 2009 10:06 am

Re: Setting a file name

Post by Parps » Tue Nov 20, 2012 1:11 pm

Hi Craig,

Any change you found time to figure this out? It is not a very high priority issue for us, but it would be nice to have.

Bye,
Koen

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Re: Setting a file name

Post by Tracker - Clarion Support » Tue Nov 20, 2012 1:35 pm

Hi Koen!

I'll check that out today for certain.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Re: Setting a file name

Post by Tracker - Clarion Support » Tue Nov 20, 2012 8:30 pm

Hi Koen!

Did you try using the SaveDocumentAs method? It takes a target PDF filename as one of its parameters.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

Parps
User
Posts: 70
Joined: Mon Sep 28, 2009 10:06 am

Re: Setting a file name

Post by Parps » Sat Nov 24, 2012 5:22 pm

True, if I try it with a Clarion button the method is working. But when user is printing the document and the chooses a PDF-printer the name is ‘Document from Stream.pdf’. OK it makes not really sense to use a PDF-printer when a save button is also available, but some users do.

Best regards,
Koen

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Re: Setting a file name

Post by Tracker - Clarion Support » Mon Nov 26, 2012 2:39 pm

Hi Koen!

If I understand you, your users sometimes open a PDF in the PDF-Viewer ActiveX, but then Print that PDF by selecting a PDF Printer, like our PDF-XChange product.

First issue is that the resulting PDF may not be be able to be searched for words or phrases because some PDF printers generate a page image and then send that to the output PDF file. I don't think our PDF-XChange Printer Driver does that, however.

I'm not sure that we can detect whether any given printer is a paper printer or a printer driver like our PDF-XChange Driver.

Setting the output PDF name may be problematic depending on which Print-to-PDF tool you're using.

I'll take a look but I think you might want to disable the PDF-Viewer's Print command.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

Parps
User
Posts: 70
Joined: Mon Sep 28, 2009 10:06 am

Re: Setting a file name

Post by Parps » Mon Nov 26, 2012 4:53 pm

Hi Craig,

That is correctly understood. The same problem happens when using the ‘Save as’ dialog, the name is presented as ‘Document from Stream.pdf’. I tried earlier to change that name by using PXCVAX.SetDocumentPropertySTR(PXCVA_PN_DOCFILENAME, PXCVAX5:DocID, DocumentName) but that did work.

As a workaround I already have disabled both buttons from the ActiveX control and use Clarion buttons instead. That works fine besides the minor issue when selecting a PDF-printer.

I am just curious if it is possible to change the document name property somehow when it is opened with PXCVAX.OpenDocumentFromHGlobal. However it is a low priority issue, so don’t bother if you have an answer right now.

Cheers,
Koen

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Re: Setting a file name

Post by Tracker - Clarion Support » Mon Nov 26, 2012 11:21 pm

Hi Koen!

I need to look into this further. The big problem with it is that you really don't know which printer is being selected, nor how to set the file name if it's a print-to-file driver that's being selected.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

Parps
User
Posts: 70
Joined: Mon Sep 28, 2009 10:06 am

Re: Setting a file name

Post by Parps » Thu Nov 29, 2012 12:21 pm

Hi Crag,
Tracker - Clarion Support wrote:The big problem with it is that you really don't know which printer is being selected, nor how to set the file name if it's a print-to-file driver that's being selected.
Are your sure that is the problem? The same issue happens when using the 'Save as' button of the ActiveX control. So my first guess is it has something to do with the properties of the document in the viewer. But of course I can be wrong.

Cheers,
Koen

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Re: Setting a file name

Post by Tracker - Clarion Support » Thu Nov 29, 2012 12:30 pm

Hi Koen!

The file names for both operations are stored in different ActiveX Properties.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

Parps
User
Posts: 70
Joined: Mon Sep 28, 2009 10:06 am

Re: Setting a file name

Post by Parps » Thu Nov 29, 2012 10:21 pm

Hi Craig,

Ahh, that is my misunderstanding. I can imagine that is will be hard to figure out which printer is selected. What is the property when using the ‘Save as’ button f the ActiveX control? I tried to set a property after opening the document, but so far I couldn’t get that to work either.

However again, it is a low priority issue for me, so if it is hard to solve, don't bother.

Cheers,
Koen

Tracker - Clarion Support
Site Admin
Posts: 1412
Joined: Wed Jun 30, 2004 4:45 pm
Location: Maryland, USA
Contact:

Re: Setting a file name

Post by Tracker - Clarion Support » Fri Nov 30, 2012 12:11 am

Hi Koen!

I'll see what I can do. I have to dig the values out of the generic documentation (if it's there).

It doesn't help that the 2.x ActiveX Viewer does not export ALL the capabilities that are available in the EU version.
Craig Ransom
Tracker Software - Clarion Support
http://www.tracker-software.com

Post Reply