SetDocFileProps returns -1

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
dhoerner
Posts: 6
Joined: Tue Oct 25 2016

SetDocFileProps returns -1

Post by dhoerner »

Hi at all,

we are using SetDocFileProps to set printer-settings and we are not using any DefaultPrinter settings and no Locks (Document-Title is unique).

Calling following method always returns "-1", whatever with which parameters.

Code: Select all

auto lErr = SetDocFileProps(globalData->hDriverHandle, szAnsiTitle, uFlags, szAnsiFilePath, szAnsiFileName);
//lErr is -1
However, printing to pdf/jpege/rtf works as expected. Driver is initialized and License was set before.

So I would like to know, why -1 is returned by this function, because docu says, that the function returns 0 if succeeded.

Thanks and Best Regards
Daniel
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Re: SetDocFileProps returns -1

Post by Jose »

Hi,

The SetDocFileProps() is meant to be used in conjunction with Lock\UnLock methods.
https://www.amyuni.com/WebHelp/Amyuni_D ... s/Lock.htm

If you are not using these methods, then I suggest that you use the SetFileNameOptions and SetDefaultFileName.

Thanks
Get PDF Suite, the expert .NET developer toolkit for PDF conversion, creation and editing - www.amyuni.com/pdfsuite
dhoerner
Posts: 6
Joined: Tue Oct 25 2016

Re: SetDocFileProps returns -1

Post by dhoerner »

Jose wrote:Hi,

The SetDocFileProps() is meant to be used in conjunction with Lock\UnLock methods.
https://www.amyuni.com/WebHelp/Amyuni_D ... s/Lock.htm

If you are not using these methods, then I suggest that you use the SetFileNameOptions and SetDefaultFileName.

Thanks
But, if I use SetFileNameOptions and SetDefaultFileName, do I have to use the GLock or do I not need any Lock in this case?
Post Reply