Hi, Here is what I have managed untill now:
1. There are some functions/parameters used by FPDI and not included in
3.0.003 version of TCPDF - footerlen parameter and pushaders function. For
now I have just commented them out (don't know what it means for footer
:-)
2. I have set class PDF to extend FPDI class. Probably this is not the
best solution but my programming knowledge is pretty limited so...
a) I have modified tcpdf to have "function TCPDF" instead of __construct
b) in pdfprint.php I have included fpdi.php and set
class Pdf extends FPDI
{
function Pdf($map, $printScale, $orientation, $units, $format,
$pdfSettings, $prefmap=true)
{
//parent::__construct($orientation,$units,$format,true);
$this->TCPDF($orientation,$units,$format,true);
....
....
Then I had the problem getting "cannot access protected property" error
for every PDF class variable. After defining all the variables like:
var $prefmap;
var $pdfSettings;
var $defaultFontType;
var $defaultFontSize;
var $margin;
var $xminM;
var $yminM;
var $xmaxM;
var $ymaxM;
var $topLineDelta;
var $topLineY;
var $botLineY;
var $redFactor;
...the rest for reference map but I don't use it...
...it went fine. Why is that? I don't know..
c) in printpdf.php I added:
$this->setSourceFile('PDFDocument.pdf');
// import page 1
$tplIdx = $this->importPage(1);
// use the imported page and place it at point 10,10 with a width of 100
mm
$this->useTemplate($tplIdx, 10, 10, 100);
and I got map with legend displayed in a predefined PDFDocument.pdf.
Unfortunatelly the text from pdf template is left aligned (centrally
aligned in template pdf), some other template text is also put in a wrong
location (compared to its original location in pdf template), etc. I
suppose some things I have to learn/configure and some are even not
possible...
That's all for now except one little question:
Is the legend text somehow limited in height? I have a legend text that is
pretty long and after wirting to pdf, it gets overlapped by another legend
text. The result is pretty bad:
regards, dejan
[EMAIL PROTECTED] wrote on 14.11.2008 13:47:25:
> Those are bad news unfortunatelly. But I suppose the newest FPDI version
> can work with TCPDF 3.x, they didn't say it doesn't. So maybe I could
try.
> But since my object programming knowledge is not so good, I have been
> struggling with this for hours.
>
> Here is what I have found untill now:
>
> FPDI is using a kind of bridge class for remapping TCPDF to FPDF. So if
> you load TCPDF, then bridge class extends TCPDF (the trick is to remap
to
> FPDF again by setting "class FPDF extends PDF") and then FPDF_TPL
extends
> bridge class. This way, you can use one class for both TCPDF and FPDF.
>
> Now, how to implement p.mapper PDF class into all this? I have thought
> about setting bridge class to extend PDF class instead of TCPDF class,
> something like:
>
> FPDI class
> |
> FPDF_TPL class
> |
> bridge class
> |
> p.mapper PDF class
> |
> TCPDF class
>
> but I don't know if this is the right way. If I include
>
> require_once('tcpdf.php');
> require_once('fpdi.php');
>
> in pdfprint.php then bridge class cannot extend PDF class because it is
> not defined yet...
>
> Anyway, I am pretty weak on this but I suppose the solution is simple.
If
> you point me to right direction, I am sure I can try using FPDI with
TCPDF
> versioin3.x and if/when I make it work I can write a short Howto so
maybe
> someone else can benefit :-)
>
> thanks very much
>
> regards, dejan
>
> "Armin Burger" <[EMAIL PROTECTED]> wrote on 14.11.2008 13:16:16:
>
> > I tried to use TCPDF 4 instead of the 3.x I placed under p.mapper dev.
> > It worked in most cases but for a layer with lots of classes the PDF
> > print created an unvalid PDF, without any chance to know where it
> > failed. With TCPDF 3 it worked fine however.
> >
> > armin
> >
> >
> > On Fri, Nov 14, 2008 at 9:58 AM, <[EMAIL PROTECTED]> wrote:
> > >
> > > Thanks Armin, you made me happy for the end of the week :-)
> > >
> > > I have successfully used your newest printpdf.php with the newest
> TCPDF
> > > version 4.2.009. Now I have to try using FPDI with all this ... I
hope
> I'll
> > > be able to do it alone
> > >
> > > regards, dejan
> > >
> > > Armin Burger <[EMAIL PROTECTED]> wrote on 13.11.2008 21:58:14:
> > >
> > >> For the actual dev version I replaced the odler TCPDF with a newer
> > >> version (something 3.x). It worked, I just noticed some offset of
the
> > >> text towards the legend icons in the printed legend. I haven't
tried
> to
> > >> identify why. Maybe it's just a small adjustment necessary. So you
> could
> > >> use a newer version and try your luck.
> > >>
> > >> AFAIR it was necessary to modify 1 or 2 entries in the config for
> TCPDF
> > >> to work without absolute paths. Just compare the original and my
> > >> modified one.
> > >>
> > >> Armin
> > >>
> > >> On 13/11/2008 11:18, [EMAIL PROTECTED] wrote:
> > >> > I have tried using the newest TCPDF version instead of p.mapper
one
> and
> > >> > it
> > >> > works!
> > >> >
> > >> > Now, do I have to include this new TCPDF version in p.mapper? Can
I
> do
> > >> > it
> > >> > at all? Will p.mapper support this and which changes have to be
> done?
> > >> >
> > >> > regards, dejan
> > >> >
> > >> > [EMAIL PROTECTED] wrote on 13.11.2008 11:02:14:
> > >> >
> > >> >> Hi,
> > >> >>
> > >> >> The recent version of FPDI supports TCPDF. So I have tried the
> > >> > following,
> > >> >> just for the test:
> > >> >>
> > >> >> - downloaded FPDI-1.2.1 and FPDF TPL-1.1.2
> > >> >> - put everything to an example web accessible folder, together
> with all
> > >> >> the content from pmapper/incphp/print folder
> > >> >> - made a test php file like this:
> > >> >>
> > >> >> <?php
> > >> >> require_once('tcpdf.php');
> > >> >> require_once('fpdi.php');
> > >> >>
> > >> >> // initiate FPDI
> > >> >> $pdf =& new FPDI();
> > >> >>
> > >> >> // add a page
> > >> >> $pdf->AddPage();
> > >> >> // set the sourcefile
> > >> >> $pdf->setSourceFile('PDFDocument.pdf');
> > >> >> // import page 1
> > >> >> $tplIdx = $pdf->importPage(1);
> > >> >> // use the imported page and place it at point 10,10 with a
width
> of
> > >> >> 100
> > >> >
> > >> >> mm
> > >> >> $pdf->useTemplate($tplIdx, 10, 10, 100);
> > >> >> // now write some text above the imported page
> > >> >> $pdf->SetFont('arial');
> > >> >> $pdf->SetTextColor(255,0,0);
> > >> >> $pdf->SetXY(25, 25);
> > >> >> $pdf->Write(0, "This is just a simple text");
> > >> >>
> > >> >> $pdf->Output('newpdf.pdf', 'D');
> > >> >>
> > >> >> But when I try to run it, I get "FPDF error: Cannot access
> protected
> > >> >> property FPDI:$fontlist / Undefined property: FPDI::$fontlist"
> error
> > >> >>
> > >> >> Do I have to try with another (newer) TCPDF version? Do I have
to
> > >> >> modify
> > >> >
> > >> >> something in p.mapper TCPDF version?
> > >> >>
> > >> >> thanks very much
> > >> >>
> > >> >> regards, dejan
> > >> >>
> > >> >
> > >> >
>
-------------------------------------------------------------------------
> > >> >> This SF.Net email is sponsored by the Moblin Your Move
Developer's
> > >> > challenge
> > >> >> Build the coolest Linux based applications with Moblin SDK & win
> great
> > >> > prizes
> > >> >> Grand prize is a trip for two to an Open Source event anywhere
in
> the
> > >> > world
> > >> >> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > >> >> _______________________________________________
> > >> >> pmapper-users mailing list
> > >> >> [email protected]
> > >> >> https://lists.sourceforge.net/lists/listinfo/pmapper-users
> > >> >
> > >> >
>
-------------------------------------------------------------------------
> > >> > This SF.Net email is sponsored by the Moblin Your Move
> > >> > Developer'schallenge
> > >> > Build the coolest Linux based applications with Moblin SDK & win
> > >> great prizes
> > >> > Grand prize is a trip for two to an Open Source event anywhere in
> the
> > >> > world
> > >> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > >> > _______________________________________________
> > >> > pmapper-users mailing list
> > >> > [email protected]
> > >> > https://lists.sourceforge.net/lists/listinfo/pmapper-users
> > >> >
> > >>
> > >
> >
> >
>
-------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> > Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the
> world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > _______________________________________________
> > pmapper-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/pmapper-users
>
-------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
> Build the coolest Linux based applications with Moblin SDK & win great
prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> pmapper-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pmapper-users
<<image/gif>>
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ pmapper-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pmapper-users
