Skip to main content

Testing and Debugging

For testing and logging several options exist.

  • Testing can be done with a local installation of comet_pdf. This can be directly installed in your OS or running in a Docker container.
  • If you do not have a local installation you can execute your project on the priint cloud and use the logging information provided by the rendering service.

Testing with a local comet_pdf installation

To render test pages of one product data sheet you must install comet pdf renderer on your computer.

After installation and after configuration of the comet project and preparation of the items.xml, products.xml and master document .w2ml files, you can start rendering using the following command:

Example Call On Mac or Linux System

/opt/renderpdf/R31234/comet_pdf
--fontfolders /opt/renderpdf/R31234/fontfolders_default.xml
--fontfolder /Users/johndoe/priintgrid/tenants/example.com/projects/postcards/renderpdf/comet/fonts
--psnames /Users/johndoe/priintgrid/tenants/example.com/projects/postcards/renderpdf/comet/fontnames.xml
--folders /Users/johndoe/priintgrid/tenants/example.com/projects/postcards/renderpdf/comet/images
--xmlread fast
--config_path /opt/renderpdf/R31234
--conn /Users/johndoe/priintgrid/tenants/example.com/projects/postcards/renderpdf/jobs/postcard-1/connection.xml
--cache /Users/johndoe/priintgrid/tenants/example.com/projects/postcards/renderpdf/jobs/postcard-1
--exec place
--products /Users/johndoe/priintgrid/tenants/example.com/projects/postcards/renderpdf/jobs/postcard-1/items.xml
--login postcards
--in /Users/johndoe/priintgrid/tenants/example.com/projects/postcards/renderpdf/comet/master-documents/default.w2ml
--out /Users/johndoe/priintgrid/tenants/example.com/projects/postcards/renderpdf/jobs/postcard-1/postcard-1.pdf
--metadata 0
--log /Users/johndoe/priintgrid/tenants/example.com/projects/postcards/renderpdf/jobs/postcard-1/postcard-1.log
-g "char * gMediaProxy=''"
-g "char * gTicketId='2021-09-22T23:52:24.176536Z'"
--launch

Explanation:

  • In this example, the comet_pdf executable was installed in /opt/renderpdf/R31234/ folder.
  • The comet XML project was configured in /Users/johndoe/priintgrid/tenants/example.com/projects/postcards/renderpdf/comet folder.
  • Products xml, items xml and connection xml and also all output files like pdf file and comet log are stored in /Users/johndoe/priintgrid/tenants/example.com/projects/postcards/renderpdf/jobs/postcard-1/ folder.

The connections.xml looks like:

<connections>
<connection>
<id>1</id>
<name>postcards</name>
<type>xml</type>
<server>/Users/johndoe/priintgrid/tenants/example.com/projects/postcards/renderpdf/comet
</server>
<user/>
<password/>
<db/>
<lang/>
<client/>
<passcredentials/>
</connection>
</connections>

Always keep in mind that local testing on Windows or Mac may lead to slightly different results than in priint cloud itself, due to subtle differences between Linux comet_pdf version and Windows and Mac versions.

warning

In this case it is not possible to test external images using the priint:cloud media proxy service. This is possible if you use an additional configuration tool for priint:cloud development, called priint:cloud client. This software uses Docker Desktop and starts rendering in a container or directly on the priint:cloud in the cloud. There is also the other option to start rendering. The project must be managed by the priint:cloud management application, see: https://mgmt.priintcloud.com

Remote Logging and the comet.log file

Users can set the log mode of the renderpdf worker that will start comet_pdf in priint cloud.

Add a file config-log.ion to your project to override some of the default properties.

$project/renderpdf/config-log.ion
{
cometLog: "on", // will create /renderpdf/output/$ticket.comet.log
pdfLibLog: "on", // will create /renderpdf/output/$ticket.pdflib.log
keepLog: "always", // keep log regardless whether there is an error or not
keepLogForSeconds: 3600 // log is marked for automatic deletion after 1 h
}

Apply these settings by adding the "debug" profile to a REST API call, like

POST /rest/tenants/example.com/projects/datasheets/renderpdf?profile=log
Content-Type: application/xml

The log files will be stored next to the PDF. You can download all artifacts related to the renderpdf process (pdf and logs) using the artifacts endpoint of the REST API.

Here comes an example request:

GET /rest/tenants/example.com/projects/datasheets/tickets/76wirw7rwei842/artifact
Accept: application/zip

The response will be a zip archive containing several files related to your ticket like the following:

Contents of 76wirw7rwei842.zip
├── 76wirw7rwei842.pdf                # the PDF (only if the rendering was successful)
├── 76wirw7rwei842.comet.log # the comet log file
├── 76wirw7rwei842.content.xml # the actual XML input for the rendering
├── 76wirw7rwei842.items.xml # the actual product list for the rendering (if simple "place" mode was used)
└── 76wirw7rwei842.pdflib.log # the PDFLib log file