Hello,
I am trying to add watermark to the pdf file but getting an Internal server error or The site can't be reached error
for some Pdf file it is working fine but for some, it throws an error. please help me out this.
Thanks.
Hello,
I am trying to add watermark to the pdf file but getting an Internal server error or The site can't be reached error
for some Pdf file it is working fine but for some, it throws an error. please help me out this.
Thanks.
Hello,
We recommend you to check your server logs, the reason of generic errors such as 'Internal server error' must be added to a log. Maybe you are getting some timeout or you don't have read access to the files. The problem 'The site can't be reached error' doesn't come from phpdocx, please check your server log to know the source of it.
We also recommend you to test the included samples using the PHP CLI mode and with local files, to know if the problem is related to remote access or the server itself.
Regards.
I have downloaded Advanced 7.5 Namespace version and I did not change anything but the problem is some PDF file working properly and some are not throwing errors. I don't know what the problem is but I noticed one thing during this process is that some files have scanned contain maybe that could be the problem.
Hello,
The dev team has run all tests of PDF watermarks and everything is working correctly.
If you send to contact[at]phpdocx.com one PDF and one image that returns the error they'll check them on our test servers.
Regards.
Ok, I will send you the PDF file which throws an error to me. You will get an email from
Hello,
The problem is that the PDF is corrupted. Although some PDF viewers can open it, the document has internal problems. If you check the document, you get this information:
Entity: line 9: parser error : PCDATA invalid Char value 23
<pdf:Creator></pdf:Creator>
^
Entity: line 11: parser error : PCDATA invalid Char value 5
<pdf:Title></pdf:Title>
^
Entity: line 12: parser error : PCDATA invalid Char value 3
<pdf:Author>€Ö!</pdf:Author>
^
Entity: line 13: parser error : PCDATA invalid Char value 11
<pdf:Producer>Ë}
•ùƒ</pdf:Producer>
^
Entity: line 13: parser error : PCDATA invalid Char value 3
<pdf:Producer>Ë}
•ùƒ</pdf:Producer>
^
Entity: line 13: parser error : PCDATA invalid Char value 1
<pdf:Producer>Ë}
•ùƒ</pdf:Producer>
^
Entity: line 13: parser error : PCDATA invalid Char value 3
<pdf:Producer>Ë}
•ùƒ</pdf:Producer>
^
Entity: line 23: parser error : PCDATA invalid Char value 5
<rdf:li xml:lang='x-default'></rdf:li>
^
Entity: line 26: parser error : PCDATA invalid Char value 3
<xap:Author>€Ö!</xap:Author>
^
Entity: line 34: parser error : PCDATA invalid Char value 5
<dc:title></dc:title>
^
Entity: line 35: parser error : PCDATA invalid Char value 3
<dc:creator>€Ö!</dc:creator>
If you repair it:
pdftocairo -pdf Keightley_1963.pdf Keightley_1963_repaired.pdf
the watermark is added perfectly.
Regards.
Hello,
I handled earlier issues but now I am facing this TCPDF_PARSER ERROR: decodeFilterFlateDecode: invalid code issue can you tell me what is wrong with my code or what I should do to fix this issue. because I need to fix it on urgent basis.
Hello,
It seems you are trying to change an encrypted document. Encrypted PDFs (as encrypted DOCX) can't be changed, as they are encrypted and they aren't readable PDFs but another kind of files (binary files with special containers). You need to decrypt the documents (knowing the password previously) before adding a watermark or doing any other change.
Regards.
Hello,
can you please tell me how can I detect whether it is encrypted or binary kind of document.
Thanks
Hello,
phpdocx doesn't include a method to detect if a PDF is encrypted or not, on https://www.phpdocx.com/documentation/api-documentation you can see all available methods. Anyway, as it's throwing an exception you could catch it or use Fileinfo from PHP (http://php.net/manual/en/book.fileinfo.php) to get the mime-type of files.
Regards.