0

PDFの作成にCSharpとiTextSharpを使用しています。

これはテキストを配置する私のコードです:

        PdfContentByte cb = writer.DirectContent;
        cb.BeginText();
        cb.ShowTextAligned(PdfContentByte.ALIGN_LEFT, text, width, height, 0);
        cb.EndText();

を使用して新しいページを作成した後。

        doc.NewPage();

このように新しいページにテキストを配置しようとしてもうまくいきません:

        cb.BeginText();
        cb.ShowTextAligned(PdfContentByte.ALIGN_LEFT, text, width, height, 0);
        cb.EndText();

しかし、これは機能しています:

        ColumnText.ShowTextAligned(cb, Element.ALIGN_LEFT,
        new Phrase(Petrol[i], font), 451 + i * x, 684, 0)

cb.ShowTextAligned() が機能しない理由を誰かが説明できますか?

ありがとう。

4

0 に答える 0