I spent the morning researching matters related to go-soudan.com.

1) How to unlock a PDF: I used Advanced PDF Password Recovery, which I have used before. I purchased the update. Although it was supposed to be a half-price offer, I was charged the full amount… orz
2) How to use FPDI
 The site structure was difficult to understand and caused me trouble, but I managed to install it.
 FPDI can be downloaded here. Both FPDI and FPDI_TPL are required. This time I used FPDI 1.2 and FPDF_TPL 1.1.1. Of course, FPDF is also required (here). I used v1.53.

To install it, first extract FPDI into the folder where you want to use it. Then extract the contents of FPDF and FPDF_TPL into that folder. It should look like this.

-rwxr-xr-x 1 nat nat 16290 Mar 28 2006 FAQ.htm
drwxr-xr-x 4 nat nat 136 Jan 3 00:54 decoders
drwxr-xr-x 49 nat nat 1666 Jan 23 2005 doc
drwxrwxrwx 33 nat nat 1122 Jan 4 11:32 font
-rwxr-xr-x 1 nat nat 14719 May 21 2007 fpdi.php
-rwxr-xr-x 1 nat nat 6093 Dec 31 2004 histo.htm
-rwxr-xr-x 1 nat nat 1009 Dec 31 2004 install.txt
drwxr-xr-x 28 nat nat 952 Jan 3 09:54 tutorial
-rwxr-xr-x 1 nat nat 2362 May 21 2007 wrapper_functions.php

For now, I created a sample and tried running it.

<?php
require(’fpdi.php’);

$pdf = new FPDI();

// Set the Source PDF file.
$pagecount = $pdf->setSourceFile(’TestDoc.pdf’);

// Page 1
$tplidx = $pdf->importPage(1, ‘/MediaBox’);

$pdf->addPage();
$pdf->useTemplate($tplidx, 0, 0, 0);

$pdf->AddFont(’Arial’,’’,’arial.php’);
$pdf->SetFont(’Arial’,’’,14.5);

// A4 is 210x297mm
// Drawing line 5mm interval for 297mm

$pdf->SetDrawColor(0,255,0);

for($i=1;$i<26;$i++){
$y0 = 57 + $i*6.15;
$pdf->Line(0,$y0,210,$y0);
$pdf->SetXY(54,$y0);
$pdf->Cell(50,0,”0000$y0″,0,0,’R’);
}

for($i=1;$i<18;$i++){
$y0 = 57 + $i*6.15;
$pdf->Line(0,$y0,210,$y0);
$pdf->SetXY(143,$y0);
$pdf->Cell(50,0,”$y0″,0,0,’R’);
}

// Page 2
$tplidx = $pdf->importPage(2, ‘/MediaBox’);

$pdf->addPage();
$pdf->useTemplate($tplidx, 0, 0, 0);
?>

 
At last, I reached the point where I could place text over an existing PDF.

Then I actually tried placing it over a Form A PDF. Japanese seems to work for now.
That is a relief. Now I only need to adjust the positioning so the text fits in the boxes….

At this point, I paused for the time being because I had to go out.

Related posts

Embedding Kanji Using MBFPDF

It went more smoothly than I expected. Procedure Copy the contents of the fpdf folder created when you extract the mbfpdf archive into the FPDF folder.…

2008-01-04

XDI Meeting

Today again, there was an XDI meeting from 8 a.m. For 4 hours in the morning, I led the presentation of a proposal for the specification,…

Identity · 2004-10-30