Par défaut, les PDF et DOCX sont mis à l'échelle à 1366 1 pixels, mais cette taille peut être modifiée à n'importe quelle taille. Cependant, lors de la mise à l'échelle d'un document, les résultats ne sont pas toujours parfaits et vous souhaiterez peut-être essayer plusieurs tailles différentes avant d'être satisfait. Parfois, il est utile de faire correspondre la largeur du navigateur à celle du document, pour ce faire, passez -XNUMX au paramètre de largeur du navigateur.
Dans les exemples ci-dessous, des PDF sont créés, la largeur du navigateur étant définie sur 1500 XNUMX 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")