Skip to content

PDF generation using an AXC F 1152

Hello,

 

I am developing a project in which a PDF has to be generated from an acquired set of sensor data. I have never used a PLCnext controller, but am considering on getting one to carry out said project. What would be the best way to carry out this task with an AXC F 1152?

Thanks,

Carlos. 

Comments

  • Hi Carlos,

    There is no PDF generator included with the firmware, so you would need to install a third-party PDF generator. You also need to consider the format of the file that you pass to the PDF generator (e.g. HTML, XML, Markdown).

    The choice of PDF generator will depend on what languages and/or tools you're comfortable using on the PLCnext platform. Some examples:

    Nodejs (PDF from Markdown):

    https://www.npmjs.com/package/markdown-pdf

    Python (PDF from Markdown):

    https://pypi.org/project/markdown2pdf3/

    Pandoc (this would need to be cross-compiled for the AXC F 1152):

    https://pandoc.org/

    (I have no idea how easy or difficult it would be to get any of these running on an AXC F 1152)

    ---------

    The above could also be used in a Docker container, if you prefer.

    I suggest getting the PDF generation process working on a desktop system first (e.g. Debian) using tools that you're comfortable with, and then migrating the solution to the AXC F 1152.

    Hope this helps.

    ~ Martin.

  • Hello Martin,

     

    Thank you very much for your response. I will try what you suggest of getting the process running on a Linux PC first then. Are there any guides you suggest on how to then migrate the solution to the Controller? I understand would have to create a custom

     

    Carlos.

  • Hi Carlos,

    Are there any guides you suggest on how to then migrate the solution to the Controller?

    It depends on what solution you want to use. The tools you choose to implement the solution (e.g. Nodejs, Python, C++, etc) should be something you're comfortable working with already on the PLC. If you can migrate a "Hello World" application to the PLC using those tools, then the principle will be the same for a more complex application.

    ~ Martin.

  • Hi Martin,

    I understand. My problem is, I have never worked with PLCnext before and do not have any unit here to test this with. What I wanted was a way to plan out what needed to be done before buying the Controller and committing to using one on this project. I am familiar with using Nodejs and able to generate a PDF on a Linux PC. What I am unsure is how I can carry out this same process on the AXCF 1152. I know it runs on Linux, would something like this be done through some sort of CLI?

    Again, thanks for the responses so far,

    Carlos.

  • Hi Carlos,

    one option to create a PDF document on an AXC is using node-red. I have installed node-red in a docker container on the PLC. In node-red I use a node called pdfmaker that can create a pdf. The document to create is described in JSON format.

    I will attach some screenshots and hope this helps you with your decision.

  • Stefan's example demonstrates one possible solution, but of course there may be many others.

    If you want to use node.js without node-red, then you will probably be calling the node.js program from the command-line. In that case, you may be able to execute that command from inside a PLCnext Engineer project, using the Shell FB in the PLCnext Base library.

    I hope this gives you some ideas.

    ~ Martin.

      

Sign In or Register to comment.