Herramientas para capturar y convertir la web

¿Cómo escalar un PDF o DOCX al ancho del navegador?

De forma predeterminada, los PDF y DOCX están escalados a 1366 píxeles; sin embargo, esto se puede cambiar a cualquier tamaño. Al escalar, básicamente estás intentando ajustar el ancho del navegador al tamaño de la página. Entonces, si elige 1366 píxeles y una página vertical A4, que tiene un tamaño en píxeles de solo 700, el contenido real deberá ampliarse a aproximadamente la mitad del tamaño para que quepa en el tamaño de página disponible. Por supuesto, si redujera el ancho del navegador o aumentara el tamaño de la página o utilizara el paisaje, la escala sería mucho menor o se invertiría por completo.

Aunque al escalar un documento, es posible que los resultados no siempre sean perfectos y es posible que desees probar algunos tamaños diferentes antes de estar satisfecho. A veces es útil hacer coincidir el ancho del navegador con el mismo ancho del documento; para ello, pase -1 al parámetro de ancho del navegador.

En los siguientes ejemplos, se crean archivos PDF con el ancho del navegador configurado en 1500 px.

GrabzItClient grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
PDFOptions options = new PDFOptions();
options.BrowserWidth = 1500;
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.setBrowserWidth(1500);
grabzIt.URLToPDF("http://www.spacex.com", options);
grabzIt.Save("http://www.mywebsite.com/handler");
<script src="https://cdn.jsdelivr.net/npm/@grabzit/js@3.5.2/grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertURL("http://www.spacex.com", 
{"format": "pdf", "download": 1, "bwidth": 1500}).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 = {"browserWidth":1500};
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->browserWidth(1500);
$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->setBrowserWidth(1500);
$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.browserWidth = 1500
grabzIt.URLToPDF("http://www.spacex.com", options)
grabzIt.Save("http://www.mywebsite.com/handler.py")
https://api.grabz.it/services/convert?key=Sign in to view your Application Key&format=pdf&bwidth=1500&url=https%3A%2F%2Fspacex.com%2F
grabzIt = GrabzIt::Client.new("Sign in to view your Application Key", "Sign in to view your Application Secret")
options = GrabzIt::PDFOptions.new()
options.browserWidth = 1500
grabzIt.url_to_pdf("http://www.spacex.com", options)
grabzIt.save("http://www.mywebsite.com/handler/index")