Criar livreto PDF
Contents
[
Hide
]
Criar um livreto PDF
Use PdfFileEditor.makeBooklet reorganizar as páginas de um PDF existente em ordem de livreto.
Etapas
- Crie uma instância de
PdfFileEditor. - Chame
makeBookletcom o PDF de origem e o arquivo de saída. - Salve o documento do livreto.
- Se quiser verificar o status de retorno, use a variante que devolve booleano e trate um resultado falho.
Exemplo Java
public static void createPdfBooklet(Path inputFile, Path outputFile) {
PdfFileEditor bookletMaker = new PdfFileEditor();
bookletMaker.makeBooklet(inputFile.toString(), outputFile.toString());
}
public static void tryCreatePdfBooklet(Path inputFile, Path outputFile) {
PdfFileEditor bookletMaker = new PdfFileEditor();
if (!bookletMaker.makeBooklet(inputFile.toString(), outputFile.toString())) {
System.out.println("Failed to create booklet.");
}
}