Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

TCPDF ERROR: XObject "Template" doesn't exist #3

Closed
queirozfcom opened this issue Aug 20, 2014 · 2 comments
Closed

TCPDF ERROR: XObject "Template" doesn't exist #3

queirozfcom opened this issue Aug 20, 2014 · 2 comments

Comments

@queirozfcom
Copy link

Hello there Nicola.

I've used your software for some months and I had no trouble at all.

However, I've tried installing a project on my friend's machine (PHP 5.5 on Windows) and I can't output PDF because I keep getting this error message:

XObject "Template" doesn't exist

I have the exact same code on a Linux machine (but running on PHP 5.4) and this problem does not occur.

Do have any idea as to what could be happening?

Oh yes I forgot to mention. I'm using version 6.0.057 on Linux (PHP 5.4 - no errors here). I've tried the same version on Windows (PHP 5.5) and I've also trie dthe latest version (6.0.091) and I've had errors in both versions.

Thank you for having written such a useful piece of code and thank you for helping out!

@nicolaasuni
Copy link
Member

Please ask your questions and report bugs to SourceForge, this is just a clone repository:
http://www.sourceforge.net/projects/tcpdf

@suabo
Copy link

suabo commented Mar 6, 2020

I had the same error Message an it was after updating TCPDF. For me it was the Header() method, my custom one wasn't compatible with the new version.

I had to change this part at the end of my custom Header() method:


        if ($this->booklet AND (($this->page % 2) == 0)) {
            // adjust margins for booklet mode
            $dx = ($this->original_lMargin - $this->original_rMargin);
        }

to this:

        if (!$this->header_xobj_autoreset AND $this->booklet AND (($this->page % 2) == 0)) {
            // adjust margins for booklet mode
            $dx = ($this->original_lMargin - $this->original_rMargin);
        }

Hope this will help somebody updating TCPDF.

Since this is one of the first hits on google for me and there was nothing on stackoverflow i decided to give this hint here in this closed issue. Sorry for bothering @nicolaasuni =)
Thanks for putting the work into letting us install TCPDF via composer.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants