ویب پر گرفت اور تبدیل کرنے کے اوزار

URL اور HTML کو DOCX میں تبدیل کریں

Node.js API

ایچ ٹی ایم ایل یا ویب صفحات کو تبدیل کرنے کی صلاحیت شامل کرنا into آپ کی درخواست میں لفظ دستاویزات کبھی بھی آسان نہیں تھے GrabzIt's Node.js API. تاہم ، اس سے پہلے کہ آپ فون کریں ، یاد رکھیں url_to_docx, html_to_docx or file_to_docx طریقوں save or save_to دراصل DOCX بنانے کے ل method طریقہ کو پکارا جانا چاہئے۔

بنیادی اختیارات

DOCX کے بطور ویب صفحات پر گرفت پورے ویب صفحے کو تبدیل کرتی ہے intOA ورڈ دستاویز جس میں بہت سے صفحات پر مشتمل ہوسکتا ہے۔ ویب پیج کو تبدیل کرنے کیلئے صرف ایک پیرامیٹر کی ضرورت ہے intoa ورڈ دستاویز یا HTML کو DOCX میں تبدیل کریں جیسا کہ مندرجہ ذیل مثالوں میں دکھایا گیا ہے۔

client.url_to_docx("https://www.tesla.com");
//Then call the save or save_to method
client.html_to_docx("<html><body><h1>Hello World!</h1></body></html>");
//Then call the save or save_to method
client.file_to_docx("example.html");
//Then call the save or save_to method

کسٹم شناختی

آپ کو ایک کسٹم شناخت کنندہ پاس کرسکتے ہیں DOCX جیسا کہ ذیل میں دکھایا گیا ہے ، اس کی قیمت آپ کے GrabzIt Node.js ہینڈلر کو واپس کردی جاتی ہے۔ مثال کے طور پر یہ کسٹم شناخت کنندہ ایک ڈیٹا بیس کا شناخت کنندہ ہوسکتا ہے ، جس سے DOCX دستاویز کو کسی خاص ڈیٹا بیس ریکارڈ کے ساتھ وابستہ کیا جاسکتا ہے۔

var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"customId":123456};

client.url_to_docx("https://www.tesla.com", options);
//Then call the save method
client.save("http://www.example.com/handler", function (error, id){
    if (error != null){
        throw error;
    }
});
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"customId":123456};

client.html_to_docx("<html><body><h1>Hello World!</h1></body></html>", options);
//Then call the save method
client.save("http://www.example.com/handler", function (error, id){
    if (error != null){
        throw error;
    }
});
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"customId":123456};

client.file_to_docx("example.html", options);
//Then call the save method
client.save("http://www.example.com/handler", function (error, id){
    if (error != null){
        throw error;
    }
});

ہیڈر اور فوٹر

ورڈ دستاویز میں ہیڈر یا فوٹر شامل کرنے کے ل you آپ درخواست کرسکتے ہیں کہ آپ کسی خاص کو لاگو کرنا چاہتے ہیں سانچے DOCX تیار کیا جارہا ہے۔ یہ ٹیمپلیٹ ہونا چاہئے saveڈی پہلے سے ہی ہے اور ہیڈر اور فوٹر کے مندرجات کے ساتھ ساتھ کسی خاص متغیر کی بھی وضاحت کرے گا۔ مثال کے نیچے کوڈ میں صارف ایک ٹیمپلیٹ استعمال کررہا ہے جسے انہوں نے "میرا ٹیمپلیٹ" کہا ہے۔

var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"templateId":"my template"};

client.url_to_docx("https://www.tesla.com", options);
//Then call the save or save_to method
client.save_to("result.docx", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"templateId":"my template"};

client.html_to_docx("<html><body><h1>Hello World!</h1></body></html>", options);
//Then call the save or save_to method
client.save_to("result.docx", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

var options = {"templateId":"my template"};

client.file_to_docx("example.html", options);
//Then call the save or save_to method
client.save_to("result.docx", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});

HTML عنصر کو DOCX میں تبدیل کریں

اگر آپ صرف کسی HTML عنصر کو تبدیل کرنا چاہتے ہیں جیسے کہ Div یا مدت براہ راست intoa ورڈ دستاویز GrabzIt کی Node.js لائبریری کے ساتھ آپ کر سکتے ہیں۔ آپ کو پاس کرنا ہوگا سی ایس ایس سلیکٹر HTML عنصر کی جس میں آپ تبدیل کرنا چاہتے ہیں setTargetElement پیرامیٹر

...
<span id="Article">
<p>This is the content I am interested in.</p>
<img src="myimage.jpg">
</span>
...

اس مثال میں ، ہم چاہتے ہیں کہ اس مدت میں وہ تمام مواد حاصل کریں جس کی شناخت ہو Articleلہذا ، جیسا کہ ذیل میں دکھایا گیا ہے ہم اسے GrabzIt API میں منتقل کرتے ہیں۔

var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");

client.url_to_docx("http://www.bbc.co.uk/news", {"targetElement": "#Article"});
//Then call the save or save_to method
client.save_to("result.docx", function (error, id){
    //this callback is called once the capture is downloaded
    if (error != null){
        throw error;
    }
});