Skip to content

Docx read with images #1312

@rubjewa

Description

@rubjewa

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'));

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions