What is PDFBucket?

This is a powerful tool to solve your HTML to PDF needs .... easy and simple! You just send a HTML URL to PDFBucket and our platform will return to you the equivalent PDF URL. PDFBucket has been built by a team of IT professionals just like you!

Getting Started

Whether you are building an integration with PDFBucket service, we can help you get started! We have a getting started guide, to use PDFBucket.

Create an account

Sign up to suscribe to our service and receive an invitation and enjoy your free trial.

Libraries Integration

PDFBucket's libraries offer easy integration for your specific development environment.

We currently publish our libraries at https://github.com/pdfbucket.


Installation

Add this line to your application's Gemfile:

gem 'pdfbucket'

And then execute:

$ bundle

Usage

# To encrypt a URL in your code instantiate a PDFBucket object and use its generate_url method. # The new pdf_bucket will use PDF_BUCKET_API_KEY, PDF_BUCKET_API_SECRET, # PDF_BUCKET_API_HOST (default is api.pdfbucket.io) # For Sandbox usage the Host is (sandbox.pdfbucket.io) ENV vars: pdf_bucket = PDFBucket::PDFBucket.new # You can also set any the api params, overwriting then ENV vars like this other_pdf_bucket = PDFBucket::PDFBucket.new(api_key: '123', api_secret: '321', api_host: 'api.pdfbucket.io') # And you get the encrypted_url using the generate_url method taking into account the following order: # Without pagination: (uri, orientation, page_size, margin, zoom) encrypted_url = pdf_bucket.generate_url('http://example.com', :landscape, :a4, '2px', '0.7') # With pagination: (uri, orientation, page_size, margin, zoom, expires_in, pagination, position, alignment, cache) encrypted_url = pdf_bucket.generate_url('http://example.com', :landscape, :a4, '2px', '0.7', 0, true, :header, :center) # Also you can pass the plain URL to PDFBucket plain_url = pdf_bucket.generate_plain_url('http://example.com', :landscape, :a4, '2px', '0.7', 0, true, :header, :center) # Possible values for the different params: # orientation: :landscape or :portrait # page size: :letter or :a4 # margin: https://developer.mozilla.org/en-US/docs/Web/CSS/margin#Formal_syntax # zoom: https://developer.mozilla.org/en-US/docs/Web/CSS/@viewport/zoom#Formal_syntax # pagination: true or false # position: :header or :footer # alignment: :left, :center or :right # expires_in: integer value in seconds # cache: 0 to disable cache

Installation

$ npm install pdfbucket --save

Usage

/* To encrypt a URL in your code instantiate a PDFBucket object and use its generateUrl method. The new pdfBucket will use PDF_BUCKET_API_KEY, PDF_BUCKET_API_SECRET, PDF_BUCKET_API_HOST (default is api.pdfbucket.io) For Sandbox usage the Host is (sandbox.pdfbucket.io) ENV vars: */ var PDFBucket = require('pdfbucket'), pdfBucket = new PDFBucket(); // You can also set any the api params, overwriting then ENV vars like this: var otherPDFBucket = new PDFBucket({ apiKey: "ABCDEFGHIJKLMNO", apiSecret: "1234567890ABCDE", apiHost: "api.pdfbucket.io"}); // And you get the encryptedUrl using the generateUrl method: var encryptedUrl = pdfBucket.generateUrl("http://example.com", "landscape", "A4", "2px", "0.7"); // Also you can pass the plain URL to PDFBucket var plainUrl = pdfBucket.generatePlainUrl("http://example.com", "landscape", "A4", "2px", "0.7"); // Possible values for orientation: "landscape", "portrait" // Possible values for page size: "Letter", "A4" // Possible values for margin: https://developer.mozilla.org/en-US/docs/Web/CSS/margin#Formal_syntax // Possible values for zoom: https://developer.mozilla.org/en-US/docs/Web/CSS/@viewport/zoom#Formal_syntax

Installation

You can install this package via Maven or Gradle using the jcenter repository:

Maven:

<dependency> <groupId>io.pdfbucket</groupId> <artifactId>pdfbucket</artifactId> <version>$VERSION</version> <type>pom</type> </dependency>

