From 5e8f70d56a145f82f15955c198d4424a99d9fb72 Mon Sep 17 00:00:00 2001 From: Brian Manning Date: Wed, 27 Apr 2016 21:01:58 -0700 Subject: [PATCH] pdflib_demo: load SSF PDF into 2nd page for demo --- pdflib_demo | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/pdflib_demo b/pdflib_demo index 966b152..7d32386 100755 --- a/pdflib_demo +++ b/pdflib_demo @@ -14,6 +14,12 @@ Links: - https://www.pdflib.com/developer/technical-documentation/manuals/ - https://www.pdflib.com/pdflib-cookbook/browse-all-topics/ + - https://www.pdflib.com/pdflib-cookbook/general-programming/starter-basic/php-general-progamming-issues/ + - https://www.pdflib.com/en/pdflib-cookbook/block-handling-and-pps/linked-textblocks/php-linked-textblocks/ + - https://www.pdflib.com/pdflib-cookbook/interactive-elements/link-annotations/php-link-annotations/ + - https://www.pdflib.com/pdflib-cookbook/text-output/footnotes-in-text/footnotes-in-text/ + - https://www.pdflib.com/fileadmin/pdflib/Cookbook/pdf/footnotes_in_text.pdf + - https://www.pdflib.com/pdflib-cookbook/pdf-import/import-in-reverse-order/php-import-in-reverse-order/ */ @@ -47,17 +53,32 @@ try { $textOpts = "fontname={Helvetica} embedding fontsize=20 " . "encoding=unicode "; - $pdf->fit_textline("Jump to SSF for SHACK-10A", 20, 750, $textOpts); + $pdf->fit_textline("Jump to SSF for SHACK-10A", 20, 750, + $textOpts . " underline=true"); $pdf->fit_textline("This is some text on the first page; ", 20, 720, $textOpts); $pdf->fit_textline("Привет! Этот немного текста.", 20, 690, $textOpts); - // finish this page + // END PAGE 1 $pdf->end_page_ext(''); // START PAGE 2 //$pdf->begin_page_ext(612, 792, ''); - //$pdf->end_page_ext(''); + $ssfPDF = $pdf->open_pdi_document(__DIR__ . "/site_summary_figure.pdf", ''); + if ($ssfPDF == 0) + throw new Exception("Error: " . $p->get_errmsg()); + + $ssfPage = $pdf->open_pdi_page($ssfPDF, 1, ''); + $ssfWidth = $pdf->pcos_get_number($ssfPDF, "pages[0]/width"); + $ssfHeight = $pdf->pcos_get_number($ssfPDF, "pages[0]/height"); + + $pdf->begin_page_ext($ssfWidth, $ssfHeight, ''); + + $pdf->fit_pdi_page($ssfPage, 0, 0, ''); + $pdf->close_pdi_page($ssfPage); + $pdf->close_pdi_document($ssfPDF); + // END PAGE 2 + $pdf->end_page_ext(''); // close the document $pdf->end_document(''); -- 1.9.1