Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- OnRun(VAR Rec : Record "Purchase Header")
- IF ISCLEAR(PDFCreator) THEN
- CREATE(PDFCreator);
- IF NOT PDFCreator.cStart()THEN;
- IF ISCLEAR(PDFCreatorError) THEN
- CREATE(PDFCreatorError);
- IF ISCLEAR(PDFCreatorOption) THEN
- CREATE(PDFCreatorOption);
- ReportID := REPORT::"Stock Order";
- FileDirectory := 'C:\Temp\quickpdf\';
- FileName := "No." + '.pdf';
- Window.OPEN('processing');
- WindowisOpen := TRUE;
- IF FILE.EXISTS(FileDirectory + FileName)THEN
- FILE.ERASE(FileDirectory + FileName);
- PDFCreatorError := PDFCreator.cError;
- PDFCreatorOption := PDFCreator.cOptions;
- PDFCreatorOption.UseAutosave := 1;
- PDFCreatorOption.UseAutosaveDirectory := 1;
- PDFCreatorOption.AutosaveDirectory := FileDirectory;
- PDFCreatorOption.AutosaveFormat := 0;
- PDFCreatorOption.AutosaveFilename := FileName;
- PDFCreator.cOptions := PDFCreatorOption;
- PDFCreator.cClearCache();
- DefaultPrinter := PDFCreator.cDefaultPrinter;
- PDFCreator.cDefaultPrinter := 'PDFCreator';
- //This will pause the printer to merge other pdf files
- PDFCreator.cPrinterStop := FALSE;
- //This prints the report to PDFCreator
- REPORT.RUNMODAL(ReportID,FALSE,TRUE,Rec);
- //The Report is Created as a PDF Here
- //I want to append to PDF files here!
- PDFCreator::eReady()
- PDFCreator.cPrinterStop := TRUE;
- PDFCreator.cDefaultPrinter := DefaultPrinter;
- PDFCreator.cClose();
- IF WindowisOpen THEN
- Window.CLOSE;
- WindowisOpen := FALSE;
- PDFCreator::eError()
- //ERROR('Status: Error[' + FORMAT(PDFCreatorError.Number) + ']: ' + PDFCreatorError.Description);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement