-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Saving to pdf error #407
Comments
Could you try it also with the Develop branch and by using dompdf? |
Thanks franzholz
And funnily it throws exactly the same error. |
Can you show the exact error message from the PHPWord Develop branch? |
Sure! Here it is:
|
The name 'zip:https://test1...' is confusing. This probably is no image file. What is the name of your DOCX file? Can you show us the file you have used? |
Thanks for your help Franz. Yes, "text1..." is the name of the docx file I generate 3 lines up. I cannot attach the resulting file (it only accepts PNG GIF or JPG). But I've ony made it a few lines long (add image, add table and generate) I've cut it to this: Without the following line it works:
Have also tried
None work, only the last one (starts without a "/") says PhpOffice\PhpWord\Element\Image->checkImage('home/hello/p...') instead of checkImage('zip:https://test15...') |
Could you write me the full sequence how you generate your DOCX file?
|
Sure: in the simplified version (which doesn't work either with that addImage line) it goes:
I've got the same issue exactly with tcpdf and dompdf so I think it's on the phpword side of things |
I have tried your steps. And it passes the error reported by you.
The folder assets must contain a subfolder img and this subfolder must contain the file frontpage1.jpg.
checkImage $source:
I do not get the strange "zip:https://test1..." file. You probably use another configuration. I do not know how you managed to get the ZIP file here instead of the image file name. |
:( Is there anything to configure elsewhere??
It's so frustrating! I'd like to avoid having to redevelop a parallel code only for pdf! |
The function addImage in your code calls AbstractContainer.php On my environment I cannot proceed to the creation of the ZIP archive of the file DOCX. I do not know why. Your
This function never returns. It hangs: I have found out, that there is a bug in PHP ZipArchive addFile It might take some time until I can continue. |
No idea, not sure how I could test that... |
I may know what's wrong: |
Hi Franz, |
The images are always read in as data in base64 format. Have a look into the file src/PhpWord/Element/Image.php . Yes, maybe you are facing the same PHP internal error with ZIPArchive. This is because your image data cannot be read from the archive DOCX file. If PHP ZipArchive's addFile function did fail, then you wiil fail to read it again. You should compare your PHP version with the PHP bug tracker. |
Hi guys, I'm having exactly the same problem as underfrog. The PHP version I'm using is 5.6.8 and I tried with both master and develop branches of DomPDF and PHPWord, without any luck. Has anyone resolved this before? |
Hi emepetres, |
Hi underfrog, I'm thinking I'm going to give a try to html2pdf and see what it can do. Thank you for your answer. |
Hello everyone, include_once 'Sample_Header.php'; Please send me the code. Please help me out from this problem Thank you Rajesh babu |
public function office_to_pdf($FilePath, $FilePathPdf)
the pdf is not same as docx and chartset is wrong, how to solve this problem? thanks in advance. |
That's worked for me
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Hi,
I'm creating a docx successfully.
However right after generating it I cannot create a pdf version with TCPDF.
Here's my code:
And here's my error stack:
It looks like it's trying to access images at zip:https://filename??
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: