From 74b317f858641461289bcc0eafae71ddef37e347 Mon Sep 17 00:00:00 2001 From: Brian Manning <bdmanning@ucsd.edu> Date: Wed, 20 Apr 2016 11:17:23 -0700 Subject: [PATCH] renamed: fpdfdemo -> fpdf_demo --- fpdf_demo | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ fpdfdemo | 77 --------------------------------------------------------------- 2 files changed, 77 insertions(+), 77 deletions(-) create mode 100755 fpdf_demo delete mode 100755 fpdfdemo diff --git a/fpdf_demo b/fpdf_demo new file mode 100755 index 0000000..dabef20 --- /dev/null +++ b/fpdf_demo @@ -0,0 +1,77 @@ +#!/usr/bin/env php + +<?php +/** + * FILENAME: + * fpdfdemo + * + * DESCRIPTION: + * Demonstration of the FPDF PHP Library for generating PDF files + * + */ + +/** + * Links: + * - https://packagist.org/packages/itbz/fpdf + * - http://www.fpdf.org/ + * - http://www.fpdf.org/en/doc/index.php + * - http://www.fpdf.org/en/tutorial/index.php + * - http://www.fpdf.org/en/tutorial/tuto6.htm (Links and flowing text) + * - http://www.fpdf.org/en/script/index.php + * + * This script also requires FPDI to load PDF documents into memory + * - https://www.setasign.com/products/fpdi/about/ + * - https://www.setasign.com/products/fpdi/manual/#p-200 + * + * NOTE the line 'use fpdf\FPDF as FPDF;' needs to be added to the FPDI + * library, specifically in vendor/setasign/fpdi/fpdi_bridge.php, line 19, + * for FPDI to work +*/ + +$loader = require __DIR__ . '/vendor/autoload.php'; +$loader->register(); + +$pdf = new FPDI('p', 'mm', 'Letter'); + +// write out the contents of the first page +$pdf->AddPage(); +$topLink = $pdf->AddLink(); +$pdf->SetLink($topLink); +$pdf->SetFont('Arial', '', 20); +$pdf->SetFont('', 'U'); +$ssfLink = $pdf->AddLink(); +$pdf->Write(10, "Jump SSF for SHACK-10A", $ssfLink); +$pdf->SetFont(''); +$pdf->Ln(); +$pdf->Write(10, "This is some text on the first page; "); +$pdf->Ln(); +$pdf->Write(10, "Привет! Этот немного текста."); + +// load up the Site Summary Figure to go on page #2 +$ssfPageCount = $pdf->setSourceFile(__DIR__ . '/site_summary_figure.pdf'); + +print "Page count of site summary figure form is $ssfPageCount\n"; + +// import the SSF page +$ssfTemplate= $pdf->importPage(1); +print "Page size of site summary figure PDF is: "; +$ssfSize = $pdf->getTemplateSize($ssfTemplate); +print "{$ssfSize['w']} x {$ssfSize['h']}\n"; + +// add the SSF file to the 2nd page +$pdf->AddPage(); +$pdf->SetLink($ssfLink); +$pdf->useTemplate($ssfTemplate); +$pdf->SetFont('Helvetica'); +$pdf->SetXY(5,5); +$pdf->SetFont('', 'U'); +$pdf->Write(8, "Top", $topLink); +$pdf->SetFont(''); +$pdf->SetXY(40, 5); +$pdf->Write(8, " SSF: P771/SHACK-10A"); + +// destination, F = "local file"; filename; isUTF8 (boolean) +//$pdf->Output('F', 'output.pdf', TRUE); +$pdf->Output('output.pdf', 'F'); + +// vim: expandtab filetype=php shiftwidth=3 tabstop=3 diff --git a/fpdfdemo b/fpdfdemo deleted file mode 100755 index dabef20..0000000 --- a/fpdfdemo +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env php - -<?php -/** - * FILENAME: - * fpdfdemo - * - * DESCRIPTION: - * Demonstration of the FPDF PHP Library for generating PDF files - * - */ - -/** - * Links: - * - https://packagist.org/packages/itbz/fpdf - * - http://www.fpdf.org/ - * - http://www.fpdf.org/en/doc/index.php - * - http://www.fpdf.org/en/tutorial/index.php - * - http://www.fpdf.org/en/tutorial/tuto6.htm (Links and flowing text) - * - http://www.fpdf.org/en/script/index.php - * - * This script also requires FPDI to load PDF documents into memory - * - https://www.setasign.com/products/fpdi/about/ - * - https://www.setasign.com/products/fpdi/manual/#p-200 - * - * NOTE the line 'use fpdf\FPDF as FPDF;' needs to be added to the FPDI - * library, specifically in vendor/setasign/fpdi/fpdi_bridge.php, line 19, - * for FPDI to work -*/ - -$loader = require __DIR__ . '/vendor/autoload.php'; -$loader->register(); - -$pdf = new FPDI('p', 'mm', 'Letter'); - -// write out the contents of the first page -$pdf->AddPage(); -$topLink = $pdf->AddLink(); -$pdf->SetLink($topLink); -$pdf->SetFont('Arial', '', 20); -$pdf->SetFont('', 'U'); -$ssfLink = $pdf->AddLink(); -$pdf->Write(10, "Jump SSF for SHACK-10A", $ssfLink); -$pdf->SetFont(''); -$pdf->Ln(); -$pdf->Write(10, "This is some text on the first page; "); -$pdf->Ln(); -$pdf->Write(10, "Привет! Этот немного текста."); - -// load up the Site Summary Figure to go on page #2 -$ssfPageCount = $pdf->setSourceFile(__DIR__ . '/site_summary_figure.pdf'); - -print "Page count of site summary figure form is $ssfPageCount\n"; - -// import the SSF page -$ssfTemplate= $pdf->importPage(1); -print "Page size of site summary figure PDF is: "; -$ssfSize = $pdf->getTemplateSize($ssfTemplate); -print "{$ssfSize['w']} x {$ssfSize['h']}\n"; - -// add the SSF file to the 2nd page -$pdf->AddPage(); -$pdf->SetLink($ssfLink); -$pdf->useTemplate($ssfTemplate); -$pdf->SetFont('Helvetica'); -$pdf->SetXY(5,5); -$pdf->SetFont('', 'U'); -$pdf->Write(8, "Top", $topLink); -$pdf->SetFont(''); -$pdf->SetXY(40, 5); -$pdf->Write(8, " SSF: P771/SHACK-10A"); - -// destination, F = "local file"; filename; isUTF8 (boolean) -//$pdf->Output('F', 'output.pdf', TRUE); -$pdf->Output('output.pdf', 'F'); - -// vim: expandtab filetype=php shiftwidth=3 tabstop=3 -- 1.9.1