-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Template does not exist!' #3
Comments
I have some problem, |
I have exactly the same problem, how do I fix this?! Very annoying. Tried everything, seems like the problem doesn't persist in the older version but I can't use this version for other reasons. Please help! |
hello, |
It looks as though the version of FPDF_TPL included with FPDI 1.5 is not compatible with TCPDI. Please use the standalone version of FPDF_TPL (v1.2.3) for now - I'll look into the new version more closely and see if I can add support for it. You don't need any other parts of FPDI - just the standalone FPDF_TPL is sufficient. |
@pauln I have replaced version 1.5 with version 1.2.3. Same error. Do we need to change the extends FPDF TO extends TCPDF ? I did that as well and still same error. Is there a fix? I think there may be an error in importPage Function? I can't seem to figure it out. @crnm, did you find a solution? @bacu7, can you share a sample of your work-around? |
Hi @gismofx, as per my initial response to the issue you logged as pauln/tcpdi_parser#11, please either attach the troublesome PDF(s) here, or email them to me at tcpdi-samples at next.gen.nz so that I can investigate further. |
@pauln I've emailed you the files(PDF and php script) |
@gismofx It all seems to work fine for me, both using the PDF file you sent me and the Base64 data from the pastebin. Have you tried writing the submitted data (Base64 decoded) to a file to confirm that it's being submitted properly? If the data is being submitted (and Base64 decoded) correctly, can you please send me a zip of your full code (PDFMerge.php plus all TCPDF/FPDF_TPL/TCPDI/TCPDI parser etc files, preferably including whatever you're using to submit the PDF data to PDFMerge.php), so I can see if it's an incompatibility with a specific version of one of the libraries? |
@pauln , I've emailed in the full folder. It's a large attachment, please confirm receipt. I am able to submit the encoded data, decode it with PHP, re-encode it, and then echo the encoded string. My application can take that encoded data and make the PDF without a problem! I appreciate you looking into this. |
@gismofx, I received the file successfully. The copy of the code you sent me is attempting to use FPDF_TPL version 1.6.1 (bundled with FPDF); if you download the standalone version 1.2.3 from https://www.setasign.com/products/fpdi/downloads/#files (as per the TCPDI installation instructions) and put fpdf_tpl.php directly into the FPDF/tcpdf directory (so it sits alongside tcpdi.php and tcpdi_parser.php) and revert the require_once in tcpdi.php (to As above, I'll try to find time to look at compatibility with the newer versions of FPDF_TPL bundled with FPDF - but for now, the above should hopefully work. |
@pauln Thank you! I had the libraries mixed up! It's working correctly now on my end. I'll keep an eye out for when the new version is compatible. Also, I will happily test it when the time comes. |
Hi pauln, |
@jaspreetkaur, please don't hijack issues - your problem does not seem at all related to the issue being discussed here, so please use the "New issue" button to start a separate one. When you do so, please explain clearly what you've done and what's happening - and consider making your code available, as that will make it much easier to help you. |
I am trying to get the example you have here to work, but I get the following error:
Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Template does not exist!' in ... /tcpdf/fpdf_tpl.php:218 Stack trace: #0 ... tcpdf/tcpdi.php(244): FPDF_TPL->useTemplate(1, NULL, NULL, 0, 0) #1 TCPDI->useTemplate(1) #2 {main} thrown in ... /tcpdf/fpdf_tpl.php on line 218
I have tried with several pdf files, but I always get the same result.
I'm using the following versions:
tcpdf: 6.0.053
tcpdi: 1.0
tcpdi_parser: 1.0
fpdi: 1.5.1
Thank you in advance!
The text was updated successfully, but these errors were encountered: