PDF Output error

I’m attempting to output the current record to a PDF document. The PDF_Output plug-in is installed.

The following code prints the record to paper and then sends me a message of “Failure”.

var vSuccess = forms.corLetter.controller.print(true,false,plugins.pdf_output.getPDFPrinter('c:\temp\out.pdf'));
if (vSuccess)
{
	plugins.dialogs.showInfoDialog( 'Info',  'Success');
}
else
{
	plugins.dialogs.showInfoDialog( 'Info',  'Failure');
}

If I set the second argument to true, I’m presented with a printer Select Dialogue instead of a file dialogue.

If I perform the same steps from the corLetter form (i.e., directly) the record doesn’t print. I just get the “Failure” message.

There should be NO return code for controller.print, the return code is void…

try with :

controller.print(true,false,plugins.pdf_output.getPDFPrinter('c:/temp/out.pdf'));

or with:

controller.print(true,false,plugins.pdf_output.getPDFPrinter('c:\\temp\\out.pdf'));

automazione:
There should be NO return code for controller.print, the return code is void…

try with :

controller.print(true,false,plugins.pdf_output.getPDFPrinter('c:/temp/out.pdf'));

or with:

controller.print(true,false,plugins.pdf_output.getPDFPrinter('c:\\temp\\out.pdf'));

Hi Enrico

Both of the above options merely print the page. No PDF output. The return wasn’t it, nor the location of the PDFPrinter. One possible clue is a second “true” argument presents the Printer Selection Option rather than a file dialogue for naming and placing the PDF, a more logical option for PDF.

Something fundamental is missing, but I have no idea what it could be.

Hi Morley,sorry but here: “Both of the above options merely outputs the PDF page to c:/temp/out.pdf.”

maybe you don’t have c: drive? or the temp directory does not excist?

Hi Morley,

are you by nay chance on a Mac? There will be no c: drive. Take a look at:

http://forum.servoy.com/viewtopic.php?t=5147

this code works.