Datalynx PDF view

From MoodleDocs
Revision as of 16:05, 19 May 2022 by Tim Bahula 2 (talk | contribs) (→‎TOC Page: clean up, typos fixed: occurence → occurrence)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Settings for a PDF view, that are only applicable for this specific view type.

Tags only available in PDF view

  • ##export## Export the current page
  • ##export:all## Export all entries
  • ##pagebreak## Has to be placed in the settings "View template" or "Entry template". It will create a page break in the generated PDF at its position

The export tags should only be used for administration, or similar purposes. To give access to the PDF, use the technique described in the next chapter (PDF settings)

PDF settings

The settings described below are used with the tag ##export:all## or ##export:page##. Usually users should not directly access this view, but only download the PDF. To generate a download link from within an entry, this would be the pattern to use:

#{{viewlink:NameOfThePDFView;Text of the link to display;pdfexportentry=##entryid##|dest=D|docname=PDFName##author:firstname##-##author:lastname##;}}#

The above link will generate a download link with the entry id of the current entry, and the name of the author of the entry included in the filename of the PDF.

Document name

Name of the document. You should also be able to user placeholders like ##author:firstname## for the name.

Orientation

Choose landscape or portrait

Unit

  • millimeter
  • point
  • centimeter
  • inch

Format

  • Letter
  • A4

Destination

  • Send to browser
  • Download

PDF TOC (Table of Content)

Automatically generate a table of content based on the entries.

TOC Page

Page number (e.g. 1). The page where the TOC should be displayed. By default (page number empty or 0) the TOC is not displayed.

Page bookmarks can be added in the repeatd entry section with tags in the format: #@bookmark-type:bookmark-level:bookmark-text@#

Bookmark type: PDF-GBM for group bookmark, PDF-BM for regular bookmark. Group bookmarks display only the first occurrence in a sequence of the same bookmark-text. Bookmark-level: 0 - n. If the html TOC template is used, it must contain a template definition for each bookmark level that is specified in the content. Bookmark-text: The text that will be displayed for the bookmark in the TOC. Field tags can be used to extract the text from the entry content.

Example: #@PDF-GBM:0:##author:name##@# #@PDF-BM:1:[[Date masked]]@#

TOC Name

Name for the table of content

TOC Title

Html for the TOC title that is displayed above the table of content. For example, <h1>TABLE OF CONTENT</h1> will display the TOC page with the title 'TABLE OF CONTENT' styled as heading1.

TOC Template

The TOC Template specifies the html for displaying the bookmarks in the table of content. The #TOC_DESCRIPTION# and #TOC_PAGE_NUMBER# must be enclosed in span tags.

For example:

<div><span style="color:#FF0000;">#TOC_DESCRIPTION#</span> ... <span>#TOC_PAGE_NUMBER#</span></div>

<div><span style="color:#00FF00;">#TOC_DESCRIPTION#</span> ... <span>#TOC_PAGE_NUMBER#</span></div>

By this simple template the pdf file will display the TOC with the first bookmark level in red and the second in green. Page numbers will be displayed separated from the bookmark descriptions by ellipsis.

PDF Frame

A background image for the first page can be added here.

PDF Watermark

This inserts image into the first page of the PDF. Currently it is only possible to have a watermark on the first page. Further you can define the transparency of the image.

PDF Header

A header to be displayed on every page of the generated PDF.

PDF Footer

A footer to display on every page.

PDF Margins and paging

Margins and paging for every page of the PDF.

PDF Protection

You can set what users can do with the generated PDF.

Permissions denied

Activate the checkboxes for each option in order to prevent the users from:

  • Print the document
  • Modify content
  • Copy/extract content
  • Fill in forms
  • Extract content
  • Assemble
  • Print high level

User password

Set a password, that is needed in order to view the PDF.

Owner password

Set a password in order to override prevented actions set in the setting "Permission denied"

Digital Signature

You can sign a PDF with a self signed certificate in order to prevent forgery and falsification of certificates.

Certificate

Provide the self signed certificate here. The certificate should be provided as .crt file. To generate a self signed certificate follow these 3 steps (linux command line):

  • To create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt
  • To export crt to p12: openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12
  • To convert pfx certificate to pem: openssl pkcs12 -in tcpdf.pfx -out tcpdf.crt -nodes

Also note, that you must have installed OpenSSL extension in PHP.

Password

The password you used to create the certificate.

Permissions

Select the permission the users should have for handling the PDF file.

name, location, reason, contact

Optional fields.