x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

PDF export in eVB?

I dunk for bananas Page Icon Posted 2024-01-27 11:54 AM
#
Avatar image of I dunk for bananas
H/PC Elite

Posts:
667
Location:
Europe
Status:
My application currently only exports as HTML, but is it possible to programmatically export a document as PDF using eVB?
 Top of the page
C:Amie Page Icon Posted 2024-01-27 12:11 PM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
17,925
Location:
United Kingdom
Status:
Not natively. You will either need a Windows CE comm control that can offer an interface (I am not aware of any for CE, there are for x86 VB6 however) or you would have to port something like WkHtmlToPdf to CE first https://github.com/wkhtmltopdf/wkhtmltopdf and then call the .exe from VB to generate the PDF.

Alternatively, you could try an use a web service where you upload the file and download the PDF... but the problem is going to be the lack of TLC 1.2 support needed to use the modern internet. So you would have to find a web PDF service with an API that also works over plain HTTP.
 Top of the page
WinCEDev Page Icon Posted 2024-01-27 6:37 PM
#
Avatar image of WinCEDev
Factor Fanatic

Posts:
62
Location:
Europe
Status:
I think PDF export in pure eVB is going to be very challenging, and like @C:Amie I'm not aware of any 3rd-party components that would be able to do it under Windows CE.

As an alternative, maybe you could export to Rich Text Format instead? Under the hood it's a plain-text format so it would be easy to produce with the File control or API functions. Then if the user so wishes they could convert the RTF file to PDF on their computer using Microsoft Word or other software.

I also found this thread, it seems that the Pocket Word and RTF format are very close, so you may be able to just type up a template in Pocket Word and use that as a starting point for exporting PWD files. Then the user could open them on their handheld and also do some edits if needed.

Edited by WinCEDev 2024-01-27 6:38 PM
 Top of the page
stingraze Page Icon Posted 2024-01-28 2:37 PM
#
Avatar image of stingraze
H/PC Vanguard

Posts:
3,625
Location:
Japan
Status:
Not taking into SSL / TLS into account and making it easier, if you had an API running on a server that accepts incoming connection to convert it to PDF using Python, it might work.

Generates link to download the PDF made on the server and displays it.<- PDF Generated <- API Server <- eVB socket that sends to API Server

There are a lot of libraries with Python that enables this: FastAPI for API, pdfconverter to change multiple file types to PDF.

FastAPI
https://pypi.org/project/fastapi/

pdfconverter:
https://pypi.org/project/pdfconverter/

Edited by stingraze 2024-01-28 2:39 PM
 Top of the page
Jump to forum:
Seconds to generate: 0.142 - Cached queries : 52 - Executed queries : 19