Subscribe to the RSS feed by copy/paste the link below
RSS

Hacking a Megger PAT4 Part 2

Posted by Admin on 27. December, 2020
MyBlog ยป

The megger PAT4 has a parallel printer port that outputs Epson style data for a dot matrix printer.  Now I could buy an old printer and use that but I have an aversion to using paper and I'd like the data to be portable / copyable to other applications.

My solution was to build a parallel to USB converter using a Arduino Nano, then using the captured data to write a LIbreOffice text document,  This document can be output to PDF or parsed into a database, although I already discussed that in a previous blog.

Some text formatting in LibreOffice is required to paginate the report properly.  The code could be modified to add the correct page breaks as required but I wanted to keep the code as a general purpose parser for other uses.

The code is on GitLab  https://gitlab.com/saxicola/lpt_capture.

Adding the Page Breaks

From xisberto on Reddit

Open the text, then hit F11 to make the "Styles and Formatting" sidebar appear on the right of the window.

Right-click the selected style (it should be Default Style) and select New.

Select the Organizer tab and type a name for this style. You can name it "New page". On the "Next style" box, select the "Default style".

Select the Text Flow tab. On the middle of the dialog, there's a "Break" section, select the Insert box. Look at the other options in this section, but the default should work for what you want. Select the font you want too. Click Ok to close the dialog.

Now use the Find-Replace tool to find the text that should start a new page. Click "Find All" and all of them will be selected. Now, on the Styles list, double-click your new Style.  Done.

 

Last changed: 27. December, 2020 at 13:58

Back to Overview



Comments

No comment found

Add Comment