Author Topic: PDF Report Generation In Processor  (Read 3330 times)

0 Members and 1 Guest are viewing this topic.

Offline jmag999Topic starter

  • Contributor
  • Posts: 41
  • Country: us
PDF Report Generation In Processor
« on: April 30, 2015, 06:29:45 pm »
Anyone have any advice on generating a PDF report within a microprocessor?  I'd like to generate a PDF template, then have the microprocessor fill in the form and write it to a USB thumbdrive.  I found libHaru, but it seems pretty heavyweight.  Has anyone else had any experience with this?
 

Offline Cliff Matthews

  • Supporter
  • ****
  • Posts: 1911
  • Country: ca
    • General Repair and Support
Re: PDF Report Generation In Processor
« Reply #1 on: April 30, 2015, 06:57:42 pm »
A microprocessor is hardware and PDF is a standard file format... two fairly unrelated things here...
By microprocessor, do you mean a PC and what OS will you use? Will the OS also boot the PC from the USB?
Are you testing PC's to get a hardware report on each and have it stored on the USB drive?

Most people who want to auto-generate PDF files do so as a PDF printer (eg: Bullzip, etc.. ) http://www.techsupportalert.com/best-free-pdf-writer-software.htm but some hardware test programs can generate PDF's named by the NetBIOS name of the PC. It shouldn't be hard to script something together.
 

Offline jmag999Topic starter

  • Contributor
  • Posts: 41
  • Country: us
Re: PDF Report Generation In Processor
« Reply #2 on: April 30, 2015, 07:32:52 pm »
Let me be more clear.  I want to take a PDF template and fill in the data using an STM32 processor.  This has nothing to do with a PC and should be OS agnostic (ansi c).
 

Offline gman4925

  • Regular Contributor
  • *
  • Posts: 51
  • Country: us
Re: PDF Report Generation In Processor
« Reply #3 on: April 30, 2015, 07:37:36 pm »
Depends on the processor, but editing a PDF might be a bit much for a 8-bit micro.
I would probably forget about PDF and maybe look at writing your report in LaTeX instead and look at including a viewer/converter bundled on the USB drive.
 

Offline gman4925

  • Regular Contributor
  • *
  • Posts: 51
  • Country: us
Re: PDF Report Generation In Processor
« Reply #4 on: April 30, 2015, 07:41:03 pm »
Oops didn't see it was STM32.
You might have luck rolling your own, the PDF standard is available from adobe and includes examples of PDF file structures, which don't appear too complicated.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22433
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: PDF Report Generation In Processor
« Reply #5 on: April 30, 2015, 09:04:10 pm »
I suspect the basic process of generating recognizable and readable files will be quite simple (you can do it in plain text Notepad), but calculating the formatting will be a much greater challenge.  I don't know that that can be done automatically in PDF.

As a general example of document formatting: the MiKTeK package is an 80MB download for Windows.  I don't know what a minimal package of pdflatex would entail (it's free software, so you should, in principle, be able to port it to your platform!).  It will certainly fit on a flash drive, but that doesn't necessarily mean you would want to use it.  It will be file-intensive, and run very slowly, reading and writing from such limited media.  The processing power is also a bit on the thin side, but to your advantage, LaTeX comes from the days of sparse RAM, so an ARM M-something should be more than adequate.  And being file-intensive, you may prefer a platform that can support Linux embedded, which will consume more program storage, RAM and CPU cycles.

Perhaps a worst case would be, you have to add Flash and RAM to your project (using a processor which supports an external memory bus).  But I'm guessing that's better avoided.

What is the end purpose?  You may find it vastly superior to use a different standard.  There isn't a commercial computer device in existence which doesn't support HTML -- look it up on your phone, look it up on your desktop, look it up on your printer (ehh, possibly).

HTML and LaTeX share some common background, and have a certain amount of equivalency as markup languages (PDF can also be structured as markup I think, but you still have to calculate everything, whereas HTML and LaTeX have defaults, and simple commands allow changes to global and local formatting).  The biggest difference being, HTML is always rendered on-demand in the browser, while LaTeX needs to be compiled, so the burden on your system is exponentially smaller.  It should be no surprise that embedded systems such as routers easily offer HTML over HTTP as standard portals.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Marco

  • Super Contributor
  • ***
  • Posts: 6966
  • Country: nl
Re: PDF Report Generation In Processor
« Reply #6 on: April 30, 2015, 09:47:55 pm »
If you want PDF just to have a single file, you can even embed images directly into a HTML file.
 

Offline Cliff Matthews

  • Supporter
  • ****
  • Posts: 1911
  • Country: ca
    • General Repair and Support
Re: PDF Report Generation In Processor
« Reply #7 on: April 30, 2015, 11:30:57 pm »
Does this have to be done by an outboard or autonomous controller? AutoIT script can get a pdf editor to go through the motions (pulling strings from csv's, inserting, naming and saving to specific file-names). https://www.autoitscript.com/site/autoit/
On OSX and *nux platforms similar solutions should exist (http://javauto.org/).

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf