TCPDF ERROR: Please explicitly set action attribute path!
I have installed the PDF certificate creator. Student and admin get the error above after a quiz is taken for certificate or when generating a certificate.
I have disabled it for now. Thanks
3 years, 9 months ago
Ava
Member
okay please check if your have set a certificate template in course settings :
Wp-admin > LMS > All courses > (Edit a course)
Refer this screenshot: http://prntscr.com/nfsu4v
To check this further please share your site url , admin credentials in private reply .
3 years, 9 months ago
RMA
Spectator
This reply has been marked as private.
3 years, 9 months ago
Ava
Member
Okay, I have replicated the issue with a demo course and now I can see the error.
Can you please share the FTP credentials in private reply.
3 years, 9 months ago
RMA
Spectator
This reply has been marked as private.
3 years, 9 months ago
RMA
Spectator
This reply has been marked as private.
3 years, 9 months ago
logan
Member
Hello,
please share the screenshot of the issue. also it seems that you are using a corrupt file whic is why this appear is appeared. dont worry we will upload latest plugin. please confirm so that i can perform required action.
3 years, 9 months ago
RMA
Spectator
I have disable it so students can complete their work. please continue to fix the issue.
Thanks
3 years, 9 months ago
logan
Member
This reply has been marked as private.
3 years, 9 months ago
RMA
Spectator
Thank you. I have uploaded the new file at it appears to work.
I have not gotten the error.
3 years, 9 months ago
maximus
Member
Hello
Do you have any other issue related to this topic or we can close the topic?
3 years, 9 months ago
RMA
Spectator
This reply has been marked as private.
3 years, 9 months ago
logan
Member
Hello,
Please share the screenshot of the issue where is this appearing,
also I will need your FTP credentials in a private reply so that I can look into the codes.
if possible please ask your web host to share the PHP error log that would be really helpful to identify the issue.
3 years, 9 months ago
RMA
Spectator
This reply has been marked as private.
3 years, 9 months ago
logan
Member
This reply has been marked as private.
Viewing 15 posts — 1 through 15 (of 17 total)
Below are common error messages encountered when using PostGopher and the best way to resolve the issue
The uploaded file exceeds the upload_max_filesize directive in php.ini
This error is due to the limitation put in place by your hosting provider. Many providers set the maximum upload file size at 2MB and the PostGopher zip is 2.5MB. You can contact your hosting provider and request to increase your maximum upload file size
TCPDF ERROR: Please explicitly set action attribute path!
This error is occurring because your content on that page/post has an HTML form embedded as part of the content and this post does not have the action attribute set. It may be caused by a conflict with another plugin that supplies the form. We suggest you deactivate that plugin and give it a go to see if the error goes away.
TCPDF ERROR: Could not include font definition file: ...
This error means you are using a font not supported by PostGopher at the moment. Please change it or/and contact the customer happiness team to request it be added.
TCPDF ERROR: [Image] Unable to get the size of the image
This is down to the PHP configuration on the server. You need to get your hosting provider to enable fopen wrappers in PHP. They should know what that means!
Parse error: syntax error, unexpected ':'
This error occurs when your hosting is not running your site on PHP 5.6 or above. Please check with your hosting company.
AWeberAPIException: Type: NotFoundError; Msg : Object: None, name:
Once you have entered your Aweber Authorization code you must click SAVE. When the page refreshes, you can select a list from those in your account. This error code indicates that you have not done this.
Fatal Error undefined function mb_convert_encoding()
You need to ask your hosting company to insure that the mb string PHP module is installed. Normally it is but if you encounter this error … that is the reason!
cURL error 35: error:14077438:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert internal error
This error occurs when your hosting is not running your site on PHP 5.6 or above. Please check with your hosting company.
cURL error 7: couldn't connect to host
Please check with your hosting company to make sure that access to external domains is not restricted or that a firewall is not blocking access. Some hosts, such as Amazon AWS, do not allow certain plug-ins — and sadly Post Gopher gets caught in their net.
There was a problem with the HTML Signup Form - Could not find input buttons. Please try another HTML Form
For every optin form there must be at least the field to gather the email, and the SUBMIT button. Normally there is also the name field. An example is shown below. Note the
- <input name=»name»…. >
- <input name=»email»…. >
- <input type =»submit»…. >
<form action="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"> <input name="name" placeholder="Name" type="text"> <input name="email" placeholder="Email" type="text"> <input name="form_id" type="hidden" value="2"> <input type="submit" name="submit" value="submit"> </form><br>
Fatal error: require_once(): Failed opening required ‘/home/xxxxxxx/public_html/wp-content/plugins/postgopher/TCPDF/tcpdf.php’ (include_path=‘.:/usr/local/php71/pear’) in /home/xxxxxxxx/public_html/wp-content/plugins/postgopher/includes/class-post-gopher.php on line 191 The site is experiencing technical difficulties.
This is due to a file going missing. This can happen if the plugin did not install correctly. Please deactivate and then delete the Post Gopher plugin then re-install. If you then still get the same error, it is possible that an Anti Virus program on your server is removing it, so you need to speak to your hosting company to make sure this is not happening.
If you reinstall and find that Post Gopher works for a short while then fails again — this is a definite indicator that the hosting company Anti Virus program is removing it on a subsequent scan
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/xxxxxx/public_html/wp-content/plugins/postgopher/TCPDF/tcpdf.php on line 17782
Warning: Cannot modify header information - headers already sent by (output started at /home/xxxxxxxx/public_html/wp-content/plugins/postgopher/TCPDF/tcpdf.php:17782) in /home/insanelygood/public_html/wp-includes/functions.php on line 6029
Warning: Cannot modify header information - headers already sent by (output started at /home/insanelygood/public_html/wp-content/plugins/postgopher/TCPDF/tcpdf.php:17782) in /home/xxxxxxxxx/public_html/wp-admin/includes/misc.php on line 1252
Warning: Cannot modify header information - headers already sent by (output started at /home/insanelygood/public_html/wp-content/plugins/postgopher/TCPDF/tcpdf.php:17782) in /home/xxxxxxxx/public_html/wp-admin/admin-header.php on line 9
All or any of these implies that the server is set to development mode and not production. So not only do these warnings show but the whole PHP / WP setup will be slower than usual for being set this way. Warnings like these are only meant to be shown in development servers, so developers can get heads up about potential issues in future versions of PHP. So for example the warning shown is saying that this particular statement will be changing in a future version and so the developer will need to look at and make changes before then, which is usually 6-12 months in the future.
You should contact your hosting company and get your website in to production mode. Then a) these warning won’t show and b) your site will be faster and more secure.
Did this answer your question?
Thanks for the feedback
There was a problem submitting your feedback. Please try again later.
- Forum
- PHP
- Biblioth�ques et frameworks
- Symfony
- [2.x] Symfony et conversion PDF

