Herramientas para capturar y convertir la web

¿Cómo crear documentos DOCX y PDF con tamaños de página personalizados?

De manera predeterminada, los documentos DOCX y PDF usan el tamaño de página A4, mientras que otros tamaños de páginas estándar, como A3 y B4, también son compatibles. Sin embargo, GrabzIt también permite a los desarrolladores usar tamaños de página completamente personalizados también. Para crear un tamaño de página personalizado solo especifique el tamaño del ancho y alto de la página en milímetros (mm), con un tamaño de página mínimo de 15 mm.

Tamaño de página personalizado en PDF

Los ejemplos a continuación muestran cómo crear un tamaño de página PDF personalizado de 150mm por 150mm para cada lenguaje de programación que admitamos actualmente.

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")

Tamaño de página personalizado de DOCX

Los tamaños de página personalizados para DOCX se pueden generar de manera similar a PDF en los ejemplos anteriores. Nuevamente, se ha utilizado un tamaño de página personalizado de 150mm por 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")