Morley
November 4, 2005, 7:45pm
1
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'));
Morley
November 6, 2005, 12:52am
3
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.”
Harjo
November 6, 2005, 1:14pm
5
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.