kurent wrote:
That's the thing, bold font with verdana.ttf works if the format is just a
normal A4. I tried the verdanab.tff, but the problem persists.

No, it doesn't! See the attachments.

Tried using
itext version 1.3.1 and the newer 2.1.3 and the problem is the same.

Some proof please!
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

Attachment: landscape.pdf
Description: Adobe PDF document


import java.io.FileOutputStream;
import java.io.IOException;

import com.lowagie.text.*;
import com.lowagie.text.pdf.BaseFont;
import com.lowagie.text.pdf.PdfWriter;

/**
 * This example was written by Bruno Lowagie. It is part of the book 'iText in
 * Action' by Manning Publications. 
 * ISBN: 1932394796
 * http://www.1t3xt.com/docs/book.php 
 * http://www.manning.com/lowagie/
 */

public class LandscapeBoldExample {

        /**
         * Generates a PDF file with the text 'Hello World'. The page size is
         * LETTER; the orientation is Landscape.
         * 
         * @param args
         *            no arguments needed here
         */
        public static void main(String[] args) {
                // step 1: creation of a document-object
                Document document = new Document(PageSize.A4.rotate());
                try {
                        // step 2:
                        // we create a writer
                        PdfWriter.getInstance(
                        // that listens to the document
                                        document,
                                        // and directs a PDF-stream to a file
                                        new FileOutputStream("landscape.pdf"));
                        // step 3: we open the document
                        document.open();
                        // step 4: we add a paragraph to the document
                        Font font = new 
Font(BaseFont.createFont("c:/windows/fonts/verdana.ttf", BaseFont.WINANSI, 
BaseFont.EMBEDDED), 12);
                        Font fontb = new 
Font(BaseFont.createFont("c:/windows/fonts/verdanab.ttf", BaseFont.WINANSI, 
BaseFont.EMBEDDED), 12);
                        document.add(new Paragraph("Hello World", fontb));
                        document.add(new Paragraph("Hello World", font));
                } catch (DocumentException de) {
                        System.err.println(de.getMessage());
                } catch (IOException ioe) {
                        System.err.println(ioe.getMessage());
                }

                // step 5: we close the document
                document.close();
        }
}
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to