Инструменты для захвата и конвертирования Интернета
Интернет-сообщество GrabzIt

Документы docx вызывают только ошибку при открытии в Word

Задайте вопросы о том, как захватывать или конвертировать веб-страницы или 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 ..."

Что может быть не так?

Asked by Jens Liesegang on the 11th of November 2019

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?

Ответ от службы поддержки GrabzIt от 11 ноября 2019 г.

Also it doesn't look like $GLOBALS['TSFE'] is being output into the response.

Ответ от службы поддержки GrabzIt от 11 ноября 2019 г.

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.

Answered by Jens Liesegang on the 11th of November 2019

you can try it here https://www.liesegang-partner.de/print/mustervertraege/unternehmenskauf/unternehmenskaufvertrag-share-deal-gmbh.html?doctype=word&attachment=1

Answered by Jens Liesegang on the 11th of November 2019

What is the html you are converting? Maybe that is the issue.

Ответ от службы поддержки GrabzIt от 11 ноября 2019 г.

see here as an example https://www.liesegang-partner.de/print/mustervertraege/unternehmenskauf/unternehmenskaufvertrag-share-deal-gmbh.html

Answered by Jens Liesegang on the 11th of November 2019

We have identified what the issue is and will release a software fix soon.

Ответ от службы поддержки GrabzIt от 11 ноября 2019 г.

The fix for this issue should be live in the next 30 minutes.

Ответ от службы поддержки GrabzIt от 11 ноября 2019 г.

Perfect! Thx for your help!!

Answered by Jens Liesegang on the 11th of November 2019