Closed wingleungchoi closed 8 years ago
@boazsegev I send you an email about PDF file. Could you have a look on it? Please
I'm looking into this, I'll let you know what I find.
I found that at the end of the file is an html text that isn't PDF related.
Right after the last %%EOF marker is:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>
</title></head>
<body>
<form name="form1" method="post" action="PrintPDF.aspx?OrderNo=R800001602240028%2c&type=A4" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTQyNTgzNjAyNw9kFgICAw9kFgICAQ8WAh4JaW5uZXJodG1sBVxodHRwOi8vd3d3LnBmY2V4cHJlc3MuY29tLy9NYW5hZ2UvVXBGaWxlL1BpbnRMYWJlbC8vNjI0YWVhMmYtOTBmNy00YjdhLWJhNWMtNzRmZTA5MDY2NGI0LlpJUGRkU8G4qi0vhAYUAho7ybOeQS4PlTSmnWyqAfjeIFcilcs=" />
</div>
<div id="div">http://www.pfcexpress.com//Manage/UpFile/PintLabel//624aea2f-90f7-4b7a-ba5c-74fe090664b4.ZIP</div>
</form>
</body>
</html>
I'm not sure this isn't a valid PDF, although the error is ignored by other readers... I'll look into the standard to see if this is valid and I'll search for a good way to circumvent this - but this could be easier to solve on your side, it could be you're sending html
data right along with the file.
Can you let me know if it's your application generating the PDF and if you can remove the html from the end of the PDF?
In the PDF format, multiple %%EOF
markers might exist, so that CombinePDF is "correctly" attempting to parse the data after the last %%EOF
... If I change CombinePDF to silently fails (like some readers), some unexpected results might go unnoticed with no exception raised.
@boazsegev thank you so much for the active responses. I download the pdf from third-party website. when i use sublime to pdf.file and remove html part, the pdf image changes.
Can I ask where what site generated the file? because I think it might be better to fix the issue at the site then to have a developer library ignore PDF errors that might be critical in some cases...
...I'm still debating this, because this is a question of design rather then an error.
I released a new version with a fix.
I tested this on a bunch of PDFs and it doesn't affect valid PDF parsing... so I guess the compatibility fix should be okay.
I hope this works for you - please let me know.
Good luck!
@boazsegev thank you so much for the new version. It works prefect. Due to privacy, i will email about website.
Thank :-) I'm happy it's working :+1:
i try the following code.
got the following error
spec
I doubt the pdf_data is wrong or not supported yet.