Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Create a PDF in a Microcontroller.

Status
Not open for further replies.

Kisen

Member
Hi,

I was looking online for a thermometer a few days ago and came across this.

**broken link removed**

I find this really interesting. It has a microcontroller on board that takes readings etc. From what i can see it then generates a PDF that is stored in the controller like a Mass storage device.
When you plug it into your computer, it shows as a mass storage device with the PDF file available to view. No third party software required at all (apart from a pdf viewer)

This is something that i though would be great in a project that i might start.
I googled as much as i could on the PDF creation part of this thing and found nothing of use.
The mass storage device side i think i could get my head round, but does anyone have any info on how to create the PDF?

Thanks
 
Last edited:
If creating a PDF from scratch in the microcontroller isnt possible, could i get some thoughts on putting a partially filled in PDF on the mass storage section and then the microcontroller editing the document internally on the fly??
 
I could not find a way either.
I sent raw data to the PC and had it make a PDF.


Hi,
So you tried this.. Excellent :)
When you say you sent raw data to the PC and made a PDF, Did the PC have a program to do this?
What i would hope for in my application would be that the act of opening the file on the micro is all thats needed to generate a PDF. I doubt that is possible tho.

I tried to read up on how a PDF was constructed, but i didnt really understand it all.
 
What micro? I think some smart boy could do PDF on a big micro but I don't know how.
I am using a Raspberry Pi-3 to collect data. It can make PDF and has huge storage and talks USB etc.
I think you could do it on a Raspberry Pi-0 which is about $5.00usd or a Pi-0w which has wifi for a little more.

I just looked and there is a PDF Studio for the Pi.
I am writing this on a Pi-3.
The picture is of a Pi-0.
2885-06.jpg
 
I tried to read up on how a PDF was constructed, but i didnt really understand it all.
Me to. lol

What I did is to put the micro on the internet and have it write HTML files. (wiFi or 10 bast-t)
So the little computer has web pages with graphs. Any PC with a web browser can see the graphs and "print to a PDF printer".

Years ago I used serial ports to connect the micro to a PC and use a spread sheet program to make graphs and then print to PDF file.
 
Just a side note.
Why use PDF's format as destination for data logging? Consider this caveats:
- No way of easy extraction of data
- Therefore - no way to easilly extract a set of data (ie. within a certain period of time) to your own analysis.
- Cannot import to spreadsheet.
- Even if it's possible to copy/paste text from PDF, the resulting text will probably be a whole mess - not even sure if it makes out in correct order.

All those problems are solved by saving the log files as CSV-files. Then they can easilly be imported into a spreadsheet and you can manipulate or analyze your data excactly the way you want.
 
Is there a simplified version of pdf? Can a rich text file (RTF) be imported to a pdf viewer?

Mike.
 
Just a side note.
Why use PDF's format as destination for data logging? Consider this caveats:
- No way of easy extraction of data
- Therefore - no way to easilly extract a set of data (ie. within a certain period of time) to your own analysis.
- Cannot import to spreadsheet.
- Even if it's possible to copy/paste text from PDF, the resulting text will probably be a whole mess - not even sure if it makes out in correct order.

I think you're missing the point, the whole idea of the link above was to prevent all those things.

However, I don't know if the OP wants to do that or not?, it seems a fairly obscure requirement.

As far as PDF's go, I can only imagine there must be a LOT of computing power in the link above, to actually create PDF's - which isn't a trivial process.
 
Now you have really got me intrigued. You guys are suggesting that it requires some serious computational power to create a PDF. The chip on that datalogger is just an STM32 chip.
Heres another link to another version showing the internals.

https://www.walmart.ca/en/ip/PDF-Si...gger-120-Days-Record-Duration/PRD6ATKFFE1OJYF

So my question i suppose is, how does an STM32 have the power to process data into a PDF and allow the user to read that file from its own mass storage?


Clearly it is possible to do it.
 
Now you have really got me intrigued. You guys are suggesting that it requires some serious computational power to create a PDF. The chip on that datalogger is just an STM32 chip.
Heres another link to another version showing the internals.

