Задайте вопросы о том, как захватывать или конвертировать веб-страницы или HTML into изображения, CSV, PDF или DOCX документы, а также о том, как конвертировать видео into анимированные GIF с использованием нашего API.
We create docx documents with the following function:
require('grabzit/lib/GrabzItClient.class.php');
// require("grabzit/config.php");
$grabzIt = new GrabzItClient("...xxx...");
$grabzIt->HTMLtoDOCX("some content here");
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.$GLOBALS{TSFE}->id.'.docx"');
$GLOBALS['TSFE']->content = $grabzIt->SaveTo();
Документы saved but when a docx is opened Word shows " error when opening the document ..."
Что может быть не так?
Please can you go to this page: https://grabz.it/html-to-word-docx-api.aspx
Then create a capture with the HTML in the box and open the file.
Does the error occur?
Also it doesn't look like $GLOBALS['TSFE'] is being output into the response.
The example from the API page causes the same error. $GLOBALS['TSFE']->content outputs the content correctly intо saved docx so that the docx can be opened with wordpad correctly. Only MS Word causes this error.
you can try it here https://www.liesegang-partner.de/print/mustervertraege/unternehmenskauf/unternehmenskaufvertrag-share-deal-gmbh.html?doctype=word&attachment=1
What is the html you are converting? Maybe that is the issue.
see here as an example https://www.liesegang-partner.de/print/mustervertraege/unternehmenskauf/unternehmenskaufvertrag-share-deal-gmbh.html
We have identified what the issue is and will release a software fix soon.
The fix for this issue should be live in the next 30 minutes.
Perfect! Thx for your help!!