fpdi

Using Chinese fonts in TCPDF and FPDI. Encoding problems

僤鯓⒐⒋嵵緔 提交于 2020-01-17 11:15:35
问题 I am writing a script that generates Chinese character worksheets (so students can generate and practice writing) The script is passed a 15 character string from a form in index.php. The string is then exploded into an array of 15 elements (each a Chinese character). The problem arises when I want to use the Write() function to populate the file with these characters, I've used the input to pick appropiate images without any problems but now it's the encoding of the fonts that gives me a hard

Editing password protected pdfs with fpdi

﹥>﹥吖頭↗ 提交于 2020-01-15 01:24:07
问题 I've been trying to add a watermark to a password protected pdf (protect to write only) with fpdf and fpdi. It works on normal pdfs but when it is password protected it gives this error: FPDF error: This document (upd/509ae4a4044df9a43e03e09b4cf772b0.pdf) probably uses a compression technique which is not supported by the free parser shipped with FPDI. It makes sense that it isn't possible to write on the document but while searching I've seen similar problems getting resolved. Thanks in

FPDF+FPDI autoprint

不打扰是莪最后的温柔 提交于 2020-01-06 06:47:10
问题 I need to import pdf file into fpdf and print it silently . I use fpdi extension to load existing pdf, but I have no idea how to autoprint it. This is how autoprint in fpdf works - 2 additional classes around fpdf (from their examples). require('lib/fpdf/fpdf.php'); require('lib/fpdi-1.6.1/fpdi.php'); class PDF_JavaScript extends FPDF { protected $javascript; protected $n_js; function IncludeJS($script, $isUTF8=false) { if(!$isUTF8) $script=utf8_encode($script); $this->javascript=$script; }

Warning: fseek(): stream does not support seeking with FPDI

核能气质少年 提交于 2019-12-24 18:45:00
问题 I tried to look at similar posts but nothing seems to work. This is my code: <?php setlocale(LC_ALL, 'it_IT'); require_once('lib/fpdf/fpdf.php'); require_once('lib/fpdi/fpdi.php'); require_once('lib/phpmailer/class.phpmailer.php'); $mysqli = new mysqli("localhost", "user", "psw", "db"); if ($mysqli->connect_errno) { printf("Connect failed: %s\n", $mysqli->connect_error); exit(); } $nome = $_POST[nome]; $email = $_POST[email]; $importo = intval($_POST[importo]); $telefono = intval($_POST

Merging PDF files with PHP/FPDI

◇◆丶佛笑我妖孽 提交于 2019-12-21 21:40:43
问题 i am trying to merge two files using FPDI the error i get is:'TCPDF ERROR: File is encrypted!', however, the files are not encrypted, at least the files are printable, viewable etc and no password is required. i want to merge two files: http://www.nps.org.au/__data/cmi_pdfs/CMI7412.pdf http://www.nps.org.au/__data/cmi_pdfs/CMI6656.pdf after i copy the files to the server and store the file names in array ($files) that has the absolute file paths, my code is: if (count ($files) > 0 ) { $pdf =

TCPDF ERROR: Unable to find object (8, 0) at expected location

妖精的绣舞 提交于 2019-12-18 17:05:22
问题 I am getting an error while deleting a page from an scanned pdf using TCPDF & FPDI. Other pdf are working fine. ERROR: Unable to find object (8, 0) at expected location 回答1: Your file might be corrupted. Some scanners will produce corrupted PDF's, But nothing to worry there. You can recreate pdf if you are using linux with shell_exec function pdf_recreate($f) { rename($f,str_replace('.pdf','_.pdf',$f)); $fileArray=array(str_replace('.pdf','_.pdf',$f)); $outputName=$f; $cmd = "gs -q -dNOPAUSE

How to set encoding in PHP FPDI library

无人久伴 提交于 2019-12-17 19:48:51
问题 How to set UTF-8 encoding in php library named FPDI? Here's library: https://www.setasign.com/products/fpdi/manual/ The code: $pdf = new Fpdi(); $pdf->AddPage(); $pdf->setSourceFile('PdfDocument.pdf'); $tplIdx = $pdf->importPage(1); $pdf->useTemplate($tplIdx, 10, 10, 100); $pdf->SetFont('Helvetica'); $pdf->SetTextColor(255, 0, 0); $pdf->SetXY(30, 30); $pdf->Write(0, 'Zażółcić gęślą jaźń'); $pdf->Output(); [SOLUTION] FIRST: I had to add new font with proper letters $pdf->AddFont('DejaVu','',

PHP and importing pdf with forms

一世执手 提交于 2019-12-13 04:41:54
问题 I'm having trouble importing an existing pdf file with forms (text fields, radio buttons...) with some php libraries like TCPDF, FPDI and PDFlib. When I import pdf file with forms, do some text print on it, save it, but the output pdf file does not contain forms anymore. is there a way to do this without loosing forms! please help tnx 回答1: try mpdf see the example 来源: https://stackoverflow.com/questions/8501117/php-and-importing-pdf-with-forms

Can TCPDF / FPDI accept PDF as string?

半世苍凉 提交于 2019-12-12 14:43:14
问题 Is it possible to feed TCPDF or FPDI PDFs as a string? I have an incoming array of PDFs as strings, and I can't write to disk. I wasn't able to find anything in the documentation about this. If not, is there an efficient way to store/read these PDFs from memory or as objects? as to feed them to FPDI? 回答1: FPDI does not accept strings, but TCPDI, which I just released, has a setSourceData() method in addition to FDPI's setSourceFile() , as I happened to have the exact same requirement. TCPDI

using FPDF and FPDI

人走茶凉 提交于 2019-12-11 02:55:41
问题 the root of my website is "/var/www/PDFBuilder". I have 2 folders "fpdf17" and "fpdi142" and i've unzipper a file called "fpdf_tpl.php" in the "fpdf17" folder. This is my code: error_reporting(E_ALL); ini_set('display_errors', '1'); define('FPDF_FONTPATH','/var/www/PDFBuilder/fpdf17/'); require('/var/www/PDFBuilder/fpdf17/fpdf.php'); include('/var/www/PDFBuilder/fpdi142/fpdi.php'); When I try to open my website, this is the output I get: Warning: require_once(fpdf_tpl.php): failed to open