Title: RE: [iText-questions] Embedded fonts when using PdfStamper...

Send me the pertinent parts of your code and I'll see what can be done.
An alternative would be to use DocumentFont just to get the metrics and write the text with PdfContentByte.setLiteral().

Best Regards,
Paulo Soares

    -----Original Message-----
    From:   Christer Sandberg [SMTP:[EMAIL PROTECTED]
    Sent:   Thursday, February 05, 2004 20:07
    To:     Paulo Soares; [EMAIL PROTECTED]
    Subject:        Re: [iText-questions] Embedded fonts when using PdfStamper...

    Hi Paulo, have been playing around today looking at the classes below.
    Most of the things work OK but some things don't work as expected from
    my point of view.

    Here's what I have done/trying to do.

    I received the PRIndirectReference's through the resource dictionary via
    the page dictionary from PdfReader. Created a DocumentFont (via
    reflection since it's package protected). So far all is well. When
    trying to open the resulting PDF after adding some text with this font,
    Acrobat complains about missing the page resources dictionary.

    After looking at PdfWriter and PageResources I saw that trying to add a
    font to font dictionary with a name that already exist creates a new
    <i>font name</> like Xi0. I can see that this is needed for acroforms
    etc, but it would be nice to add text refering to the already existing
    font in the font dictionary. I managed to do this by adding a check if
    the font already exists in the page resources, and got it working, but
    is this the right way to do it. Maybe there should be a way to lookup
    the font names and their references and use them directly. There could
    also be a <i>lite</i> implementation when only adding text via
    PdfContentByte, that dosen't even need the font being parsed as a
    DocumentFont, only using the reference directly. Could be nice if the
    metrics aren't needed when writing directly to the buffer in the low
    level API.

    What's your thought about this?

    Christer

    Paulo Soares wrote:
    > Have a look at AcroFields.getAppearance() and DocumentFont.
    >
    > Best Regards,
    > Paulo Soares
    >
    >       -----Original Message-----
    >       *From:  * Christer Sandberg [SMTP:[EMAIL PROTECTED]
    >       *Sent:  * Wednesday, February 04, 2004 16:11
    >       *To:    * Paulo Soares
    >       *Cc:    * [EMAIL PROTECTED]
    >       *Subject:       * Re: [iText-questions] Embedded fonts when using
    >       PdfStamper...
    >
    >       Thank you for the reply!
    >
    >       I'm currently hired as a consultant by the Swedish Election Authority
    >       and we're about to switch to using iText for all the reports produced
    >       here (ballot papers, election results etc) from FOP. We want to use a
    >       template (produced in Adobe InDesign for example) and use iText to
    >       add
    >       the dynamic parts. So could just give me a clue to where to start
    >       looking in the code/API, and maybe I can give it a shot.
    >
    >       Christer
    >
    >       Paulo Soares wrote:
    >
    >>  The tools are there and are used with external form field fonts.
    >       To use
    >>  it for the content shouldn't be too difficult but I haven't thought
    >>  about it.
    >>
    >>  Best Regards,
    >>  Paulo Soares
    >>
    >>       -----Original Message-----
    >>       *From:  * [EMAIL PROTECTED]
    >>       [SMTP:[EMAIL PROTECTED] On
    >       Behalf Of*
    >>       Christer Sandberg
    >>
    >>       *Sent:  * Wednesday, February 04, 2004 14:30
    >>       *To:    * [EMAIL PROTECTED]
    >>       *Subject:       * [iText-questions] Embedded fonts when using
    >>       PdfStamper...
    >>
    >>       Hi, I was just wondering if it's possible to use or change
    >       existing
    >>       fonts when using PdfStamper to add content to an already
    >       existing
    >>       PDF?
    >>       Let's assume for this question that the font is 100%
    >       embedded and
    >>       sub.
    >>
    >>       Thanks
    >>       Christer
    >>
    >>
    >>
    >>       -------------------------------------------------------
    >>       The SF.Net email is sponsored by EclipseCon 2004
    >>       Premiere Conference on Open Tools Development and Integration
    >>       See the breadth of Eclipse activity. February 3-5 in
    >       Anaheim, CA.
    >>       http://www.eclipsecon.org/osdn
    >>       _______________________________________________
    >>       iText-questions mailing list
    >>       [EMAIL PROTECTED]
    >>       https://lists.sourceforge.net/lists/listinfo/itext-questions
    >>
    >
    >

Reply via email to