Create tagged PDF file

As MadeToTag Automate has no UI, it adds objects and methods to the InDesign Server Scripting API. A sample script for exporting is attached to this article.

Sending a script to and running it in InDesign Server

The method for sending the sample scripts to MadeToTag Automate have been described in the Registration and Activation Section Sending a script to and running it in InDesign Server.

Exporting an InDesign Document

To export an InDesign document, you need to run the exportDocument method.

app.theMadeToTagObject.exportDocument( targetDocumentObject , "</path/to/export.pdf>", "<PresetArguments>");

first parameter: targetDocumentObject

As first parameter, you need to pass an InDesign document object, e.g. app.documents.firstItem();

There is no "activeDocument" in InDesign Server. You need to open the document and keep the document reference by yourself, or access the document by methods like app.documents.firstItem()

second parameter: path to export file

As second parameter, you need to pass a path to where the document should be exported to.

When using the InDesign File class, be sure to use fsName (file system name) to ensure proper encoding.

third parameter: preset arguments (optional)

As third parameter, you can pass a Json-String with export parameters. They reflect the settings and options you can define in MadeToTag Desktop Task 7: Create tagged PDF file. If you don't provide the third argument or provide an empty {} json string, MadeToTag Automate will use the default values. Possible values and their defaults are shown in the MadeToTagExport.jsx above.

Exporting an InDesign Book

To export an InDesign document, you need to run the exportBook method.

app.theMadeToTagObject.exportBook( targetBookObject , "</path/to/export.pdf>", "<PresetArguments>");

first parameter: targetBookObject

As first parameter, you need to pass an InDesign book object, e.g. app.books.firstItem();.

second and third parameter

For a description of the second and third argument, see the Exporting an InDesign Document section above.

Return codes

The MadeToTag Automate Scripting object (app.theMadeToTagObject) has a couple of predefined return codes.

Return codeReturn code nameDescription
0oksuccessful operation
1err_Failure 
2err_Cancel 
3    err_NotImplementedmethod is not yet implemented
10err_DocNotFound 
11err_CannotOpenDocument 
100err_InvalidExportKey 
1000err_InvalidMethodArg 
1001err_InvalidArgCount 
1002err_InvalidArgType 
1003err_InvalidArgValue 
1004err_InvalidMethodTarget 
1005err_ArgIsNotDefined 
1006err_ArgParseError 
1007err_FailedToLoadLibraryloadLibs: cannot load the additional libraries
1008err_InvalidLicensecurrent license does not cover running this method
1009err_InvalidEnterpriseLicenseoverwrite key was provided, but is not valid
1010err_DateOutOfRangeoverwrite key was provided, but is not valid anymore
1011err_UnknownMethodthis method is unknown

0 Kommentare

Kommentar hinzufügen

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.