Hi All,
I'm new here, and a search didn't turn up anything quite like what I
want to do, so I hope these are simple questions.
I've attempted to put together a skeleton of what my understanding is of
the process, and I hope someone can fill in the holes and/or provide
correction as needed. Please excuse my ignorance -- I don't even know
what I don't know yet! :)
Background: I have an application that runs as an add-on inside another
application. It needs to add text to an existing PDF containing a
drawing. I will be able to determine info for the various text elements
(position, font, size, color). From what I've read, iText can do this
quite easily. However, the wrinkle here is that it *must* be done on
the end-user's workstation -- no server or web-based processing, i.e.
it all needs to be self-contained.
NOTE 1: I realize this requires a commercial or OEM license, which I
will obtain once I am able to verify that iText can do what I need it to do.
NOTE 2: My add-in application is only able to write out plain-text
files, and can also call command-line applications (which is why iText
seems like a good solution).
Simple Objective: take the existing PDF drawing and add text to it.
Example drawing is 100x100 mm, and needs to have a title centered at
50mm,85mm (from the lower left of the drawing). Title text is "My
Drawing" and is in 12 point Arial font.
Proposed processes:
Installation:
1. User installs my software using my installation package. This
installation package will need to be modified to include something
to allow adding text to an existing PDF file using iText.
*Question: What file(s) will I need to add to my installation package,
and what is the approximate size (compressed or uncompressed)?*
*Question 2: I believe that I will need to use iText Java for this since
it's on the end-user's workstation. Is this correct, or will iTextSharp
work?*
Run-time (user runs my application from within their application):
1. User clicks "add texts" in my add-in function
2. my function determines which texts need to be added, and obtains all
of the info (font, position, size, text, etc).
3. my function creates a "specification file" for iText containing info
to create texts in the existing PDF (or a new pdf, if that's easier)
for each text element to be added. In this case, it's only the
title at 50,85mm, text "My Drawing" font Arial 12pt.
4. my function calls the iText executable via its command-line function
to use the specification file from step 3 to add the texts to the
existing PDF or to create a new PDF containing only the new texts.
5. (only needed if step 4 creates a new file) My function calls an
external program (such as PDFTK) via command-line to smash the
existing PDF with the new PDF from step 4 to create the final PDF.
*
Questions: *
* Can the above sequence be performed with iText completely on the
user's workstation?
* Is the above sequence correct and/or reasonable?
* Any recommendations to improve the above sequence?
* What would the file in step 3 look like (using the Java interface --
I don't think I can use the C# interface on the customer's
workstation. If I can, what would that file look like as well, please?)
* What changes to the file in step 3 would need to be made if the font
were non-standard (such as "Batang")
* What is required to embed the font if it's non-standard?
* What would the command-line call to iText look like, both for the
Java interface and for the C# interface if that's an option?
Thanks very much for your time and assistance!
andy
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples:
http://itextpdf.com/themes/keywords.php