Commit 5e8f70d56a145f82f15955c198d4424a99d9fb72

Authored by Brian Manning
1 parent 8abb8dc763

pdflib_demo: load SSF PDF into 2nd page for demo

Showing 1 changed file with 24 additions and 3 deletions Side-by-side Diff

... ... @@ -14,6 +14,12 @@
14 14 Links:
15 15 - https://www.pdflib.com/developer/technical-documentation/manuals/
16 16 - https://www.pdflib.com/pdflib-cookbook/browse-all-topics/
  17 + - https://www.pdflib.com/pdflib-cookbook/general-programming/starter-basic/php-general-progamming-issues/
  18 + - https://www.pdflib.com/en/pdflib-cookbook/block-handling-and-pps/linked-textblocks/php-linked-textblocks/
  19 + - https://www.pdflib.com/pdflib-cookbook/interactive-elements/link-annotations/php-link-annotations/
  20 + - https://www.pdflib.com/pdflib-cookbook/text-output/footnotes-in-text/footnotes-in-text/
  21 + - https://www.pdflib.com/fileadmin/pdflib/Cookbook/pdf/footnotes_in_text.pdf
  22 + - https://www.pdflib.com/pdflib-cookbook/pdf-import/import-in-reverse-order/php-import-in-reverse-order/
17 23  
18 24 */
19 25  
20 26  
21 27  
... ... @@ -47,17 +53,32 @@
47 53 $textOpts = "fontname={Helvetica} embedding fontsize=20 "
48 54 . "encoding=unicode ";
49 55  
50   - $pdf->fit_textline("Jump to SSF for SHACK-10A", 20, 750, $textOpts);
  56 + $pdf->fit_textline("Jump to SSF for SHACK-10A", 20, 750,
  57 + $textOpts . " underline=true");
51 58 $pdf->fit_textline("This is some text on the first page; ", 20, 720,
52 59 $textOpts);
53 60 $pdf->fit_textline("Привет! Этот немного текста.", 20, 690, $textOpts);
54 61  
55   - // finish this page
  62 + // END PAGE 1
56 63 $pdf->end_page_ext('');
57 64  
58 65 // START PAGE 2
59 66 //$pdf->begin_page_ext(612, 792, '');
60   - //$pdf->end_page_ext('');
  67 + $ssfPDF = $pdf->open_pdi_document(__DIR__ . "/site_summary_figure.pdf", '');
  68 + if ($ssfPDF == 0)
  69 + throw new Exception("Error: " . $p->get_errmsg());
  70 +
  71 + $ssfPage = $pdf->open_pdi_page($ssfPDF, 1, '');
  72 + $ssfWidth = $pdf->pcos_get_number($ssfPDF, "pages[0]/width");
  73 + $ssfHeight = $pdf->pcos_get_number($ssfPDF, "pages[0]/height");
  74 +
  75 + $pdf->begin_page_ext($ssfWidth, $ssfHeight, '');
  76 +
  77 + $pdf->fit_pdi_page($ssfPage, 0, 0, '');
  78 + $pdf->close_pdi_page($ssfPage);
  79 + $pdf->close_pdi_document($ssfPDF);
  80 + // END PAGE 2
  81 + $pdf->end_page_ext('');
61 82  
62 83 // close the document
63 84 $pdf->end_document('');