https://www.walmart.ca/en/ip/PDF-Si...gger-120-Days-Record-Duration/PRD6ATKFFE1OJYF

So my question i suppose is, how does an STM32 have the power to process data into a PDF and allow the user to read that file from its own mass storage?


Clearly it is possible to do it.
What do you mean how? STM32s can decode MP3s which are larger than PDFs and need to be done in real-time. I assume this one is running a version of Linux (which they can also do) to do what it does. Probably much easier to find a pre-existing open-source resource that way. Which STM32 line is it using?

I do wonder how flexible the PDF generation is...whether it cooks one up from scratch or is just modifying a template.
 
Last edited:
Now you have really got me intrigued. You guys are suggesting that it requires some serious computational power to create a PDF. The chip on that datalogger is just an STM32 chip.

An STM32 is a pretty powerful 32 bit processor, do you know which model it is? - they are ARM based, run at pretty impressive speeds, and many have impressive amounts of RAM and ROM.

If you want to create PDF's, I suggest you first learn to do so on a PC, but I don't know where you'd start as PDF's were proprietary and belonged to Adobe - possibly that doesn't apply now? - or are these people paying Adobe license fees?.
 
From hours of searching; I think the PDF creator is a mystery that "they" don't want you to know.
I have made data loggers with a small 8 bit computer and a big memory chip. Any thing hard I push off on the PC.
The STM32 is not small.
Because we can not find out how PDFs are created I don't know how much power it takes.
Because some one did it you should be able to ..... but .... I can't help.
 
From hours of searching; I think the PDF creator is a mystery that "they" don't want you to know.
I have made data loggers with a small 8 bit computer and a big memory chip. Any thing hard I push off on the PC.
The STM32 is not small.
Because we can not find out how PDFs are created I don't know how much power it takes.
Because some one did it you should be able to ..... but .... I can't help.
Did you search open-source stuff that could run command line under uLinux? ImageMagick can do it but I don't know if it can run on uLinux.

Also this:
https://www.linux.com/learn/manipulating-pdfs-pdf-toolkit
 
Last edited:
There are open source codes to create a simple PDF output BUT!! A lot of work needs to be done... I looked at this.. https://mupdf.com/

There are source releases for several platforms including Android ( primarily an ARM processor.)
 
Can a rich text file (RTF) be imported to a pdf viewer? Mike.

The latest Acrobat Reader, refuses to open .rtf files.

Adobe Acrobat DC, does not convert .rtf files to .pdf but will happily do with .txt ones. Anyway, the resulting file is HUGE. Check these below. Tons of metadata.
 

Attachments

  • La prueba de Agustín.txt
    104 bytes · Views: 266
  • La prueba de Agustín.pdf
    9.9 KB · Views: 305
A .pdf is pretty much postscript data in a "wrapper" / container.

The standard unix/linux postscript converter is Ghostscript.
Some .pdf writers use that for the bulk format conversion.

Ghostscript itself has an addon called ps2pdf which will create .pdfs - and that software is open source / GPLd..

https://www.ghostscript.com/
**broken link removed**

The source package is 40MB.. No idea how much of that is docs and test files.
 
So are we saying that the micro needs linux running on it and then linux does the task of converting to PDF.
I have never used linux on a micro, so that in itself is totally alien to me.

I might have to get me a STM32 dev board and see what linux can do.
 
So are we saying that the micro needs linux running on it and then linux does the task of converting to PDF.
I have never used linux on a micro, so that in itself is totally alien to me.

I might have to get me a STM32 dev board and see what linux can do.
I think EmCraft is one of the better options for that. Fairly inexpensive and comes with the external memory that is often required to run uLinux and comes with it pre-loaded (I always thought the external memory was required but the PDF product you linked doesn't seem to have any so maybe it's possible to run it without). I personally like that it provides a bare-bones module to integrate into your own project if needed and an inexpensive carrier board. Not a real fan of overblown dev boards.

https://www.emcraft.com/
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top