Optionally, an area of the source page that should be embedded (defaults to entire page). Translate all drawings of the embedded page by (10, 200) units This method accepts threeĭifferent value types for the page parameter: TypeĬreate a new page and add it to the end of this documentĬreate a new page with the given dimensions and add it to the end of this documentĪdd the existing page to the end of this documentįor example: // page=undefined const newPage = pdfDoc.addPage() ▸ addPage( page?: PDFPage | ): PDFPageĪdd a page to the end of this document. See the JavaScript for Acrobat API Reference Define a function named "foo" that can be called in JavaScript Actions 'console.show() console.println("Hello World!") ' For example: // Show "Hello World!" in the console when the PDF is opened Used to define a function that can be referenced later in a JavaScriptĪction. The script can be used to perform some operation The supplied script is executed when theĭocument is opened. const pdfDoc await PDFDocument.create () const sourcePdfUrl ' const sourceBuffer await fetch (sourcePdfUrl).then ( (res) > res.arrayBuffer ()) const sourcePdfDoc await PDFDocument.load (sourceBuffer) const sourcePdfPage sourcePdfDoc. ▸ addJavaScript( name: string, script: string): voidĪdd JavaScript to this document. Whether or not this document is encrypted. The default word breaks used in PDFPage.drawText
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |