Once you create the PdfDocument object, you can use the object's methods to read from the loaded document. ![]() "Number of pages in sample_doc1.pdf is " + Get page count and display it on console output To read an existing PDF document, you need to create a PdfDocument object and then call its "load" method with the file pathname or a memory stream containing the PDF file. ![]() Screenshot 1: Text is rendered at default location using default font. Subsequent calls to the method will change this location to where the previous writeText() method had let off. When you begin writing text in this manner, text will be rendered on the top-left corner of the document. To create a new document, you create a PdfDocument object.ĭoc.writeText("Hello, World!") // automatically creates a blank pageĪfter you create a new PdfDocument object, the writeText() method will allow you write text on a page, which is created by default in the document. Creating Your First PDF Documentīefore you start writing new PDF elements, you need to first create a PDF document or load an existing document. ![]() It offers numerous methods for you to render PDF elements such as text, images, shapes, forms, watermarks, and annotations on to documents. ![]() It represents a PDF document and allows you to create, read, and enhance PDF documents. The PdfDocument is the main class in PDFOne Java.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |