The AODocs PDF Generator:
- Copies and converts to PDF format all the attached files in a document.
- Merges them into a single PDF file.
- Makes the PDF available in one of the following ways:
- Print to AODocs: attaches the PDF file to the current document
- Print to Drive: opens the PDF in a new tab in your browser – the file is located in your My Drive
- Print to Google Cloud Storage: opens the PDF in a new tab in your browser in an AODocs – the file is located in a temporary Google Cloud Storage bucket managed by AODocs
The article Generate a PDF from the attached files in an AODocs document explains how to run the basic version of the AODocs PDF Generator.
The AODocs PDF Generator has many advanced features. If your library administrator has set up advanced features in your library, you can follow the instructions below.
Note: This article describes the full options for each advanced feature. Your library administrator may not have fully configured some advanced features in your library. For example, you may be able to define a header but not have the options to define its font family, size, colour, and so on. In this case, the default values are applied.
Automatically generated table of contents
Select which attached files to merge
By default, the AODocs PDF Generator converts and merges all the attached files in the latest version of the current AODocs document.
If your library administrator has set up this advance feature, there's a property in the configured document class where you can define which attached files you want to include in the PDF.
You can select attached files:
- in the current document
- in another version of the current document
- in a different document in the same library
- in a document in a different library
Important: If you select attached files in a document in a different library, the library must be on your domain and it must use the same storage platform. Learn more: Where is my content stored?
1. Enter the IDs of the required attached files in the order in which they want them to appear in the PDF.
- For files stored in Google Drive, use the the Drive ID of the file, for example:
1AGB3KEBfRGGQqOmQisGqoOS0NGlRC7oyxv4P7yW7-C0
- For files stored in Google Cloud Storage or Azure Blob storage, you can use either:
- the URL of the document, for example:
https://storage.aodocs.com/storage/<domain>/<library Id>/<class Id>/<document Id>/<object Id>
- the object ID of the document, for example:
Trnxgb24KSfxL3tMUN
- the URL of the document, for example:
Important: If you use only the object ID, the attached file must be in the document from which you generate the PDF.
Apply a header to the PDF
If your library administrator has set up this advance feature, there's a property in the configured document class where you can define the text to use as a header.
1. Define what you want to include as a header. You can enter:
- text
- a block of HTML code – in this case you must define the text for the header; if your library administrator has activated style attributes, you can also define any required style attributes with your block of HTML code
- a placeholder
Note: If you are using the ADVANCED renderer, you can't use HTML code to define the header.
In our example, we entered the text For internal use only in the property "Header text".
2. If configured, you can define the font family with one of the following values, depending on the type of renderer defined:
- LEGACY renderer: HELVETICA (default), COURIER, SYMBOL, ZAPFDINGBATS,
- STANDARD renderer: HELVETICA (default), COURIER, TIMES_ROMAN
- ADVANCED renderer: ARIAL (default), ARIAL_BLACK, ANDALE_MONO, COMISANS, GEORGIA, IMPACT, TREBUCHET, VERDANA, WEBDINGS
In our example, we are using a LEGACY renderer and we left the "Header font family" property empty, so the default HELVETICA font is applied.
3. If configured, you can define the font style with one of the following values: NORMAL (default), BOLD, ITALIC, OBLIQUE, UNDERLINE, LINETHROUGH.
In our example, we entered BOLD in the property "Header font style".
4. If configured, you can define the font size with any value greater than 0. The default value is 32.
In our example, we entered 18 in the property "Header font size".
5. If configured, you can define the font color with any RGB value. The default value is 0,0,0,50.
In our example, we entered 245,19,19,100 in the property "Header font color".
Note: You must enter four values separated by commas. The first three values define the RGB color, the fourth value defines the opacity.
6. If configured, you can define the text alignment with any one of the following values: CENTER (default), LEFT, RIGHT.
In our example, we entered CENTER in the property "Header font color".
Below is an example of a header.
Apply a footer to the PDF
If your library administrator has set up this advance feature, there's a property in the configured document class where you can define the text to use as a footer.
1. Define what you want to include as a footer. You can enter:
- text
- a block of HTML code – in this case you must define the text for the header; if your library administrator has activated style attributes, you can also define any required style attributes with your block of HTML code
- a placeholder
Note: If you are using the ADVANCED renderer, you can't use HTML code to define the header.
In our example, we entered Created on ${creationDate} by ${initialAuthor} in the property "Header text".
2. If configured, you can define the font family with one of the following values, depending on the type of renderer defined:
- LEGACY renderer: HELVETICA (default), COURIER, SYMBOL, ZAPFDINGBATS,
- STANDARD renderer: HELVETICA (default), COURIER, TIMES_ROMAN
- ADVANCED renderer: ARIAL (default), ARIAL_BLACK, ANDALE_MONO, COMISANS, GEORGIA, IMPACT, TREBUCHET, VERDANA, WEBDINGS
In our example, we are using a LEGACY renderer and we entered COURIER in the property "Footer font family".
3. If configured, you can define the font style with one of the following values: NORMAL (default), BOLD, ITALIC, OBLIQUE, UNDERLINE, LINETHROUGH.
In our example, we entered ITALIC in the property "Footer font style".
4. If configured, you can define the font size with any value greater than 0. The default value is 32.
In our example, we entered 14 in the property "Footer font size".
5. If configured, you can define the font color with any RGB value. The default value is 0,0,0,50.
In our example, we entered 51,51,255,100 in the property "Footer font color".
Note: You must enter four values separated by commas. The first three values define the RGB color, the fourth value defines the opacity.
6. If configured, you can define the text alignment with any one of the following values: CENTER (default), LEFT, RIGHT.
In our example, we entered RIGHT in the property "Footer alignment".
Below is an example of a footer.
Define the page to start the header and footer
If your library administrator has set up this advance feature, there's a property in the configured document class where you can define the page number at which the header and footer start.
Note: This advanced configuration works in custom scripts containing both a header and a footer, a header only, or a footer only.
Apply a watermark to the PDF
If your library administrator has set up this advance feature, there's a property in the configured document class where you can define the text to use as a watermark.
1. Define what you want to include as a watermark. You can enter:
- text
- a placeholder
In our example, we entered Confidential in the property "Watermark text".
2. If configured, you can define the font family with one of the following values, depending on the type of renderer defined:
- LEGACY renderer: HELVETICA (default), COURIER, SYMBOL, ZAPFDINGBATS,
- STANDARD renderer: HELVETICA (default), COURIER, TIMES_ROMAN
- ADVANCED renderer: ARIAL (default), ARIAL_BLACK, ANDALE_MONO, COMISANS, GEORGIA, IMPACT, TREBUCHET, VERDANA, WEBDINGS
In our example, we are using a LEGACY renderer and we left the "Header font family" property empty, so the default HELVETICA font is applied.
3. If configured, you can define the font style with one of the following values: NORMAL (default), BOLD, ITALIC, OBLIQUE, UNDERLINE, LINETHROUGH.
In our example, we entered UNDERLINE in the property "Watermark font style".
4. If configured, you can define the font size with any value greater than 0. The default value is 100.
In our example, we entered 120 in the property "Watermark font size".
5. If configured, you can define the font color with any RGB value. The default value is 0,0,0,50.
In our example, we entered 51,51,255,100 in the property "Watermark font color".
Note: You must enter four values separated by commas with no spaces. The first three values define the RGB color, the fourth value defines the opacity.
6. If configured, you can define the rotation angle with any value greater than 0. The default value is 60.
In our example, we left the "Watermark rotation" property empty, so the default value 60 is applied.
7. If configured, you can define how many times the watermark text is applied, with any value greater than 0. The default value is 1.
In our example, we left the "Watermark repeat" property empty, so the default value 1 is applied.
Example of a watermark:
Add a cover to the PDF
If your library administrator has set up this advance feature, there's a property in the configured document class where you can define the text to use on your cover page.
1. Define the text you want to include on your cover page. It can be:
- text
- HTML
- AODocs templating language
In our example, we entered the following AODocs templating language in the property "Cover text".
<div> <p style="text-align: center; font-weight: 700;"><i>Patient:</i> <span style="color: royalblue; font-family: 'Segoe UI';font-size: 18px;">${documentTitle}</span> </p> <p style="text-align: center; font-weight: 700;"><i>Last updated:</i> <span style="color: royalblue;font-family: 'Segoe UI'; font-size: 18px;">${lastModified}</span> </p> </div>
Example of a cover page:
Define which renderer to use
If your library administrator has set up this advance feature, there's a property in the configured document class where you can define which PDF renderer to use.
Each renderer offers a different list of font families for the header, footer and watermark.
You can define one of the following renderers:
- LEGACY: offers HELVETICA (default), COURIER, SYMBOL, ZAPFDINGBATS,
- STANDARD: offers HELVETICA (default), COURIER, TIMES_ROMAN
- ADVANCED: offers ARIAL (default), ARIAL_BLACK, ANDALE_MONO, COMISANS, GEORGIA, IMPACT, TREBUCHET, VERDANA, WEBDINGS
Note:
– If your library uses Google Drive, the default renderer is LEGACY.
– If your library uses Google Cloud Storage or Microsoft Azure Blob storage, the default renderer is ADVANCED.
– The ADVANCED renderer is faster than the others and handles more font families. However, if you use the ADVANCED renderer, you can't use HTML code for the header, footer or cover page.
Define which converter to use
If your library administrator has set up this advance feature, there's a property in the configured document class where you can define which PDF converter to use.
You can define one of the following converters:
- DRIVE: default option for libraries using Google Drive
- ADVANCED: default and mandatory option for libraries using Google Cloud Storage or Microsoft Azure blob storage
Note: Libraries using Google Drive can use either converter. However, there's no advantage to using one or other converter so there's usually no reason to change the default.
Split the PDF file at a given page
If your library administrator has set up this advance feature, there are the following properties in the configured document class:
- Integer property: to define the page at which the PDF splits
- String property: to define whether to keep the pages before or after the split page – enter
FIRST
orLAST
.
Note:
– This feature works only with documents that have only one attached file. If you have more than one attached file, running this feature results in an error and no PDF is generated.
– You can't use this feature if you're using the header, footer or watermark features.
In our example, the properties are called "Split at page" and "Split position". We split the PDF at page 2 and filled in LAST in the "Split position" property, so kept the pages after the split page.
Source document
Generated PDF
Apply specific permissions to the PDF
If your library administrator has set up this advance feature, there is a property in the configured document class where you can define which permissions to apply to your PDF.
Notes:
– If there is a password to open the PDF, no permissions are applied.
– If there isn't a password to open the PDF, by default all permissions are applied – you can change this by selecting specific permissions to apply.
1. Check that no password is required to open the PDF.
2. Define the permissions you want to apply:
Permission | Users can... |
ALLOW_ASSEMBLY |
concatenate the generated PDF with other PDFs |
ALLOW_COPY |
copy and extract text and images from the PDF |
ALLOW_DEGRADED_PRINTING |
print the PDF with the low-quality setting |
ALLOW_FILL_IN |
add form fields to the PDF |
ALLOW_MODIFY_ANNOTATIONS |
add annotations to the PDF |
ALLOW_MODIFY_CONTENT |
modify the content of the PDF |
ALLOW_PRINTING |
print the document |
ALLOW_SCREENREADERS |
read the PDF with screen readers |
In our example, we defined the following permissions:
ALLOW_COPY
ALLOW_MODIFY_ANNOTATIONS
ALLOW_PRINTING
The screenshot below shows these permissions in the generated PDF.
Apply a password to open the PDF
If your library administrator has set up this advance feature, there's a property in the configured document class where you can define the password to open the PDF.
Below is an example of a PDF with a password.
Use asynchronous conversion for large files
If your library administrator has set up this advance feature, there's a boolean property in the configured document class. If you activate this property, your PDF conversion will run asynchronously.
You may want to run the PDF conversion asynchronously in the following case:
- the PDF you plan to generate is very big
and - your custom script contains actions you don't want to be blocked while the PDF conversion takes place
Note: This advanced configuration isn't the same as running the custom script asynchronously. If you use this configuration, only the PDF conversion runs asynchronously. The custom script continues to run all its other actions while the PDF conversion takes place.
Generate a title for the generated PDF
If your library administrator has set up this advance feature, there's a property in the configured document class where you can define the new title for the generated PDF.
Below is an example of a user-defined title for the generated PDF.
Define which document version to use
If your library administrator has set up this advance feature, there's a property that lets you define which version of your document to use to generate your PDF.
The property can take the following values:
-
HEAD
(default): the most recent version that exists
Note: If your document has been checked out, the most recent version is the draft version.
-
COMMITTED
: the last version that was published
Note: If your document has been checked out, the last version that was published is the main version.
- A previous version ID: learn how to identify the version ID
Attach the PDF to a different document
If your library administrator has set up this advance feature, there's a property in the configured document class where you can define the destination document ID.
Important:
– This advanced configuration is for Print to AODocs only. Learn more: Generate a PDF from the attached files in an AODocs document.
– The destination document must be on your domain.
Enter the ID of the document in which you want the PDF to be added. Learn how to find the document ID.
When you run the custom script, the PDF is added to the destination document.
Define the duration of the link for Print to Google Cloud Storage
When you generate a PDF using the Print to Google Cloud Storage, the PDF is located in a temporary Google Cloud Storage bucket managed by AODocs and is available for 10 seconds by default.
If your library administrator has set up this advance feature, there is a property that lets you change the default and define how long you want the PDF to remain available before the link expires.
Important: This advanced configuration is for Print to Google Cloud Storage only. Learn more: Generate a PDF from the attached files in an AODocs document.
In the example below, the generated PDF will display for 30 seconds in a new tab.
After 30 seconds an error message appears.