#1 2020-01-23 05:26:23

erick
Member
Registered: 2015-09-09
Posts: 155

htm2pdf dll

The HTM2PDF module is very impressive, it does a beautiful job.

It would be nice if it could be compiled to a callable DLL, so we don;t have to add the TViewer module, which is not AMD + modern Delphi compatible.  I spent two hours tonight trying to convert it to Delphi but failed, the FreePascal differences  are quite challenging..

 But I guess I can run it as a standalone Executable.

Another nice option would be a flag to encrypt the PDF if encryption works again (I see others have commented that it doesn't in the latest build).

Congrats 
Erick

Offline

#2 2020-01-24 00:29:04

erick
Member
Registered: 2015-09-09
Posts: 155

Re: htm2pdf dll

I think I answered my own question.

First, I got it to compile with a few subtle changes... don't know where things went wrong before, maybe compiler at home is broke.

But the DLL idea probably wouldn't work because I have a feeling the graphical code cannot run in anything but the main thread.   

I'll look for another solution for my needs.  But it is certainly cool and could be handy.

Erick

Offline

#3 2020-01-24 06:54:51

zed
Member
From: Belarus
Registered: 2015-02-26
Posts: 105

Re: htm2pdf dll

erick wrote:

But the DLL idea probably wouldn't work because I have a feeling the graphical code cannot run in anything but the main thread.

You can call functions from the main thread, no matter where they are. So, the dll idea should work.

Offline

#4 2020-01-27 12:55:35

erick
Member
Registered: 2015-09-09
Posts: 155

Re: htm2pdf dll

True, but I decided on a more elegant solution for my particular needs. 

I wanted a way so that end-users could construct forms using Word etc. and I could automatically fill them in.  Up until now I've used HTML with my own mailmerge on the HTML text file.  But the client wants PDF output... I was thinking of using HTM2PDF for that as a fast solution.

But over the weekend I wrote an Open Document format parser and in real-time convert the document to PDF using synpdf after applying a mail-merge to stuff in the required data fields.   It's threadsafe.

I'll release it after doing more testing, it's only been tested on a few files so far.  And I haven't added graphics support, but I did implement tables.

Erick

Offline

Board footer

Powered by FluxBB