NOTE — More samples will be added soon to this page. If you wish specific topics to be covered, please leave a comment below, thank you!

Text Highlighting
— search and highlight text through PDF Clown

File compression
— reduce file size through PDF Clown

More Samples
— download PDF Clown to get lots of code samples

13 thoughts on “Code Samples

  1. Will I be able to convert a HTML string to PDF using PDF Clown? Do you support HTML to PDF conversion now?

    1. I’m pleased to confirm you that next version (2.0), which has been under heavy development since early 2021, will support HTML-to-PDF conversion (this feature will be fully integrated into its layout model to offer a seamless API experience). Version 2.0 is going to supersede the previous (unpublished) version 0.2.0, which had paused since 2016: the new version represents a full-order-of-magnitude advancement over the existing code base, completely renovating its functionalities yet keeping its core design principles; it will be modular to accommodate its sprawling set of features and will be Java-only (no more .NET). I will publish it as soon as possible, but I cannot be more specific at the moment, sorry.

      1. Hi Stefano,

        Thank you very much for your reply. Looking forward for your new release 😊

    1. Text replacement is a complex topic: PDF typically doesn’t flow, so it’s upon you to ensure the new text properly fits within the page; moreover, the characters referenced in your new text may have no mapping in their (probably) embedded font, as it may have been previously subset. Therefore text replacement is doable but somewhat difficult, depending on the actual characteristics of your files.

    1. [UPDATED ON June 9, 2021]
      I’m pleased to announce that next version (2.0), which has been under heavy development since early 2021, will support HTML-to-PDF conversion (this feature will be fully integrated into its layout model to offer a seamless API experience). Version 2.0 is going to supersede the previous (unpublished) version 0.2.0, which had paused since 2016: the new version represents a full-order-of-magnitude advancement over the existing code base, completely renovating its functionalities yet keeping its core design principles; it will be modular to accommodate its sprawling set of features and will be Java-only (no more .NET). I will publish it as soon as possible, but I cannot be more specific at the moment, sorry.

      PDF Clown doesn’t support HTML rendering (plenty of renderers are already out there), yet next version (0.2.0) is going to feature a simplified formatter which supports tabular structures along with lots of common typographic elements.

  2. I’m trying to make an Android note application with PDF Clown but having a hard time realizing its functions.

    Can I use PDF Clown to render PDF file in my app which acts as a PDF reader?

  3. Do you have any plan about handling images other than JPEG (XObjects where the stream is encoded with something different from DCTDecode)?

Leave a Reply to Stefano Chizzolini Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s