Blog

Merlin Project: Create Project Handbook as PDF

Merlin Project Support

We received the following question just recently:

icon

I’m using the latest version of Merlin Project on a mac and have created a project file for a client. He has requested a project handbook to be printed or read in Preview or Acrobat Reader. The project handbook should list activities and attachments in a master–detail interface and export a set of predefined properties I am interested in. I don't mind if I need to use a script but I would like the action to do all works in one go; ie. iterate the items, extract the data and create the PDF. Is this possible?

One way to implement the customer's request would certainly be to use the File > Export > Image menu to export customized project views to PDFs or to call File > Print to print your documents.

However, to meet the requirement described above, an AppleScript solution developed by us comes in handy.

The script iterates all project activities, extracts activity properties on each item. It checks if there are attachments, extracts their corresponding properties, writes an AsciiDoc text file onto the Desktop. Finally it calls Asciidoctor PDF to create a PDF using a customized stylesheet.

Installation of the Script

  • Download the following archive.
  • Expand the zip file.
  • Call in Finder menu Go > Home
  • Move here the folder res-for-script
  • Call in Merlin Project File > Actions > Show Scripts Folder.
Merlin Project - Show Scripts Folder
  • Open the folder called net.projectwizards.merlinproject
  • Move the script file called Create Project Handbook.scpt into Merlin Project's Scripts Folder.
  • Double click the script Create Project Handbook It will be opened in the Script Editor
  • Locate the row containing property pathToAsciidoctorPDF
  • Open a Terminal window and call command -v asciidoctor-pdf
  • Modify the pathToAsciidoctorPDF when appropriate

If you need to install asciidoctor-pdf follow the installation instructions and modify the pathToAsciidoctorPDF when appropriate.

Creating the Project Handbook

Open any given project. Call the script Create Project Handbook out of Merlin Project's File > Actions > … menu.

Wait for the script to create the AsciiDoc file and to call the PDF conversion using asciidoctor-pdf. It beeps when writing the text file every 75 items. Both the AsciiDoc .adoc file and the created PDF will appear on the Desktop.

The customized stylesheet renders a title page for the project handbook including the creation date and handles Apple Emojis. The PDF file will have a clickable table of contents.

Project Handbook for the Demo Document

Attachments will be listed under their parent items.

Project Handbook: Item and its Attachments

Feel free to open the .adoc file and modify it if need to convert the PDF in a second step using your own stylesheets. Should you want to use your own stylesheet for the PDF, simply place it into the res-for-script folder and rename the themeName property in the script accordingly.


Note To AppleScripts from ProjectWizards: You may incorporate this ProjectWizards sample code into your program(s) without restriction. This ProjectWizards sample code has been provided "AS IS" and the responsibility for its operation is yours. You are not permitted to redistribute this ProjectWizards sample code as "ProjectWizards sample code" after having made changes. If you're going to redistribute the code, we require that you make it clear that the code was descended from ProjectWizards sample code but that you've made changes.
To modify this or other AppleScript samples, please refer to the Scripting Merlin Project document. You'll find there various samples and code snippets ready to use.

Merlin Project en el Mac y el iPad

Sus ideas, nuestra magia – ¡realice proyectos de forma sencilla!
Pruebe ahora 30 días de forma gratuita.

-->