वेब कॅप्चर आणि रूपांतरित करण्यासाठी साधने

URL आणि HTML ला DOCX मध्ये रूपांतरित करा

नोड.जेएस एपीआय

एचटीएमएल किंवा वेबपृष्ठे रूपांतरित करण्याची क्षमता जोडणे into आपल्या अनुप्रयोगातील शब्द कागदपत्रे यापेक्षा सोपे कधीच नव्हते GrabzIt चे Node.js API. तथापि आपण सुरू करण्यापूर्वी लक्षात ठेवा की कॉल केल्यावर url_to_docx, html_to_docx or file_to_docx पद्धती save or save_to प्रत्यक्षात डीओसीएक्स तयार करण्यासाठी मेथड कॉल केला पाहिजे.

मूलभूत पर्याय

डीओसीएक्स म्हणून वेबपृष्ठे कॅप्चर करणे संपूर्ण वेब पृष्ठ रुपांतरित करते intoa शब्द दस्तऐवज ज्यात बर्‍याच पृष्ठांचा समावेश असू शकतो. वेबपृष्ठ रूपांतरित करण्यासाठी फक्त एक पॅरामीटर आवश्यक आहे intoa वर्ड डॉक्युमेंट किंवा टू एचटीएमएलला डीओसीएक्समध्ये रूपांतरित करा खाली दिलेल्या उदाहरणांनुसार दर्शविले आहे.

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

सानुकूल अभिज्ञापक

आपण एक सानुकूल अभिज्ञापक पास करू शकता डॉक्स खाली दर्शविल्या गेलेल्या पद्धती, हे मूल्य नंतर आपल्या GrabzIt Node.js हँडलरला परत केले जाईल. उदाहरणार्थ हा सानुकूल अभिज्ञापक डेटाबेस अभिज्ञापक असू शकतो, ज्यामुळे डीओसीएक्स दस्तऐवज विशिष्ट डेटाबेस रेकॉर्डशी संबद्ध केला जाऊ शकतो.

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;
    }
});

शीर्षलेख आणि तळटीप

वर्ड दस्तऐवजात शीर्षलेख किंवा तळटीप जोडण्यासाठी आपण विनंती करू शकता की आपण एखादा विशिष्ट अर्ज करू इच्छित आहात साचा डीओएक्सएक्सला व्युत्पन्न केले जात आहे हे टेम्पलेट असणे आवश्यक आहे 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 घटक डीओसीएक्समध्ये रूपांतरित करा

आपण फक्त एखादा एचटीएमएल घटक रूपांतरित करू इच्छित असाल जसे की डिव किंवा स्पॅन थेट 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;
    }
});