DryCreations / pdfproject

Adapting starter code that uses itext7, into a program that can draw onto pdfs, and export files to pdf
1 stars 3 forks source link

Action 28 - Create a canvas to display a pdf document #23

Closed DryCreations closed 3 years ago

DryCreations commented 3 years ago

This will display a pdf in the format we discussed, currently it loads in a hardcoded filename "test_pdf.pdf" then displays it.

The viewbox consists of a VBox, with a Canvas inside. The VBox background is set to an image of the pdf, the canvas will allow us to draw on top of the pdf to export later. To draw on the canvas, you need to access the GraphicsContext from the page you want to edit. The pages array inside of app, contains individual pages, each with their own graphics context. This allows us to swap out whichever pdf page we want to display easily as each page is initialized with it's own node and graphics context we can switch between, or display elsewhere in the UI.

DryCreations commented 3 years ago

Screenshot as evidence of completion:

image