Gradle:

compile 'io.pdfbucket:pdfbucket:$VERSION'

Usage

/** To encrypt a URL in your code instantiate a PDFBucket object and use its generateUrl method. The new pdfBucket will use PDF_BUCKET_API_KEY, PDF_BUCKET_API_SECRET, PDF_BUCKET_API_HOST (default is api.pdfbucket.io) For Sandbox usage the Host is (sandbox.pdfbucket.io) ENV vars: **/ import io.pdfbucket.pdfbucket.PDFBucket; ... PDFBucket pdfBucket = new PDFBucket.Builder().build(); // You can also set any the api params, overwriting then ENV vars like this: PDFBucket otherPDFBucket = new PDFBucket.Builder() .apiKey("ABCDEFGHIJKLMNO") .apiSecret("1234567890ABCDE") .apiHost("api.example.com") .build(); /** And you get the encryptedUrl using the generateUrl method. (To use encryption you need to install JCE http://stackoverflow.com/a/6481658/491957): **/ String encryptedUrl = pdfBucket.generateUrl("http://example.com", "landscape", "A4", "2px", "0.7"); // Also you can pass the plain URL to PDFBucket String plainUrl = pdfBucket.generatePlainUrl("http://example.com", "landscape", "A4", "2px", "0.7"); // Possible values for orientation: "landscape", "portrait" // Possible values for page size: "Letter", "A4" // Possible values for margin: https://developer.mozilla.org/en-US/docs/Web/CSS/margin#Formal_syntax // Possible values for zoom: https://developer.mozilla.org/en-US/docs/Web/CSS/@viewport/zoom#Formal_syntax

Installation

To install PDFBucket, run the following command in the Package Manager Console

PM> Install-Package PDFBucket

Usage

// To encrypt a URL in your code instantiate a PDFBucket object and use its GenerateUrl method. // The new pdfBucket will use PDF_BUCKET_API_KEY, PDF_BUCKET_API_SECRET, // PDF_BUCKET_API_HOST (default is api.pdfbucket.io) // For Sandbox usage the Host is (sandbox.pdfbucket.io) ENV vars: using PdfBucket; PDFBucket pdfBucket = new PDFBucket.Builder().Build(); // You can also set any the api params, overwriting then ENV VARS like this: PDFBucket otherPDFBucket = new PDFBucket.Builder() .SetApiKey("ABCDEFGHIJKLMNO") .SetApiSecret("1234567890ABCDE") .SetApiHost("api.pdfbucket.io") .Build(); // And you get the encryptedUrl using the `GenerateUrl` method: var EncryptedUrl = pdfBucket.GenerateUrl("http://example.com", "portrait", "A4", "0", "1"); // Also you can pass the plain URL to PDFBucket: var PlainUrl = pdfBucket.GeneratePlainUrl("http://example.com", "portrait", "A4", "0", "1"); // Possible values for orientation: "landscape", "portrait" // Possible values for page size: "Letter", "A4" // Possible values for margin: https://developer.mozilla.org/en-US/docs/Web/CSS/margin#Formal_syntax // Possible values for zoom: https://developer.mozilla.org/en-US/docs/Web/CSS/@viewport/zoom#Formal_syntax

Installation

To add this package as a local, per-project dependency to your project, simply add a dependency on pdfbucket/pdfbucket to your project's composer.json file. Here is a minimal example of a composer.json file that just defines a dependency on PdfBucket:

{ "require": { "pdfbucket/pdfbucket": "~0.0.1" } }

Usage

<?php try { $pdfBucket = new PdfBucket('<API KEY>', '<API SECRET>', 'api.pdfbucket.io'); $uri = 'https://www.google.com'; $orientation = 'landscape'; $pageSize = 'A4'; $margin = '0px'; $zoom = '1.0'; $encryptedUrl = $pdfBucket->generateUrl($uri, $orientation, $pageSize, $margin, $zoom); $plainUrl = $pdfBucket->generatePlainUrl($uri, $orientation, $pageSize, $margin, $zoom); } catch (PdfBucketException $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; } ?>