ওয়েব ক্যাপচার এবং রূপান্তর করার সরঞ্জামসমূহ

ইউআরএল এবং এইচটিএমএলকে ডোকএক্সে রূপান্তর করুন

নোড.জেএসপিআইপি

এইচটিএমএল বা ওয়েবপৃষ্ঠাগুলি রূপান্তর করার ক্ষমতা যুক্ত করা into আপনার অ্যাপ্লিকেশনটিতে শব্দ দস্তাবেজগুলি কখনও সহজ ছিল না গ্র্যাজআইটি'র নোড.জেএসআইপিআই। তবে আপনি শুরু করার আগে মনে রাখবেন যে ফোন করার পরে url_to_docx, html_to_docx or file_to_docx পদ্ধতিগুলি save or save_to বাস্তবে ডওএক্সএক্স তৈরি করতে অবশ্যই কল করতে হবে।

বেসিক বিকল্পসমূহ

ডোক্স হিসাবে ওয়েবপৃষ্ঠাগুলি ক্যাপচার পুরো ওয়েব পৃষ্ঠাতে রূপান্তরিত করে intওএ ওয়ার্ড ডকুমেন্ট যা অনেক পৃষ্ঠায় সমন্বিত থাকতে পারে। ওয়েব পৃষ্ঠায় রূপান্তর করতে কেবল একটি প্যারামিটার প্রয়োজন intওএ ওয়ার্ড ডকুমেন্ট বা এইচটিএমএলকে ডোক্সে রূপান্তর করুন যেমন নীচের উদাহরণগুলিতে দেখানো হয়েছে।

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 পদ্ধতিগুলি নীচে দেখানো হয়েছে, এই মানটি আপনার গ্র্যাবজিট নোড.জেএস হ্যান্ডলারের কাছে ফিরে আসে। উদাহরণস্বরূপ, এই কাস্টম শনাক্তকারী একটি ডেটাবেস শনাক্তকারী হতে পারে, যা কোনও ডওসিএক্স ডকুমেন্টকে একটি নির্দিষ্ট ডাটাবেস রেকর্ডের সাথে যুক্ত করতে দেয়।

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

শিরোনাম এবং ফুটেজ

ওয়ার্ড ডকুমেন্টে শিরোনাম বা পাদলেখ যুক্ত করতে আপনি অনুরোধ করতে পারেন যে আপনি একটি বিশেষ প্রয়োগ করতে চান টেমপ্লেট 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;
    }
});

এইচটিএমএল উপাদানকে ডোক্সে রূপান্তর করুন

আপনি যদি কোনও এইচটিএমএল উপাদান যেমন একটি ডিভ বা স্প্যান হিসাবে সরাসরি রূপান্তর করতে চান intওআর ওয়ার্ড ডকুমেন্ট আপনি গ্র্যাবিজআইটি'র নোড.জেএস লাইব্রেরির সাথে করতে পারেন। আপনি অবশ্যই পাস করতে হবে সিএসএস নির্বাচক আপনি যে রূপান্তর করতে চান এইচটিএমএল উপাদানটি setTargetElement প্যারামিটার।

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

এই উদাহরণে, আমরা স্প্যানের সমস্ত আইটেম ক্যাপচার করতে ইচ্ছুক যার আইডি রয়েছে Articleসুতরাং, আমরা নীচে প্রদর্শিত হিসাবে গ্র্যাবজিট এপিআই এ এটি পাস করি।

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