Trouble saving to non-local resource

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
eric.glenn
Posts: 11
Joined: Tue Sep 02 2008

Trouble saving to non-local resource

Post by eric.glenn » Fri Sep 04 2015

If I specify an output file which isn't a local resource, I see the print job appear in the spooler but no output file appears.
If I specify a local drive, everything works fine.

This fails:

Code: Select all

PDFPrinter = DriverInit("Amyuni Eval Printer")
ls_output_file = "some.pdf"
ls_output_folder = "\\server01\c$\output\"
ll_doc_file_props = 3
SetDocFileProps(PDFPrinter, ls_output_file, ll_doc_file_props, ls_output_folder, ls_output_file )
EnablePrinter(pdfPrinter,LicensedTo,ActivationCode) // Send license code to activatePDF Converter
ll_PrintJob = PrintOpen( ls_output_file )
PrintDatawindow( ll_PrintJob, ads_doc)
PrintClose( ll_PrintJob )
Unlock(PDFPrinter, ls_output_file, 100)  //  unlock the printer and wait 100 milliseconds if there was an error
DriverEnd (PDFPrinter)
This fails (NET USE Z: \\server01\c$ )

Code: Select all

PDFPrinter = DriverInit("Amyuni Eval Printer")
ls_output_file = "some.pdf"
ls_output_folder = "Z:\output\"
ll_doc_file_props = 3
SetDocFileProps(PDFPrinter, ls_output_file, ll_doc_file_props, ls_output_folder, ls_output_file )
EnablePrinter(pdfPrinter,LicensedTo,ActivationCode) // Send license code to activatePDF Converter
ll_PrintJob = PrintOpen( ls_output_file )
PrintDatawindow( ll_PrintJob, ads_doc)
PrintClose( ll_PrintJob )
Unlock(PDFPrinter, ls_output_file, 100)  //  unlock the printer and wait 100 milliseconds if there was an error
DriverEnd (PDFPrinter)
This works:

Code: Select all

PDFPrinter = DriverInit("Amyuni Eval Printer")
ls_output_file = "some.pdf"
ls_output_folder = "C:\output\"
ll_doc_file_props = 3
SetDocFileProps(PDFPrinter, ls_output_file, ll_doc_file_props, ls_output_folder, ls_output_file )
EnablePrinter(pdfPrinter,LicensedTo,ActivationCode) // Send license code to activatePDF Converter
ll_PrintJob = PrintOpen( ls_output_file )
PrintDatawindow( ll_PrintJob, ads_doc)
PrintClose( ll_PrintJob )
Unlock(PDFPrinter, ls_output_file, 100)  //  unlock the printer and wait 100 milliseconds if there was an error
DriverEnd (PDFPrinter)
Is this by design?

eric.glenn
Posts: 11
Joined: Tue Sep 02 2008

Re: Trouble saving to non-local resource

Post by eric.glenn » Tue Sep 08 2015

Called sales support and the awesome guy who answered the phone helped me out.

The issue is that you need to pass the entire file and file path to SetDocFileProps.

I have revised my example.

Code: Select all

PDFPrinter = DriverInit("Amyuni Eval Printer")
ls_output_file = "some.pdf"
ls_output_folder = "Z:\output\"
ls_output_filepath = ls_output_folder + ls_output_file
ll_doc_file_props = 3
SetDocFileProps(PDFPrinter, ls_output_file, ll_doc_file_props, ls_output_folder, ls_output_filepath )
EnablePrinter(pdfPrinter,LicensedTo,ActivationCode) // Send license code to activatePDF Converter
ll_PrintJob = PrintOpen( ls_output_file )
PrintDatawindow( ll_PrintJob, ads_doc)
PrintClose( ll_PrintJob )
Unlock(PDFPrinter, ls_output_file, 100)  //  unlock the printer and wait 100 milliseconds if there was an error
DriverEnd (PDFPrinter)
Solved!

Post Reply