Jose Novacho created PDFBOX-3890:

             Summary: The operator Tz is not available when creating new PDF 
using PDPageContentStream
                 Key: PDFBOX-3890
             Project: PDFBox
          Issue Type: Bug
          Components: PDModel
    Affects Versions: 2.0.7
            Reporter: Jose Novacho

When creating new PDF file using the _PDPageContentStream_ there is no option 
to set horizontal text spacing. The horizontal text spacing operator (Tz) is 
implemented in 
_org.apache.pdfbox.contentstream.operator.text.SetTextHorizontalScaling_ but 
that's not possible to use when creating new PDF.

Minimal working example:

PDDocument document = new PDDocument();
PDPage page = new PDPage();
document.addPage( page );

PDFont font = PDType1Font.HELVETICA_BOLD;
PDPageContentStream contentStream = new PDPageContentStream(document, page);

contentStream.setFont( font, 12 );
contentStream.moveTextPositionByAmount( 100, 700 );
contentStream.drawString( "Hello World" );
contentStream.close(); "Hello World.pdf");

The workaround at this moment is to use 
_PDPageContentStream.appendRawCommands("50 Tz");_
But this method is deprecated.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to