> My printing system is 90% based in generating reports through .pdf
> files using harupdf , but sometimes i have to fill some forms that are
> by law designed.
Are these forms originally in .pdf format and fillable using Adobe
Acrobat/Adobe Reader/Foxit Reader etc? If so, the easiest method is to
use .fdf files just like Maurizio said. An .fdf file is a text file
following a simple syntax. When you double-click on the finished .fdf
file, the .pdf file that it "belongs to" will also be opened, and the
fields in the .pdf will be filled with whatever you have put in the .fdf
file. Double-clicking the .fdf file and saving the final .pdf file is a
manual step.
The .fdf file format is described in the PDF Reference, available here:
http://partners.adobe.com/public/developer/en/pdf/PDFReference16.pdf
This file is huge, so right-click on the link and save it.
Here is a small example of what an .fdf file can look like:
%FDF-1.2
%����
1 0 obj
<</FDF<<
/F(mypdfwithtextfields.pdf)
/Fields[
<</T(1)/V(Text in field number one)>>
<</T(2)/V(First line of field number two\second line here)>>
<</T(3)/V(Third field)>>
<</T(4)/V(Fourth field, and so on)>>
]>>>>
endobj
trailer
<</Root 1 0 R>>
%%EOF
The second line tells the application that there may be non-7-bit
characters in the file. The fifth line is the name of the .pdf file that
is to be filled with data. The numbers in parenthesis are the field
numbers in the .pdf file. Text in multi-line fields can be broken with
backslashes.
You will probably need Acrobat Pro to identify all the fields in the
existing .pdf files and find out which field has which number or name.
If the original file is just a dumb pdf with no forms, then you can use
for example Acrobat Pro to create the fields manually. If they only
exist on paper, scan them to .pdf and create the fields in Acrobat.
Adobe and others have SDKs that will let you fill existing .pdf files
directly. But that is a slightly bigger project.
Regards,
Klas
> Although not really harbour-related, I strongly suggest you to have a
> look to pdftk.
> http://www.pdflabs.com/docs/install-pdftk/
Sure. I use pdftk too. It is very powerful. The only problem is that it
adds an extra requirement for Zoran's clients.
Regards,
Klas
> Since I use only, at this time, harupdf, my intent was simply to open
> an already
> made pdf that contain, for example, plotted tables and then using
> harupdf functions
> to write text in cells (fill them).
>
> I must say, also, that that the tables/reports are made in openoffice,
> identical to the request laws forms/reports that I need
> and exported in pdf-s. There is no embedded form fields in it to fill,
> just simply pdf with tables.
>
> I simply want to overpass the method to create the above mentioned
> tables and save them as png or jpg and
> then import them using harupdf.
If you are considering drawing the forms in OOO identical to the
original government forms, exporting them to png/jpg and then importing
the bitmaps into the pdf to put your data on top of them, why not just
scan the original paper form to png/jpg and save all the drawing work?
You can stretch or shrink the background picture programmatically to fit
the size requirements.
Or you can program the form straight in the pdf using line drawing
functions. It may seem daunting at first, but you will quickly get the
hang of it. That will give you the smallest file size and no blur caused
by bitmap compression.
Regards,
Klas