Tools to Capture and Convert the Web
GrabzIt's Online Community

How convert two column html document to .docx

Hi. I need to convert my Html page to .docx . I use GrabzIt('KEY').ConvertPage({'target': '#id', 'format': 'docx', 'download': 1, 'cache' : 0, 'filename' : 'filename, 'bheight' : -1, 'height' : -1, 'waitfor' : '#id'}).Create(); 

html is created from two-column table:

<table>

<tr>

<td>Content...</td>

<td>Content...</td>

</tr>

</table>

The .docx document is created but the first page is empty because of 'Section break' adding in the top of the first page of 'Word' document. How to avoid of empty first page? 

Asked by Dawie Harmse on Thursday, 3 October, 2019 09:15:13 AM

Hi,

If you are using the ConvertPage method it will convert whatever is in the page including any section breaks that have been defined.

If you just want to convert a table within the page, why don't you use the ConvertHTML method. Using a bit of JavaScript to select and pass the table as HTML to the method?

Answered by GrabzIt Support on Thursday, 3 October, 2019 09:19:51 AM

I didn't define any section breaks. My goal is to take some container with two-columns and convert it to .docx with all styles. And only one way works for this - to wrap all content to <table>. But for some reason my document begins from the second page on 'Word' 

Answered by Dawie Harmse on Thursday, 3 October, 2019 10:20:20 AM

Sorry, I misunderstood. Thanks for raising this issue with us. We have raised a case and we will look at it soon.

Answered by GrabzIt Support on Thursday, 3 October, 2019 10:29:04 AM

This issue should now be fixed.

Answered by GrabzIt Support on Thursday, 3 October, 2019 11:54:11 AM

Now it works perfectly. Thanks a lot!

Answered by Dawie Harmse on Thursday, 3 October, 2019 12:21:18 PM

cool

Answered by GrabzIt Support on Thursday, 3 October, 2019 12:24:40 PM