Sujet :
Symfony PHP
-
10/04/2014, 00h40
#1
Futur Membre du Club
Symfony et conversion PDF
bonsoir � tous, je veux convertir le contenu de fichier.html.twig en PDF. j’ai utilis� le bundle TCPDF et lors de l’affichage m’affiche cette erreur:
TCPDF ERROR: Please explicitly set action attribute path!
Voici mon code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55public function printAction($id) { $em = $this->getDoctrine()->getManager(); $user = $em->getRepository('MonprojetBundle:Compte')->find($id); $emp=$em->getRepository('MonprojetBundle:Employe')->findOneByIdCpt($id); $pdf = $this->get('tcpdf'); // set document information $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor(''); $pdf->SetTitle('TCPDF Example'); $pdf->SetSubject('TCPDF Example'); $pdf->SetKeywords('TCPDF, example'); // remove default header/footer $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); // set default monospaced font $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); // set margins $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); // set auto page breaks $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); // set font $pdf->SetFont('times', '', 12); $pdf->AddPage(); // set some text to print /* $txt = <<<EOD TCPDF Example 1 Default page header and footer are disabled using setPrintHeader() and setPrintFooter() methods. EOD;*/ $html =$this->get('templating')->render('MonprojetBundle:Admini:apercu_employe.html.twig', array( 'user' => $user, 'emp' => $emp, )); $content=$html->getContent(); $pdf -> writeHTML($content); $pdf->Output('example_002.pdf', 'I'); return $this->redirect($this->generateUrl('homepage')); }
-
10/04/2014, 11h33
#2
Membre exp�riment�
C’est cool d’utiliser des bundles obscures non maintenu, mais mettre un lien vers ceux ci ca me semble la moindre des choses :]
C’est plus un probleme de la librairie qu’un probl�me symfony2
- Forum
- PHP
- Biblioth�ques et frameworks
- Symfony
- [2.x] Symfony et conversion PDF
Discussions similaires
-
R�ponses: 7
Dernier message: 29/03/2006, 17h35
-
R�ponses: 3
Dernier message: 03/02/2006, 10h29
-
R�ponses: 6
Dernier message: 30/09/2005, 18h00
-
R�ponses: 3
Dernier message: 06/04/2005, 15h41
-
R�ponses: 2
Dernier message: 07/03/2005, 16h29
Partager
Partager
-
Summary
-
Files
-
Reviews
-
Support
-
Code
-
Tickets ▾
- Bugs
- Patches
- Feature Requests
-
News
-
Discussion
-
Donate
Menu
▾
▴
Images from script in PDF
Created:
2009-08-24
Updated:
2012-10-09
-
Hi there,
I’m currently busy with a project where images outsite the webroot are used to create a HTML file (edited with FCKeditor). in FCKeditor I can read the files and see them in the editor. The images are called by a script: with this code: <img width=»400px» src=»../../../readfile.php?file=1/78.jpg» alt=»»>
But when I try to create a PDF with TCPDF I got this error:
TCPDF ERROR: [Image] No such file or directory inIt seems that the class doesn’t understand an image with is provided by a script.
Maybe I am doing something wrong an I hope someone can help me out with this.
Thanks in advance,
Frank
-
Try specifying the full path to the image, not the relative path.
-
Hi Bes,
Thanks for answering. I just tried it but unfortunatelly it didn’t work. I got the same message when I try to make a PDF from the HTML file.Some other options? Otherwise I have to copy the image first to a path inside the root and delete it after i made the PDF. But that is an security hole.
Thanks in advance.
Frank
-
Hi there,
I made some progress.
I made a very simple HTML code:
<img src=’http://www.domain.nl/test/test.jpg’>And i got the following error:
TCPDF ERROR: [Image] No such file or directory in ‘/home/admin/domains/domain.nl/public_html/test/tcpdf//test/test.jpg’
So the path extracted from the scr attribute is not right.
I changed the following code:
line 12310 en 12311 of tcpdf.php//$tag[‘attribute’][‘src’] = urldecode($tag[‘attribute’][‘src’]);
//$tag[‘attribute’][‘src’] = str_replace(K_PATH_URL, K_PATH_MAIN, $tag[‘attribute’][‘src’]);I just disabled them. Now it is working with a physical image within the webroot. I didn;’t test with an script yet but I think it wil work.
I noticed also that the SRC attribute of an IMG element has te be the first attribute. Otherwise it will not be recognized. FCKeditor put the width attribute before the SCR which causes errors.
Gr,
Frank-
A simpler solution is to manually set the K_PATH_MAIN and K_PATH_URL constants on config/tcpdf_config.php file.
-
Hi Nicola,
I tried that but I got some other errors because the script can’t find it’s own scripts anymore.
Thanks,
Frank
-
I was having the exact same problem Thanks for the solution
-
Hi Nicola,
These 2 lines:
$tag = urldecode($tag);
$tag = str_replace(K_PATH_URL, K_PATH_MAIN, $tag);make me trouble to use dynamic images inside HTMLCell.
The method Image() accepts HTTP URLs, but method writeHTMLCell() involves
those 2 lines.
Could you please add some decision before rewriting the src attribute?
Something like this:if( !array_key_exists(‘host’,parse_url($tag)) ) {
if (($tag == ‘/’) AND ($_SERVER != ‘/’)) {
$tag = $_SERVER.$tag;
}
$tag = urldecode($tag);
$tag = str_replace(K_PATH_URL, K_PATH_MAIN, $tag);
}Thanks,
Jozef
-
Hi Nicola,
These 2 lines:
$tag['attribute']['src'] = urldecode($tag['attribute']['src']); $tag['attribute']['src'] = str_replace(K_PATH_URL, K_PATH_MAIN, $tag['attribute']['src']);
make me trouble to use dynamic images inside HTMLCell.
<img src='[url]http://www.domain.com/test/getimage.php?id=1[/url]'>
The method Image() accepts HTTP URLs, but method writeHTMLCell() involves
those 2 lines.
Could you please add some decision before rewriting the src attribute?
Something like this:if( !array_key_exists('host',parse_url($tag['attribute']['src'])) ) { if (($tag['attribute']['src'][0] == '/') AND ($_SERVER['DOCUMENT_ROOT'] != '/')) { $tag['attribute']['src'] = $_SERVER['DOCUMENT_ROOT'].$tag['attribute']['src']; } $tag['attribute']['src'] = urldecode($tag['attribute']['src']); $tag['attribute']['src'] = str_replace(K_PATH_URL, K_PATH_MAIN, $tag['attribute']['src']); }Thanks,
Jozef
-
ufff, sorry, what the mess caused the BBCode. Please ignore 9-th post.
-
I do not understand where your problem is.
Can you please provide an example of html code you are using and the settings
of K_PATH_URL, K_PATH_MAIN and $_SERVER ?
-
I want to use dynamic image from foreign domain (foreign server)
Therefore the SRC attribute must stay unchanged.
-
On TCPDF 5 the support for external images and dynamic images was improved.
-
Hi Nicola, thank you for version 5.
But i have still a problem with writeHTMLCell.-
external dynamic image works
-
external static image doesn’t work
http://www.domain.com/test//image.png»>
-
-
Please note the error on your second URL (consecutive double slashes). It
should be:
http://www.domain.com/test/image.pngAdditionally, the image tag must be self closing and width and height
parameters are mandatory:http://www.domain.com/test/image.png» width=»100″ height=»50″ />
-
The problem is in your code line 15617. Please change ‘query’ to ‘host’.
if (!isset($testscrtype['host']))
-
TCPDF seems working fine with both local and remote URL, dynamic or static.
If you are experiencing problems, probably you have an error on the K_PATH_URL
or K_PATH_MAIN configuration.
Please configure manually these values to the right value.
-
I am not able to configure it on localhost.
My test script is
http://localhost/projectpdf/tcpdftest/image.php
It is located in
C:developmentxampphtdocsprojectpdftcpdftestimage.php
TCPDF library is located in
C:developmentxampphtdocsprojectpdflibtcpdftcpdf.php
the URL of static image is
http://localhost/projectpdf/tcpdftest/image.png
located
C:developmentxampphtdocsprojectpdftcpdftestimage.pngYour str_replace code produces the absolute image path pointing to library
folder
C:developmentxampphtdocsprojectpdflibtcpdfimage.png
It is wrong.
How should i set K_PATH_URL and K_PATH_MAIN?
-
Edit the config/tcpdf_config.php file.
Comment the automatic calculation for the K_PATH_MAIN and K_PATH_URL and set
them as follow:define (‘K_PATH_MAIN’, ‘C:/development/xampp/htdocs/projectpdf/lib/tcpdf/’);
define (‘K_PATH_URL’, ‘http://localhost/projectpdf/lib/tcpdf/’);
-
Thank you Nicola. It works now. I had to correct the K_PATH_URL. I am a little
bit confused, i thought the K_PATH_URL is the root URL of web application, i
was wrong. What happens if i put TCPDF outside of htdocs?
Log in to post a comment.



