Skip to content
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

Docx read with images #1312

Open
rubjewa opened this issue Mar 14, 2018 · 8 comments
Open

Docx read with images #1312

rubjewa opened this issue Mar 14, 2018 · 8 comments

Comments

@rubjewa
Copy link

rubjewa commented Mar 14, 2018

When using phpword to read a word file without images, i dont run into any problems.
As soon as it contains an image i get the error:

DOMXPath::query(): Undefined namespace prefix (View: C:\xampp\htdocs\App\resources\views\pages\wordconvert.blade.php)

My code for running PhpWord:

<?php
  require_once base_path('vendor/autoload.php');
  
  /* Filename */
  $fileheader = 'test';
  
  $phpWord = \PhpOffice\PhpWord\IOFactory::load(storage_path('app/uploaded/files/'. $fileheader .'.docx'));
  $htmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'HTML');
  $htmlWriter->save(storage_path('app/uploaded/convert/'. $fileheader .'.html'));
@troosan
Copy link
Contributor

troosan commented Mar 17, 2018

I guess this is linked to #464.
Recent Word documents store images as w:drawing instead of w:pict

@jigneshpotenza
Copy link

jigneshpotenza commented May 2, 2018

Hello,
I have used PHPWord for converting docx file to html and pdf, But when I convert docx file with images in it, images are getting removed after conversion. I took a reference of "Sample_11_ReadWord2007.php". Please help me on this, urgenlty.

I have attached my sample docx file
demo.docx

Thanks in advance!

@mynukeviet
Copy link

Me too!

@troosan troosan pinned this issue Jan 21, 2019
@troosan troosan unpinned this issue Jan 21, 2019
@adam-godfrey
Copy link

This still hasn't been fixed in version 0.16

@raj-uimatic
Copy link

any updates on Images not getting displayed in .docx to .pdf conversion? I am still facing the issue with version 0.16

@dhirajpatra
Copy link

PHPWord can't read images from docx

@ch-dani
Copy link

ch-dani commented Dec 30, 2021

i ran into the same issue. Is there any tool or package or library in Laravel that can read images from docs.
I actually want to convert .docs file containing images and tables to PDF. Any help would be highly appreciated. Thanks.

@mohammedsiraj
Copy link

i had the same problem does any one got any solution for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

9 participants