أدوات لالتقاط وتحويل الويب

كيفية إنشاء مستندات DOCX و PDF بأحجام صفحات مخصصة؟

بشكل افتراضي ، تستخدم مستندات DOCX و PDF حجم صفحة A4 ، بينما يتم دعم أحجام الصفحات القياسية الأخرى مثل A3 و B4. ومع ذلك ، فإن GrabzIt يسمح للمطورين باستخدام أحجام الصفحات المخصصة بالكامل أيضًا. لإنشاء حجم صفحة مخصص ، حدد فقط حجم عرض الصفحة وارتفاعها بالملليمتر (مم) ، مع الحد الأدنى لحجم الصفحة وهو 15 مم.

PDF حجم صفحة مخصص

توضح الأمثلة أدناه كيفية إنشاء حجم صفحة PDF مخصص من 150mm بواسطة 150mm لكل لغة برمجة ندعمها حاليًا.

GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
PDFOptions options = new PDFOptions();
options.PageWidth = 150;
options.PageHeight = 150;
grabzIt.URLToPDF("http://www.spacex.com", options);
grabzIt.Save("http://www.mywebsite.com/Home/Handler");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
PDFOptions options = new PDFOptions();
options.setPageWidth(150);
options.setPageHeight(150);
grabzIt.URLToPDF("http://www.spacex.com", options);
grabzIt.Save("http://www.mywebsite.com/handler");
<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@3.3.7/grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertURL("http://www.spacex.com", 
{"format": "pdf", "download": 1, "height": 150, "width": 150}).Create();
</script>
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");
var options = {"pageWidth":150,"pageHeight":150};
client.url_to_pdf("http://www.spacex.com", options);
client.save("http://www.example.com/handler", function (error, id){
    if (error != null){
        throw error;
    }
});
$grabzIt = GrabzItClient->new("Sign in to view your Application Key", "Sign in to view your Application Secret");
$options = GrabzItPDFOptions->new();
$options->pageWidth(150);
$options->pageHeight(150);
$grabzIt->URLToPDF("http://www.spacex.com", $options);
$grabzIt->Save("http://www.mywebsite.com/handler.pl");
$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
$options = new \GrabzIt\GrabzItPDFOptions();
$options->setPageWidth(150);
$options->setPageHeight(150);
$grabzIt->URLToPDF("http://www.spacex.com", $options);
$grabzIt->Save("http://www.mywebsite.com/handler.php");
grabzIt = GrabzItClient.GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret")
options = GrabzItPDFOptions.GrabzItPDFOptions()
options.pageWidth = 150
options.pageHeight = 150
grabzIt.URLToPDF("http://www.spacex.com", options)
grabzIt.Save("http://www.mywebsite.com/handler.py")
grabzIt = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret")
options = GrabzIt::PDFOptions.new()
options.pageWidth = 150
options.pageHeigh = 150
grabzIt.url_to_pdf("http://www.spacex.com", options)
grabzIt.save("http://www.mywebsite.com/handler/index")

حجم صفحة مخصص DOCX

يمكن إنشاء أحجام الصفحات المخصصة لـ DOCX بطريقة مماثلة لتنسيق PDF في الأمثلة أعلاه. مرة أخرى تم استخدام حجم صفحة مخصص 150mm بواسطة 150mm.

GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
DOCXOptions options = new DOCXOptions();
options.PageWidth = 150;
options.PageHeight = 150;
grabzIt.URLToDOCX("http://www.spacex.com", options);
grabzIt.Save("http://www.mywebsite.com/Home/Handler");
GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
DOCXOptions options = new DOCXOptions();
options.setPageWidth(150);
options.setPageHeight(150);
grabzIt.URLToDOCX("http://www.spacex.com", options);
grabzIt.Save("http://www.mywebsite.com/handler");
<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@3.3.7/grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertURL("http://www.spacex.com", 
{"format": "docx", "download": 1, "height": 150, "width": 150}).Create();
</script>
var grabzit = require('grabzit');

var client = new grabzit("Sign in to view your Application Key", "Sign in to view your Application Secret");
var options = {"pageWidth":150,"pageHeight":150};
client.url_to_docx("http://www.spacex.com", options);
client.save("http://www.example.com/handler", function (error, id){
    if (error != null){
        throw error;
    }
});
$grabzIt = GrabzItClient->new("Sign in to view your Application Key", "Sign in to view your Application Secret");
$options = GrabzItDOCXOptions->new();
$options->pageWidth(150);
$options->pageHeight(150);
$grabzIt->URLToDOCX("http://www.spacex.com", $options);
$grabzIt->Save("http://www.mywebsite.com/handler.pl");
$grabzIt = new \GrabzIt\GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
$options = new \GrabzIt\GrabzItDOCXOptions();
$options->setPageWidth(150);
$options->setPageHeight(150);
$grabzIt->URLToDOCX("http://www.spacex.com", $options);
$grabzIt->Save("http://www.mywebsite.com/handler.php");
grabzIt = GrabzItClient.GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret")
options = GrabzItDOCXOptions.GrabzItDOCXOptions()
options.pageWidth = 150
options.pageHeight = 150
grabzIt.URLToDOCX("http://www.spacex.com", options)
grabzIt.Save("http://www.mywebsite.com/handler.py")
grabzIt = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret")
options = GrabzIt::DOCXOptions.new()
options.pageWidth = 150
options.pageHeigh = 150
grabzIt.url_to_docx("http://www.spacex.com", options)
grabzIt.save("http://www.mywebsite.com/handler/index")