How to create an empty PDF document using Java.
SolutionFollowing is an example program to create an empty PDF document using Java.
import java.io.IOException; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDPage; public class CreatingEmptyPdf { public static void main(String args[]) throws IOException { //Creating PDF document object PDDocument document = new PDDocument(); //Add an empty page to it document.addPage(new PDPage()); //Saving the document document.save("C:/pdfBox/BlankPdf.pdf"); System.out.println("PDF created"); //Closing the document document.close(); } }Result
java_apache_pdf_box
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4