PdfClown кажется очень хорошим, но как я могу пропустить строки при записи в pdf-файл? Я использую его в IntelliJ.PdfClown кажется очень хорошим, но как я могу пропустить строки при записи в pdf-файл?
Я использую его для простой записи текста в 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: ");
}
Что вы имеете в виду под "пропустить линии"? Вы запрашиваете текстовую упаковку? –
Я просто хочу написать несколько пустых строк для разделения текста, как завершена новая линия или возврат каретки? Или в этом отношении обертывание текста? Благодаря! – 65535