GrabzIt
Tools to Capture and Convert the Web

How to scale a PDF or DOCX to the browser width?

By default, PDF’s and DOCX are scaled to 1024 pixels, however this can be changed to any size. Although when scaling a document, the results may not always be perfect and you may want to try a few different sizes before you are happy. Sometimes it is useful to match the have the same browser width as the width of the document, to do this pass -1 to the browser width parameter.

In the below examples PDF's are being created, with the browser width being set to 1500px.

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.google.com", options);
grabzIt.Save("http://www.mywebsite.com/handler.ashx");
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.google.com", options);
grabzIt.Save("http://www.mywebsite.com/handler");
<script src="grabzit.min.js"></script>
<script>
GrabzIt("Sign in to view your Application Key").ConvertURL("http://www.google.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.google.com", options);
client.save("http://www.example.com/handler");
$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.google.com", $options);
$grabzIt->Save("http://www.mywebsite.com/handler.pl");
$grabzIt = new GrabzItClient("Sign in to view your Application Key", "Sign in to view your Application Secret");
$options = new GrabzItPDFOptions();
$options->setBrowserWidth(1500);
$grabzIt->URLToPDF("http://www.google.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.google.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.browserWidth(1500)
grabzIt.url_to_pdf("http://www.google.com", options)
grabzIt.save("http://www.mywebsite.com/handler/index")
Back to SupportMore screenshot questions
Try all our premium features for free with a 7 day free trial. Then from $5.99 a month, unless cancelled.
  • More Captures
  • More Features
  • More API's
  • Bigger Scrapes
  • Bigger Screenshots
  • Bigger Everything
Start Free Trial