How To create a PDF-document with Acrobat Distiller
Version 9 only
Other Solutions
It is possible to create PDF-documents without user-intervention. There are several solution and drivers for it, this one is with the Acrobat Distiller.
This is how it works:
1/ Let Magic print a report to a file WITH a Postscript-printer
2/ Call the Acrobat Distiller OLE to do the conversion from Postscript to PDF.
Use the following code when you work with Magic v9.4
The Task Properties will look like this:
Task Type: Batch
Initial Mode: Modify
EndTask: Yes-After
Allow Events: No
The record main will look like this:
Select Param 1 i-PostScriptPrintFilename ("A") Alpha:160
Select Param 2 i-PDF Filename ("B") Alpha:160
Select Param 3 i-Convert Delay ("C") Num:9
Select Virt 1 O-Distiller ("D") OLE, TypeLibrary:Acrobat Distiller (Ver1.0),
Object: PdfDistiller, Instantiation: Automatic
Select Virt 1 v-Dummy Convert Delay ("E") Num:9
The record suffix will look like this:
Update E Expr:20 Cnd:C=0
Call COM Object:D, Option:Call Method, Method:FileToPDF, Argm:A,B,''
Block Loop Cnd:Not(IOExist(B)) AND LoopCounter()<E
Evaluate Delay(1)
End Loop
Use the following code when you work with Magic v9.3
The Task Properties will look like this:
Task Type: Batch
Initial Mode: Modify
EndTask: Yes-After
Allow Events: No
The record main will look like this:
Select Param 1 i-PostScriptPrintFilename ("A") Alpha:160
Select Param 2 i-PDF Filename ("B") Alpha:160
Select Param 3 i-Convert Delay ("C") Num:9
Select Virt 1 O-Distiller ("D") OLE, TypeLibrary:Acrobat Distiller (Ver1.0),
Object: PdfDistiller, Instantiation: Automatic
Select Virt 1 v-Dummy Convert Delay ("E") Num:9
The record suffix will look like this:
Call UDP '@mg_ocx.objectLoad' Arg:'AAL4', '', 'PdfDistiller.PdfDistiller.1', D, E
Call UDP '@mg_ocx.MethodCall' Arg:'4AAAAA4', D, 'FileToPDF', '0AAA', A, B, '', E
Call UDP '@mg_ocx.objectRelease' Arg:'L4', D, E
Hope it will be usefull for some ...
Frank Van Herreweghe
Category
CategoryHowTo
There are no comments on this page. [Add comment]