כלים ללכידה ולהמרה של האינטרנט
הקהילה המקוונת של GrabzIt

שינוי תוצאת DOCX ב-JavaScript

שאל שאלות כיצד ללכוד או להמיר דפי אינטרנט או HTML into תמונות, מסמכי CSV, PDF או DOCX וכן כיצד להמיר סרטונים into GIF מונפשות באמצעות ה- API שלנו.

היי,

I am using the JavaScript code to export html into the Docx.


is there any way that i can manipulate the response before downloading or i could get the file in response so i could manipulate it as per my need then download.

GrabzIt("Application Key").ConvertHTML(data ,{"onfinish": function(response){
alert(response);
},
"format": "docx"}).Create();

As here is a onfinish event but here i get only id not any response file response

if we have something like this will be helped.

נשאל על ידי תמיכת GrabzIt ב-25 ביוני 2019

You can get the response by using the שיטת DataURI, which returns the response in a base64 encoded format.

However as the DOCX format is essentaially a ZIP file made up of a number of XML files covering things like content, styles etc. You may be better off using a server side language if you want to try and manipulate it.

ענה על ידי GrabzIt Support ב-25 ביוני 2019

היי,

After using the DataUri callback method i got the below response, but is there any way to convert it into the file format so i could download it after manipulation

data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64,
UEsDBBQAAAAIABlr2U5ryYMnqhgAAPTYAAARABwAd29yZC9kb2N1bWVudC54bWwgohgA

תודה

 

 

 

ענה על ידי GrabzIt Support ב-25 ביוני 2019

Remember you are trying to do this in JavaScript so this severley limits what you can do if you are not willing to use a server-side programming language.

יש לך שתי אפשרויות:

The first option is to put the Data URI in a HTML link and add a להוריד תכונה. When someone clicks on the link it will download.

Otherwise you can upload this Data URI to a server-side programming language. Manipulate it there then re-download it from by calling a creating a new web service for the purpose and calling it from the client side.

ענה על ידי GrabzIt Support ב-25 ביוני 2019

Thanks for your replying.

Actually, i just want to keep the dlownloaded file into some folder, which will create on fly once i get the response by DataUri call back method 

 

תודה

שרנג'יט סינג

 

ענה על ידי Charanjit Singh ב-25 ביוני 2019