Forum


Replies: 9   Views: 3132
Pdf watermark issue.
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by ajstern  · 31-01-2018 - 09:35

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.

Posted by admin  · 31-01-2018 - 12:12

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.

Posted by ajstern  · 31-01-2018 - 14:02

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.

Posted by admin  · 31-01-2018 - 16:59

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.

Posted by ajstern  · 01-02-2018 - 05:27

Ok, I will send you the PDF file which throws an error to me. You will get an email from 

Posted by admin  · 01-02-2018 - 07:02

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.

Posted by ajstern  · 08-02-2018 - 09:42

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.

Posted by admin  · 08-02-2018 - 11:43

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.

Posted by ajstern  · 08-02-2018 - 12:26

Hello, 

can you please tell me how can I detect whether it is encrypted or binary kind of document.

Thanks