is there a way to mirror the result of a tcpdf pdf or a given pdf-file?
I'm creating a pdf for printing with tcpdf. It's for printing on products. It's required to mirror the printout. I don't really want to change the full creation proccess to mirror (MirrorH) every single object. That would make it much more complicated.
Or is it possible to save the result in a php var to reopen it and mirror the pdf-result?
Best
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In fact having now tried it, it is easier to do this:
<?php$pdf->AddPage();$pdf->StartTransform();$pdf->MirrorH($pdf->getPageWidth()/2);// Your page here$pdf->AddPage();$pdf->StartTransform();$pdf->MirrorH($pdf->getPageWidth()/2);// Your page here?>
You are right that this seems to need doing at each new page, so perhaps you could extend the class to do this for you on each new page.
When I say Your page here - I mean do all the normal things you do to create your page - so $pdf->write() etc.
Last edit: Simon 2014-09-11
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
is there a way to mirror the result of a tcpdf pdf or a given pdf-file?
I'm creating a pdf for printing with tcpdf. It's for printing on products. It's required to mirror the printout. I don't really want to change the full creation proccess to mirror (MirrorH) every single object. That would make it much more complicated.
Or is it possible to save the result in a php var to reopen it and mirror the pdf-result?
Best
MirrorH should be fine and if you combine with translate should not require any further maths.
Something like:
Ah ok.
With "Your page here" you mean I need the pdf to mirror in another pdf-object?
Guess I have to mirror each page.
I'm not sure how to use my pdf there. I need to create a 2nd pdf object for the transformation?
In fact having now tried it, it is easier to do this:
You are right that this seems to need doing at each new page, so perhaps you could extend the class to do this for you on each new page.
When I say Your page here - I mean do all the normal things you do to create your page - so $pdf->write() etc.
Last edit: Simon 2014-09-11
Thank you. Its working really well.