<< to CrossControl homepage

Support & Service Center

PDFs in CODESYS

Printer-friendly versionPrinter-friendly versionPDF versionPDF version

We have written a small Qt application which allows the user to show PDF files from within CODESYS.  This works by opening the Qt application which appear on top of the CODESYS application.  You can format the Qt applicatoin to be different sizes on the screen so it doesn't need to take up the entire screen and can instead take up only a portion of the screen.  The attached CODESYS project shows an example of this.

The Qt application will import PDF files from a USB drive inserted into the display.  The files will be converted to a .jpg file which the appliction will use to show the "PDF".  We use .jpg files instead of the native .pdf format due to many of the displays taking a long time to open and move around a true PDF file.  This is not the case for .jpg files which the display will open quicly once the conversion has been made.  The conversion process may take some time though depending on the size of the PDF file being converted but this process will only happen once.  Once the PDF file has been converted and imported (by the tool) it will be stored on the display for future viewing.

Instructions for use:

  • Download the 'pdfviewer_v0.0.2.tar.gz' and the 'codesys_pdf_viewer_app.tar_.gz' files attached to this article and copy them to the '/opt/ directory of the display
  • Log into the display through the terminal and navigate to the '/opt' directory.
  • Type  'tar -xf pdfviewer_v0.0.2.tar_.gz -C /opt' and hit enter
  • Type 'ldconfig -C /opt/etc/ld.so.cache' and hit enter
  • Type 'tar -xf codesys_pdf_viewer_app.tar_.gz' and hit enter
  • Type 'chmod +x CoDeSys_PDF_Viewer' and hit enter
  • The PDF viewer requires the Qt runtime be installed on the display. Install the latest LinX runtime available in the LinX software page.

Now download the 'codesys_pdf_example.projectarchive' file and open with the CODESYS IDE.  The example applicatoin was built for the ARM display with a 800x480 resolution (XS / VA / VC) so if you are using another display type modifications may be necissary.  This example CODESYS application should demonstrate how the Qt PDF application is opened within CODESYS.

Also attached to this article is the source code for the Qt PDF project ('codesys_pdf_viewer.tar_.gz').  It may not work perfectly in all applications so changes to the code may be neccissary.

Note: This will only work with the QWS windowing system.  If using X-Windows or another system this project will not work.

 

 

whatever