Standardmäßig sind PDFs und DOCX auf 1366 Pixel skaliert, dies kann jedoch auf jede beliebige Größe geändert werden. Allerdings sind die Ergebnisse bei der Skalierung eines Dokuments möglicherweise nicht immer perfekt und Sie möchten vielleicht ein paar verschiedene Größen ausprobieren, bevor Sie zufrieden sind. Manchmal ist es nützlich, die Browserbreite mit der Breite des Dokuments abzugleichen. Übergeben Sie dazu -1 an den Browserbreitenparameter.
In den folgenden Beispielen werden PDFs erstellt, wobei die Browserbreite auf 1500 Pixel eingestellt ist.
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")