0

PDF Clown を使用して PDF ファイルに書き込むときに行をスキップするにはどうすればよいですか? IntelliJで使用しています。

私はそれをpdfファイルへの非常に基本的なテキストの書き込みに使用しています.行をスキップする方法についての指示がないことは想像しがたいです.

どんな助けでも大歓迎です。

// Create a document and add a page to it
    try {

        // 1. Instantiate a new PDF document!
        Document document = new File().getDocument();

        // 2. Add a page to the document!
        Page page = new Page(document); // Instantiates the page inside the document context.
        document.getPages().add(page); // Puts the page in the pages collection (you may choose an arbitrary position).

        // 3. Create a content composer for the page!
        PrimitiveComposer composer = new PrimitiveComposer(page);

        // 4. Add contents through the composer!
        composer.setFont(new StandardType1Font(document, StandardType1Font.FamilyEnum.Courier, true, false), 32);
        composer.showText("Hello World!", new Point2D.Double(32, 48));

        // 5. Flush the contents into the page!
        composer.flush();

        // 6. Save the document!
        document.getFile().save(job.getUpdateFileLocalDir() + "/pdfclown.pdf" , SerializationModeEnum.Standard);

    } catch (Exception e) {
        System.out.println("Exception is: ");
    }
4

1 に答える 1