We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi troosan, I am facing same error "Document cannot open because problems with the content" Location: Part: /word/document.xml line 2 column 2694.
$zip = new \PhpOffice\PhpWord\Shared\ZipArchive(); $setting = new \PhpOffice\PhpWord\Settings(); $setting->setOutputEscapingEnabled(true); //This is the main document in a .docx file. $fileToModify = 'word/document.xml'; //$file = "Full IB Diploma Predicted Score Form A-G.docx"; $temp_file = 'results/re'.date('Ymdhis').'.docx'; copy($file,$temp_file); if ($zip->open($temp_file) === TRUE) { //Read contents into memory $oldContents = $zip->getFromName($fileToModify); //echo $oldContents; $Contents = preg_replace($patterns, $replace, $oldContents); $Contents1 = preg_replace($patterns1, $replace1, $Contents); echo '<br><br>'.$Contents1; //Delete the old... $zip->deleteName($fileToModify); //Write the new... $zip->addFromString($fileToModify, $Contents1); //And write back to the filesystem. $return =$zip->close(); If ($return==TRUE){ echo "Success!"; } } else { echo 'failed'; }
I added Settings::setOutputEscapingEnabled(true); but stills same error.
Please help me
The text was updated successfully, but these errors were encountered:
I have the same problem, any solution?
Sorry, something went wrong.
solution?
No branches or pull requests
Hi troosan,
I am facing same error "Document cannot open because problems with the content"
Location: Part: /word/document.xml line 2 column 2694.
I added Settings::setOutputEscapingEnabled(true); but stills same error.
Please help me
![error](https://user-images.githubusercontent.com/34543883/46652201-11022700-cbab-11e8-8998-7d6ec4491b82.JPG)
The text was updated successfully, but these errors were encountered: