Library or component HTML2PDF
lazarus / 41-Jobs
----------------------------------------------------------------------
GillesH · 2016-11-02 16:57
Hello,
I'd like to know if it is possible for your team to build a library or
a component HTML2PDF compatible with Windows/Linux 32 and 64bits. In
the generated pdf files, I'd like to display tables including formated
cells in miniHTML of TMS. If we suppose it is possible, what would be
the cost specific to my company? What would be the cost of a component
that would meet my specifications and would go into public domain
after a few months and what would be the expected deadline for such a
project?
Regards.
----------------------------------------------------------------------
Graeme · 2016-11-03 10:52
The fpPDF included with FPC (Trunk) and the soon to be released FPC
3.0.2 has the capabilities to generate all kinds of PDF documents
(from simple to complex). It gives you the raw drawing primitives to
accomplish what you need. So that part is not the problem. The
question is more, how complex is the HTML that you want to convert to
PDF? Does it use simple HTML like HTML 4 or much more complex HTML 5
features? Does it use extensive CSS for layouting, or is layouting
done via HTML tables?
Can you supply a sample HTML file that you would like to convert? That
will give a more clear indication of how complex the job will be.
----------------------------------------------------------------------
GillesH · 2016-11-10 09:37
Hello,
Thank you for the answer. The reality is that we don't seek to convert
an HTML file to PDF. This would naturally require to make unnecessary
HTML files.
Assuming a table of a database :
Rec id title im blob
1 1 First base64 blue eyes
2 2 Secund NULL My background is yellow
We search the best way to get the result provided in the attachment.
This has been achieved by using LibreOffice. I am not allowed to use a
client base. We generally use NCReport (with Qt) to get pdf files.
Best regards. Gilles
----------------------------------------------------------------------
Thaddy · 2016-11-10 09:43
LibreOffice simply does that in memory. But it still does the
intermediate step. That's a programmer task.
----------------------------------------------------------------------
GillesH · 2016-11-10 11:03
Hello,
we don't want to use LibreOffice. We are looking for a solution
integrated in Lazarus (library, component). Hence our request.
Regards. Gilles
----------------------------------------------------------------------
Graeme · 2016-11-10 11:33
Hi Gilles,
Thanks for the example, that gives me a better idea of what you want.
Lastly, where does the "assuming a table of a database" information
come from? Does you program query an actual relational database, and
wants to format the output as in your example pdf? Or does the data
come from another file (ODT, txt, XML etc)?
I can say that fpPDF definitely has the capabilities to generate a PDF
as your example. The work is more in reading the "table data" and
parsing the Blob field data.
----------------------------------------------------------------------
GillesH · 2016-11-10 17:00
Hi Graeme,
If such a component existed, we would use a TSQLQuery. All our data
are stored in MySQL (MariaDB) and PostgreSQL databases.
We need :
First page : a "band" Header : Logo + [Title + RC + Subtitle] (HTML
Strings >> Title : single line - Subtitle : multiline)
Other page : a "band" Header (String HTML single line)
All pages : a "band" Footer (String HTML 1 line)
Internal pagination [ 2 fields : page number and total number of pages
]
We started to invest in improving an old library : libjpfpdf.pas. The
principle is simple (cells)... for simple editions. Header, footer and
pagination meet our specifications. I
We have been tinkering with "super cells" to contain multiple cells in
a "row" of the pdf document. The result isn't satisfying in our point
of view.
Our principal IDE is Qt (default choice for Windows - Linux - OS X).
With no time to develop lazrus components, so even if we have done so
before, I (we) appreciate lazarus (more than delphi). But to use it in
a professional way, we need a tool to store and edit HTML data in pdf
files.
Best regards. Gilles
----------------------------------------------------------------------
Graeme · 2016-11-10 22:19
The soon to be release fpReport - a new reporting engine I was
commissioned to develop for FPC - can do what you need with ease. It
can report from TDataset or custom user-data. The standard reporting
features like headers, footers, alternate layouting between start/end
page and the rest are all supported. The fpReport engine is totally
non-GUI (unlike any other Object Pascal reporting engine we could
find), and so is fpPDF (already released to FPC Trunk). fpReport also
has exporters to PDF, PNG, any other image format, LCL Canvas
(optional), fpGUI Canvas (optional) and HTML. So if you can hold off
for a couple more weeks until fpReport gets released, you will have a
easy solution to your problem.
----------------------------------------------------------------------
GillesH · 2016-11-11 14:28
Hi Graeme,
"It can report from TDataset or custom user-data." Including
datafields "miniHTML TMS" formatted ? Yes, we can expect it.
If this occurs, we may ask you to perform a few additional monetised
and public functions : compatibility with Unidac, and display of
embedding base64 images (
). This
fund will be our way to support your work and Lazarus.
Please don't hesitate to contact me at my current email address.
Regards. Gilles
----------------------------------------------------------------------
Graeme · 2016-11-11 15:43
Quote from: GillesH on November 11, 2016, 03:28:05 pmIncluding
datafields "miniHTML TMS" formatted ? Yes, we can expect it.
As for user-defined data, fpReport can do reporting on anything, so
yes TMS formatted data should be just fine. I've created demo reports
reporting from TStringList, TObjectList, TDataset etc. No problems.
We don't have an exact released date for fpReport. I've completed the
implementation of fpReport, wrote a couple report exporters, 12+ demos
and a report converter from Stimulsoft to fpReport. The person that
hired me to do this said he would like developers to have the best
possible experience when fpReport is released - so we decided we are
going to implement a visual report designer as well, before we make
the release. So the release has now been postponed by a couple more
weeks.