The Pdf4me Client API is a maven library which connects to its highly scalable SaaS cloud service with many functionalities to solve your document and PDF requirements. The SaaS API provides expert functionality to convert, optimize, compress, produce, merge, split, ocr, enrich, archive, print documents and PDF's.
Feature | Description |
---|---|
Optimize | PDF's can often be optimized by removing structural redundancy. This leads to much smaller PDF's |
Merge | Multiple PDF's can be merged into single optimized PDFs. |
Split | A PDF can be splitted into multiple PDF's. |
Convert to PDF | Convert your documents from any format to a proper PDF document. |
Extract | From a PDF extract multiple pages into a new document. |
Images | Extract images from your document, can be any type of document. |
Create Pdf/A | Create a archive conform PDF/A including xmp Metadata. |
Stamp | Stamp your document with text or images. |
Use your favourite build tools to build your project. The depenency information for the various building tools can be found here.
To get started get a Token by dropping us an email or registering in our portal.
The Token is required for Basic Authentication. The Pdf4me Client Api provides you already with the necessary implementation. You need only to get an instance for the Pdf4meClient as shown in the sample below.
// Either you store them in the config.properties file with keys clientId and secret
// Do not use any quotes:
// Correct: clientId=sample-not-working-key-aaaaaaa
// Incorrect: clientId="sample-not-working-key-aaaaaaa"
Pdf4meClient pdf4meClient = new Pdf4meClient();
// or you pass them as arguments when constructing the Pdf4meClient object
Pdf4meClient pdf4meClient = new Pdf4meClient(clientId, secret);
// The pdf4meClient object delivers the necessary authentication when instantiating the different pdf4meClients such as for instance Merge
MergeClient mergeClient = new MergeClient(pdf4meClient);
byte[] file1 = Files.readAllBytes(Paths.get("myFirstPdf.pdf"));
byte[] file2 = Files.readAllBytes(Paths.get("mySecondPdf.pdf"));
byte[] mergedPdf = mergeClient.merge2Pdfs(file1, file2);
Please visit our documentation for more information about all the functionalities provided and on how to use pdf4me.
It's recommended to create an instance of Pdf4meClient
per thread in a multithreaded environment to avoid any potential issues.
Contributions are very welcome. Please have a look at the instructions below for a smooth project setup.
- Fork pdf4me
- Clone your copy of pdf4me
- Start your IDE, e.g., Eclipse
- Import the two projects: In Eclipse: click on File in the menu -> Import... -> Choose the Maven folder -> Existing Maven Projects
- import Pdf4meJavaClientApi
- import Pdf4meJavaClientApiTest
- You are ready to go
In order for the test cases to run, a config.properties file containing the clientId and secret must be stored in the Pdf4meJavaClientApiTest folder. Please drop us an email (support-dev@pdf4me.com), so we can provide you the developer (clientId, secret) pair for testing the code of your pull request. The test cases are found in Pdf4meJavaClientApiTest/src/test/java/jUnit.
Those who are looking for PDF4me online tool can find it at PDF4me.com