<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: IDRSolutions</title>
    <description>The latest articles on DEV Community by IDRSolutions (@idrsolutions).</description>
    <link>https://dev.to/idrsolutions</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3078638%2Faa7ba4ef-f446-48e3-95e9-0c43d0c3e214.png</url>
      <title>DEV Community: IDRSolutions</title>
      <link>https://dev.to/idrsolutions</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/idrsolutions"/>
    <language>en</language>
    <item>
      <title>How to remove text from a PDF in Java using JPedal (Tutorial)</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Fri, 19 Jun 2026 08:56:21 +0000</pubDate>
      <link>https://dev.to/idrsolutions/how-to-remove-text-from-a-pdf-in-java-using-jpedal-tutorial-43km</link>
      <guid>https://dev.to/idrsolutions/how-to-remove-text-from-a-pdf-in-java-using-jpedal-tutorial-43km</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnpkpx1rzajdnqmww6qpj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnpkpx1rzajdnqmww6qpj.png" alt=" " width="800" height="510"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why remove text from a PDF file?
&lt;/h2&gt;

&lt;p&gt;Removing text from a PDF in Java is a common requirement when dealing with sensitive information, names, email addresses, phone numbers, and other personally identifiable information. &lt;/p&gt;

&lt;p&gt;Whether you are meeting GDPR redaction obligations, preparing documents for external sharing, or sanitising files before archiving, this tutorial explains how to do it using the &lt;a href="https://www.idrsolutions.com/jpedal/" rel="noopener noreferrer"&gt;JPedal PDF library&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What redaction actually means
&lt;/h2&gt;

&lt;p&gt;Removing text from a PDF is a two-part problem. First, you find the text. Then you redact it, which itself has two layers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Hide the text visually, usually done by drawing an opaque box over it&lt;/li&gt;
&lt;li&gt;Remove it from the underlying content stream so it cannot be extracted by a PDF reader or copy-paste&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Both steps are critical. Drawing a black box without editing the content stream is not true redaction. The text is still there, just invisible, and people will be able to copy and paste it. JPedal handles both steps, and together these are called redaction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing a Java PDF library for text removal
&lt;/h2&gt;

&lt;p&gt;Most developers reach for Apache PDFBox first, but programmatically removing text from a PDF in Java, rather than just drawing over it, requires direct access to the content stream. JPedal exposes this through a clean API, handling both the search and the redaction in a few lines of code without manual stream manipulation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Find, delete and redact text from a PDF in Java using JPedal
&lt;/h2&gt;

&lt;p&gt;Open the PDF, scan each page for the target text, redact every match, then write out the modified document. The key methods are &lt;code&gt;findTextOnPage()&lt;/code&gt; to locate matches and &lt;code&gt;redact()&lt;/code&gt; to remove them. &lt;code&gt;pdf.apply()&lt;/code&gt; commits the redaction operations to the document before writing.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.idrsolutions.com/jpedal/#why-buy" rel="noopener noreferrer"&gt;Download JPedal trial jar&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Create a File handle to the PDF file&lt;/li&gt;
&lt;li&gt;Include a password if file password protected&lt;/li&gt;
&lt;li&gt;Open the PDF file&lt;/li&gt;
&lt;li&gt;Scan the pages for text&lt;/li&gt;
&lt;li&gt;Redact each match&lt;/li&gt;
&lt;li&gt;Write the output and close
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;final File inputFile = new File("inputFile.pdf");
final FindTextInRectangle extract = new FindTextInRectangle(inputFile);
final PdfManipulator pdf = new PdfManipulator();
pdf.loadDocument(inputFile);
if (extract.openPDFFile()) {
    final int pageCount = extract.getPageCount();
    for (int page = 1; page &amp;lt;= pageCount; page++) {
        final float[] coords = extract.findTextOnPage(page, "the", SearchType.MUTLI_LINE_RESULTS);
        for (int val = 0; val &amp;lt; coords.length; val = val + 5) {
            pdf.redact(page, new float[] {coords[val], coords[val + 1], coords[val + 2], coords[val + 3]});
        }
    }
}
extract.closePDFfile();
//apply changes and write out
pdf.apply();
final File outputFile = new File("redactedFile.pdf");
pdf.writeDocument(outputFile);
pdf.closeDocument();

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;findTextOnPage()&lt;/code&gt; returns a flat float array of coordinates for each match, x1, y1, x2, y2, plus a fifth value (magic number documented &lt;a href="https://www.idrsolutions.com/docs/jpedal/tutorials/search/find-text-in-a-pdf-file" rel="noopener noreferrer"&gt;here&lt;/a&gt;) at index 4, which is why the loop increments by 5. The output is a new PDF with every instance of the search term permanently removed from both the visual layer and the content stream.&lt;/p&gt;

&lt;p&gt;The original file is not modified unless you overwrite it. Add try-catch blocks around the file operations and PDF calls for production use. For other PDF text manipulation tasks in Java, extracting, searching, or modifying content programmatically, see the &lt;a href="https://www.idrsolutions.com/docs/jpedal/" rel="noopener noreferrer"&gt;JPedal tutorials&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can expand your &lt;a href="https://blog.idrsolutions.com/understanding-the-pdf-file-format/" rel="noopener noreferrer"&gt;understanding of the PDF format&lt;/a&gt; by reading our other articles. Similarly, if there is a specific term for PDF you would like to know more about, our &lt;a href="https://blog.idrsolutions.com/glossary-of-pdf-terms/" rel="noopener noreferrer"&gt;PDF Glossary&lt;/a&gt; has an extensive list of common terms.&lt;/p&gt;

</description>
      <category>java</category>
      <category>pdf</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to draw PDF XFA Forms accurately (in your viewer)</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Wed, 17 Jun 2026 09:58:16 +0000</pubDate>
      <link>https://dev.to/idrsolutions/how-to-draw-pdf-xfa-forms-accurately-in-your-viewer-49p0</link>
      <guid>https://dev.to/idrsolutions/how-to-draw-pdf-xfa-forms-accurately-in-your-viewer-49p0</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;It is a bit of a complex task if any attempt is made to try and display XFA forms (by following the XFA specification) in a custom viewer rather than the Adobe life cycle. Either you are expected to have a similar functionality to the HTML parser, which should be intelligent enough to draw components recursively, or you should have a custom parser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Structure of Subforms
&lt;/h2&gt;

&lt;p&gt;Subforms in XFA may contain one or many subforms, and each of them may contain individual components that could be either containers (containing subforms, exclusion groups, area, subformset) or widgets (Rectangle, text, arc, input text, checkbox, choice-list and so on).&lt;/p&gt;

&lt;h2&gt;
  
  
  Handling Coordinates and Dimensions
&lt;/h2&gt;

&lt;p&gt;Every subform’s x,y coordinates depend on previous and parent elements of it; its height depends on the height and width of the child elements if the H attribute or min H attribute is not specified.&lt;/p&gt;

&lt;p&gt;In such a complex situation, the form height and x,y coordinates should be in memory or should be injected as an attribute in order to render them accurately (in my personal opinion, injecting data as an attribute consume much less memory).&lt;/p&gt;

&lt;h2&gt;
  
  
  Influence of Datasets
&lt;/h2&gt;

&lt;p&gt;Datasets also have a major influence on the way the form is rendered, because form occurrences (number of forms) have to be multiplied based on bind data (be aware that bind names play a major role rather than the typical name attribute of the subform node).&lt;/p&gt;

&lt;h2&gt;
  
  
  Page Breaks and Content Overflow
&lt;/h2&gt;

&lt;p&gt;Forms do have page breaks that render the form and its components on different pages. In addition to that, components of a single form can be split into multiple pages if their x,y location exceeds the allowed height of the content area of the PageArea element.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recommended Handling Approach
&lt;/h2&gt;

&lt;p&gt;One of the recommended ways of handling such a scenario described above is to draw the form coordination in memory or as attributes and splitting them later based on page breaks, data sets and content area overflow. Margins (left, right, bottom and top) also need to be considered on the stage of rendering.&lt;/p&gt;

&lt;h2&gt;
  
  
  Layout Considerations
&lt;/h2&gt;

&lt;p&gt;Possible subform layouts such as Positioned, Top to bottom. Left to right, right to left, table and row have to be considered in finding the relevant heights of the given subform. The calculation may vary from one to another.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dynamic XFA Forms and JavaScript
&lt;/h2&gt;

&lt;p&gt;Dynamic XFA forms contain JavaScript (a real beast in XFA layout)  that determines visibility and total occurrence of individual forms.&lt;/p&gt;

</description>
      <category>pdf</category>
      <category>html</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>PDF to HTML5 conversion – No Even-Odd Winding Rule for filling shapes in HTML5? – Part 1</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Fri, 12 Jun 2026 09:55:29 +0000</pubDate>
      <link>https://dev.to/idrsolutions/pdf-to-html5-conversion-no-even-odd-winding-rule-for-filling-shapes-in-html5-part-1-5hbn</link>
      <guid>https://dev.to/idrsolutions/pdf-to-html5-conversion-no-even-odd-winding-rule-for-filling-shapes-in-html5-part-1-5hbn</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When filling shapes in PDFs (and lots of other technologies) you get a choice between using the Even-Odd or the Non-Zero winding rule.&lt;/p&gt;

&lt;p&gt;For those of you already thinking to yourself “what the hell is he talking about?” – don’t worry, I shall explain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding Shape Filling
&lt;/h2&gt;

&lt;p&gt;A shape has an inside and an outside, and what is the inside and what is the outside is quite simple to work out, given that it is a simple shape. But what if you scribble over a page crossing over your paths several times to eventually join up where you started – what is the inside and what is the outside of this shape? And what about if you have nested shapes, or shapes that cover each other?&lt;/p&gt;

&lt;p&gt;We can solve this problem by using the Even-Odd rule or the Non-Zero rule.&lt;/p&gt;

&lt;h2&gt;
  
  
  Even-Odd Rule
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Even-Odd:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“This rule determines the “insideness” of a point on the canvas by drawing a ray from that point to infinity in any direction and counting the number of path segments from the given shape that the ray crosses. If this number is odd, the point is inside; if even, the point is outside.”&lt;br&gt;
  – &lt;a href="http://www.w3.org/TR/SVG/painting.html#FillProperties" rel="noopener noreferrer"&gt;w3C SVG&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To illustrate:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F593hgaeu4s12h7ktxgm3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F593hgaeu4s12h7ktxgm3.png" alt="Even odd rule SVG" width="634" height="205"&gt;&lt;/a&gt;&lt;br&gt;
(Reference &lt;a href="http://www.w3.org/TR/SVG/painting.html#FillProperties" rel="noopener noreferrer"&gt;w3C SVG 1.1&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  Non-Zero Winding Rule
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Non-Zero:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“This rule determines the “insideness” of a point on the canvas by drawing a ray from that point to infinity in any direction and then examining the places where a segment of the shape crosses the ray. Starting with a count of zero, add one each time a path segment crosses the ray from left to right and subtract one each time a path segment crosses the ray from right to left. After counting the crossings, if the result is zero then the point is outside the path. Otherwise, it is inside.”&lt;br&gt;
 &lt;a href="http://www.w3.org/TR/SVG/painting.html#FillProperties" rel="noopener noreferrer"&gt;w3C SVG 1.1&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To illustrate:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs9tf4joaq1g6o1ri0wr7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs9tf4joaq1g6o1ri0wr7.png" alt="Zero Winding rule SVG" width="634" height="211"&gt;&lt;/a&gt;&lt;br&gt;
(Reference &lt;a href="http://www.w3.org/TR/SVG/painting.html#FillProperties" rel="noopener noreferrer"&gt;w3C SVG 1.1&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  The Key Difference
&lt;/h2&gt;

&lt;p&gt;So to put it simply – when using the Non-Zero Winding Rule, the direction in which you draw the shapes matters. And if you try to draw a shape that is meant to use the Even-Odd rule instead of using the Non-Zero rule, you are going to end up with areas filled that should not be filled.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem in PDF to HTML5 Conversion
&lt;/h2&gt;

&lt;p&gt;And this becomes a problem when you are trying to convert from PDF (which supports both rules) to HTML5 which only supports the Non-Zero winding rule.&lt;/p&gt;

&lt;p&gt;So this leaves us with a dilemma – what do we do with PDF shapes that use the Even-Odd rule when we convert the PDF to HTML5?&lt;/p&gt;

&lt;p&gt;To find out, Part 2 of this blog article can be found &lt;a href="https://blog.idrsolutions.com/pdf-to-html5-conversion-no-even-odd-winding-rule-for-filling-shapes-in-html5-part-2/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>html</category>
      <category>pdf</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Odd coloured JPEGs in Java with ImageIO</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Wed, 10 Jun 2026 08:41:38 +0000</pubDate>
      <link>https://dev.to/idrsolutions/odd-coloured-jpegs-in-java-with-imageio-5al7</link>
      <guid>https://dev.to/idrsolutions/odd-coloured-jpegs-in-java-with-imageio-5al7</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;One of the best features about Java is the amount of low-level complexity it removes, allowing you to focus on developing the application. However, this does sometimes hide some important issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Hidden Issue with ImageIO
&lt;/h2&gt;

&lt;p&gt;We found one of these with the ImageIO class which offers a whole series of methods to save an image as a Tiff, a PNG or a JPEG. All the complexity is hidden and you can save out the image in one line of code (magic). Unfortunately, it also hides an interesting feature…&lt;/p&gt;

&lt;h2&gt;
  
  
  Transparency and JPEGs
&lt;/h2&gt;

&lt;p&gt;ImageIO will happily save all kinds of images, including images with transparency (ARGB). And it will save it as a JPEG, even though JPEGs do not really support transparency. The problem comes when you try to view the JPEG. Java understands this hybrid image so it will load back correctly, but very few other tools do.&lt;/p&gt;

&lt;p&gt;Because it has 4 bands (RGB are three and then transparency makes the fourth), most JPEG tools assume it must be in the CMYK colorspace and interpret the colours as CMYK. CMYK works completely differently to RGB so the image comes out looking wrong (often with a nasty red tint). Unfortunately, there is no way that a JPEG Decoder can spot this has happened – it is a bug in the way  ImageIO works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Manual Fix: Removing the Alpha Component
&lt;/h2&gt;

&lt;p&gt;You can manually fix it by removing any alpha component from your BufferedImage before you save it in ImageIO with the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="nc"&gt;BufferedImage&lt;/span&gt; &lt;span class="nf"&gt;convertARGBToRGB&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;BufferedImage&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;pixels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;((&lt;/span&gt;&lt;span class="nc"&gt;DataBufferInt&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getRaster&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;getDataBuffer&lt;/span&gt;&lt;span class="o"&gt;()).&lt;/span&gt;&lt;span class="na"&gt;getData&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="nc"&gt;BufferedImage&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;BufferedImage&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getWidth&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getHeight&lt;/span&gt;&lt;span class="o"&gt;(),&lt;/span&gt; &lt;span class="nc"&gt;BufferedImage&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;TYPE_INT_RGB&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;pixelsOut&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;((&lt;/span&gt;&lt;span class="nc"&gt;DataBufferInt&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getRaster&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;getDataBuffer&lt;/span&gt;&lt;span class="o"&gt;()).&lt;/span&gt;&lt;span class="na"&gt;getData&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;arraycopy&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pixels&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pixelsOut&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;pixels&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  JDeli: A Better Alternative
&lt;/h2&gt;

&lt;p&gt;JDeli is the best enterprise-level Java image library for performance and efficiency. In our &lt;a href="https://www.idrsolutions.com/jdeli/" rel="noopener noreferrer"&gt;JDeli image library&lt;/a&gt; (which provides a complete &lt;a href="https://www.idrsolutions.com/docs/jdeli/tutorials/converting/jpg-converter" rel="noopener noreferrer"&gt;JPG Converter&lt;/a&gt;), we have actually added a flag to read the JPEG correctly for you if you know the file is broken.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
 &lt;span class="nc"&gt;Map&lt;/span&gt; &lt;span class="n"&gt;map&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;HashMap&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
 &lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;put&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"DECODE_4_COMPONENTS_AS_ARGB"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="s"&gt;"TRUE"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
 &lt;span class="nc"&gt;BufferedImage&lt;/span&gt; &lt;span class="n"&gt;image&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;JDeli&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;read&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;File&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;jpeg&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt; &lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;IOException&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
 &lt;span class="c1"&gt;// Deal with read error here.&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So while Java makes life much easier most of the time, there are some interesting gotchas out there…&lt;/p&gt;

&lt;p&gt;As experienced Java developers, we help you &lt;a href="https://blog.idrsolutions.com/working-with-images-in-java/" rel="noopener noreferrer"&gt;work with images in Java&lt;/a&gt; and bring over a decade of hands-on experience with many image file formats.&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Why choose a pure Java PDF library?</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Fri, 05 Jun 2026 12:45:37 +0000</pubDate>
      <link>https://dev.to/idrsolutions/why-choose-a-pure-java-pdf-library-lgh</link>
      <guid>https://dev.to/idrsolutions/why-choose-a-pure-java-pdf-library-lgh</guid>
      <description>&lt;h2&gt;
  
  
  What are the benefits of a pure Java PDF library and why does it matter?
&lt;/h2&gt;

&lt;p&gt;PDF processing sits at the core of many enterprise systems, and the Java PDF library you choose to build your system have significant implications.&lt;br&gt;
If you are building a new system then here is why you should choose a pure Java PDF library.&lt;/p&gt;

&lt;p&gt;Whether you are selecting a PDF generation library in Java, for high-volume document creation, evaluating a Java PDF editor library for annotation workflows or integrating a Java PDF API into an existing microservice, the pure Java constraint narrows the field considerably, and for good reason.&lt;/p&gt;

&lt;h2&gt;
  
  
  Write once, run anywhere
&lt;/h2&gt;

&lt;p&gt;Java’s slogan “write once, run anywhere” is particularly valuable in PDF processing. A pure Java library runs on any platform/operating system which removes the need for recompilation or platform-specific code. &lt;/p&gt;

&lt;p&gt;You can deploy the same code that you wrote on your MacBook to a Linux or Windows server. This effectively removes any concerns for environment-specific bugs or cross-platform issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simplified distribution and deployment
&lt;/h2&gt;

&lt;p&gt;With a pure Java solution, the burden of managing different native binaries compiled for different architectures does not exist. You no longer need to maintain multiple builds for x86 or ARM. &lt;/p&gt;

&lt;p&gt;This makes distribution much simpler, especially if you are shipping to end users. If deploying to the cloud then you only need to create a single container image.&lt;/p&gt;

&lt;h2&gt;
  
  
  Improved security and stability
&lt;/h2&gt;

&lt;p&gt;Security is a critical concern in PDF processing. The PDF file format is very complex and has been a frequent target for vulnerabilities and exploits. This is especially common in native libraries written in low level code. (&lt;a href="https://en.wikipedia.org/wiki/FORCEDENTRY" rel="noopener noreferrer"&gt;See this scary example!&lt;/a&gt;). Running code entirely within the JVM introduces a strong safety layer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Memory management is handled automatically by the garbage collection, reducing risks like buffer overflow exploits&lt;/li&gt;
&lt;li&gt;There is no direct memory access which removes the risk of segmentation faults or other similar memory corruption errors&lt;/li&gt;
&lt;li&gt;Java’s security model ensures that execution is isolated and controlled&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Easier debugging and maintenance
&lt;/h2&gt;

&lt;p&gt;Java has a very mature ecosystem of development tools, including debuggers, profilers and refactoring utilities which are widely available and well integrated into modern IDEs. This has several benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Identify and resolve issues faster&lt;/li&gt;
&lt;li&gt;Easier to maintain codebase&lt;/li&gt;
&lt;li&gt;More efficient refactoring&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In contrast, debugging native code involves more complex tooling and can pose some platform-specific challenges.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simpler licensing
&lt;/h2&gt;

&lt;p&gt;When a library has no external dependencies it makes the licensing very straightforward. This can reduce the legal complexity of procurement and lowers the risk of compliance issues.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, choosing a pure Java PDF library can be a strategic decision. By leveraging Java’s portability, security and ecosystem, enterprises can create large systems with much less technical debt in the long term. In the intricate field of PDF processing, this reduced complexity pays dividends across the entire software lifecycle.&lt;/p&gt;

&lt;p&gt;The table below outlines the differences between a pure Java PDF SDK versus one that was written using native code and Java:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F10hjb8dyiwx3s0hblr6o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F10hjb8dyiwx3s0hblr6o.png" alt="Pure vs Native Java PDF library" width="800" height="701"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Looking for a pure Java PDF library to handle processing your documents? Check out &lt;a href="https://www.idrsolutions.com/jpedal/" rel="noopener noreferrer"&gt;JPedal&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Want to &lt;a href="https://blog.idrsolutions.com/understanding-the-pdf-file-format/" rel="noopener noreferrer"&gt;learn more about the PDF file format?&lt;/a&gt; We have been developing PDF software for over 20 years!&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>java</category>
      <category>pdf</category>
      <category>programming</category>
    </item>
    <item>
      <title>Dynamic XFA/PDF to HTML – resolveNode method</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Wed, 03 Jun 2026 09:11:39 +0000</pubDate>
      <link>https://dev.to/idrsolutions/dynamic-xfapdf-to-html-resolvenode-method-2630</link>
      <guid>https://dev.to/idrsolutions/dynamic-xfapdf-to-html-resolvenode-method-2630</guid>
      <description>&lt;p&gt;Dynamic XFA forms contain JavaScript which needs some considerable tidying up to convert into content which will run on a Browser.&lt;/p&gt;

&lt;p&gt;In this technical article, our lead developer of FormVu (which converts Acrobat forms into standalone HTML5) gives you an insight into some of the technical issues involved. FormVu is the best tool for filling PDF forms in HTML.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://files.idrsolutions.com/Examples/XFAForms/Purchase_Order_Blank/form.html" rel="noopener noreferrer"&gt;An XFA form with an example of resolveNode.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this article I do an overview of some factors that have to be taken into consideration prior to implementing resolveNode subroutine in your code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why resolveNode?
&lt;/h2&gt;

&lt;p&gt;Adobe lifecycle designer follows the Ecma Script 357 specification to represent the SOM model structure.&lt;/p&gt;

&lt;p&gt;In a simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;class&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;student&amp;gt;&amp;lt;name&amp;gt;&lt;/span&gt;john&lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&amp;lt;/student&amp;gt;&lt;/span&gt;.

&lt;span class="nt"&gt;&amp;lt;student&amp;gt;&amp;lt;name&amp;gt;&lt;/span&gt;david&lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&amp;lt;/student&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/class&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to access the name of the second student, then you need to pass the query as “class.student[1].name” for access&lt;/p&gt;

&lt;p&gt;But such an array-based access algorithm is not available in regular JavaScript; therefore, the resolveNode method is implemented to reference the node information from an ECMAScript 357-supported script.&lt;/p&gt;

&lt;p&gt;ResolveNode method plays a major role in adding, removing, and moving subform instances on the fly:&lt;/p&gt;

&lt;p&gt;A nice html implementation example of this functionality can be found &lt;a href="https://files.idrsolutions.com/Examples/XFAForms/Purchase_Order_Blank/form.html" rel="noopener noreferrer"&gt;in this converted example&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Have a go at trying to add and delete items from purchase order form.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to handle resolveNode function:
&lt;/h2&gt;

&lt;p&gt;The following are steps that simplify the process of handling resolveNode functions.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Write down the short representation of your full XFA form model by removing the internal node structure of fields, so you can track the method insertion point and the caller of the function very quickly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Always use descendant search prior to ascendant search: if you do not find the required item in descendants, then move to the ascendant nodes;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use parent-by-parent search while traversing to ascendant nodes:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check for [*] symbol: if you come across this sign, try to traverse through all the nodes that have the same named descendants of the particular node;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check for “..” symbol for descendant search and “.parent” for accessing the parent node.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As you can see, it can be done but requires a large amount of pre-processing.&lt;/p&gt;

</description>
      <category>html</category>
      <category>webdev</category>
      <category>pdf</category>
      <category>programming</category>
    </item>
    <item>
      <title>PDF to HTML conversion – matching PDF page size</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Fri, 29 May 2026 09:25:47 +0000</pubDate>
      <link>https://dev.to/idrsolutions/pdf-to-html-conversion-matching-pdf-page-size-1po1</link>
      <guid>https://dev.to/idrsolutions/pdf-to-html-conversion-matching-pdf-page-size-1po1</guid>
      <description>&lt;p&gt;A PDF file is designed to be resolution independent – they are defined using resolution-independent units so that the page will always appear the same size whether it is printed or displayed on any device (regardless of the dpi of the output device). So what happens if you use these units when outputting to HTML canvas and CSS?&lt;/p&gt;

&lt;p&gt;It turns out that the page is actually smaller than the PDF page when displayed at 100%. In fact, the HTML page needs the values scaled to 133% to match the size of the PDF file at 100%. Then it all works correctly.&lt;/p&gt;

&lt;p&gt;It is actually the same issue that forces us to correct for DPI between platforms in our PDF viewer. Some computers use 96 dpi, and some use 72 dpi (which is where the value 1.33 comes from, as it is 96 divided by 72). Printers can use values from 72 to pretty much infinity. This matters because if you draw a line which is 96 pixels on a 72 dpi display, it will be 1.3 inches long, but only 1 inch on a 96 dpi display.&lt;/p&gt;

&lt;p&gt;Adobe made the very sensible decision that a PDF page should appear the same on whatever platform you use, so it adjusts the page size to ‘mimic’ 96dpi as the default setting.&lt;/p&gt;

&lt;p&gt;So if you are using HTML, 1.33 is the magical scaling to ensure things appear the same size as they would in PDF when drawn onscreen. If you are using our PDF to HTML converter, the fix is in Friday’s release.&lt;/p&gt;

</description>
      <category>html</category>
      <category>pdf</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Comparing WebP compression algorithms</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Thu, 28 May 2026 08:32:19 +0000</pubDate>
      <link>https://dev.to/idrsolutions/comparing-webp-compression-algorithms-494</link>
      <guid>https://dev.to/idrsolutions/comparing-webp-compression-algorithms-494</guid>
      <description>&lt;p&gt;In this article, we will be comparing algorithms to compress webp image. To do this, we will be using our Java image library, JDeli. We will be comparing file size, quality of output, and speed. JDeli is the best pure Java image library for performance and efficiency.&lt;/p&gt;

&lt;p&gt;For the baseline of our comparisons, we will use the following uncompressed image. It has a file size of 180KB. It takes just under 3 seconds to encode.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsya8cn9kawuy49on2vjv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsya8cn9kawuy49on2vjv.png" alt="Kitten PNG" width="300" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What types of compression does WebP support?
&lt;/h2&gt;

&lt;p&gt;Unlike most other image formats, WebP has both a lossless and lossy compression format. Which is best for you all depends…&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Lossy WebP compression?
&lt;/h2&gt;

&lt;p&gt;When you compress WebP images with lossy compression, it is also known as irreversible compression due to the fact that some data is removed.  The process uses the VP8 prediction code commonly used for videos, which includes the algorithm DCT (Discrete cosine transform) to then be able to remove redundant data. &lt;/p&gt;

&lt;p&gt;This does mean webp quality loss is expected but usually not visible. Also, something to bear in mind is that you cannot return to the original quality once you have applied this compression. The advantage is that this compression can reduce WebP size much more effectively.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1agtc0uu69eo46f9hp3m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1agtc0uu69eo46f9hp3m.png" alt="lossy webp" width="300" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using lossy compression reduced the file size to 6KB and took just under 2 seconds, and the quality was set to a default of 75.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Lossless WebP compression?
&lt;/h2&gt;

&lt;p&gt;This compression, unlike lossy, preserves the original data so when decoded can return the file to its original form. To achieve this, multiple transformations are made, including several colour transforms along with a spatial transform and then finished off by applying a form of entropy coding known as LZ77 huffman coding. &lt;/p&gt;

&lt;p&gt;This does then mean that the reduction in file size won’t be as significant, but that is not always the most important aspect when compressing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhrzucxh0ige0qffe15es.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhrzucxh0ige0qffe15es.png" alt="lossless webp" width="300" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using lossless compression reduced the file size to 67KB and also took just under 2 seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Using our webp compression tool, we can see the lossy far out ranks the lossless compression due to the much smaller file size for similar quality. If you want to reduce webp size, lossy would be your first choice but if you want to be able to return to the original image than the hit of an extra 61KB wouldn’t matter as much especially when they both take the around the same time to complete.&lt;/p&gt;

&lt;p&gt;You can learn more about similar image formats by having a look at our &lt;a href="https://blog.idrsolutions.com/glossary-of-pdf-terms/" rel="noopener noreferrer"&gt;Glossary&lt;/a&gt;. Our Java Image library JDeli has WebP support for you to convert, read and write the image file type. You can have a look at our &lt;a href="https://www.idrsolutions.com/docs/jdeli/webp-support/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; to learn more.&lt;/p&gt;

&lt;p&gt;As experienced Java developers, we help you &lt;a href="https://blog.idrsolutions.com/working-with-images-in-java/" rel="noopener noreferrer"&gt;work with images in Java&lt;/a&gt; and bring over a decade of hands-on experience with many image file formats.&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>Introductory PDF Font Guide</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Fri, 22 May 2026 09:32:42 +0000</pubDate>
      <link>https://dev.to/idrsolutions/introductory-pdf-font-guide-31gm</link>
      <guid>https://dev.to/idrsolutions/introductory-pdf-font-guide-31gm</guid>
      <description>&lt;p&gt;PDF fonts is a tricky subject and one we frequently get asked about. So we have a lot of tutorials on the subject. I hope they prove useful, and if you have any specific questions, please send me a question and I will make it into an article.&lt;/p&gt;

&lt;p&gt;So let us start at the beginning….&lt;/p&gt;

&lt;h2&gt;
  
  
  How do fonts work in a PDF file
&lt;/h2&gt;

&lt;p&gt;PDF files can contain images, Vector graphics and text. All the text can be in any font. There are 5 standard font families which all PDF viewers must contain (Times, Helvetica, Courier, Symbol and ZapfDingbats) so these can be used in any document. You can use any other font – my daughter always uses her Malinka font because she loves the letters made from cats. In this case, there are three possible approaches. These are set in the PDF creation tool:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Just include the name of the font and hope it is on everyone’s machine. If it is not, it will be replaced with a Standard font.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Embed the font. This means include the actual font data inside the PDF. You can then guarantee that it will be on everyone’s machine because it is in the PDF file (but can only be used by the PDF containing it). The problem with this is that some fonts are very large, so it makes the PDF files much bigger.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Embed and subset the font. This means include just the data needed to draw any characters. So if my daughter creates a PDF containing the phrase ‘THE CAT SAT ON THE MAT’, it would embed just the font data for the letters T, H, E, C, A, S, O, N, M. This is a good compromise as it keeps the file small but guarantees the PDF file will appear as you wanted it.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Types of PDF font
&lt;/h2&gt;

&lt;p&gt;What can make things confusing is that PDF files can use several different types of font technology.&lt;/p&gt;

&lt;h3&gt;
  
  
  Type 3
&lt;/h3&gt;

&lt;p&gt;This is the original and simplest font technology. Fonts generally look quite ‘crude’, and you cannot extract the text values.&lt;/p&gt;

&lt;h3&gt;
  
  
  Postscript (Type1)
&lt;/h3&gt;

&lt;p&gt;These types of fonts produce much higher quality output, and you can extract the text values.&lt;/p&gt;

&lt;h3&gt;
  
  
  TrueType
&lt;/h3&gt;

&lt;p&gt;This was created as an alternative to PostScript (for which Adobe owned the patents) by Microsoft and Apple. It also produces high-quality output and enables text extraction. Because it was the default for Windows, there is a much wider selection of fonts, but not all are well-designed.&lt;/p&gt;

&lt;h3&gt;
  
  
  OpenType
&lt;/h3&gt;

&lt;p&gt;This is a ‘merger’ of the best bits from PostScript and TrueType.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next steps
&lt;/h2&gt;

&lt;p&gt;You should now have a basic grasp of how PDF fonts work in a PDF file. You might want to &lt;a href="https://blog.idrsolutions.com/understanding-the-pdf-file-format/#fonts" rel="noopener noreferrer"&gt;read&lt;/a&gt; the rest of our tutorials….&lt;/p&gt;

</description>
      <category>pdf</category>
      <category>java</category>
      <category>programming</category>
      <category>font</category>
    </item>
    <item>
      <title>Dynamic XFA/PDF to HTML – resolveNode method</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Wed, 20 May 2026 09:52:38 +0000</pubDate>
      <link>https://dev.to/idrsolutions/dynamic-xfapdf-to-html-resolvenode-method-lma</link>
      <guid>https://dev.to/idrsolutions/dynamic-xfapdf-to-html-resolvenode-method-lma</guid>
      <description>&lt;p&gt;Dynamic XFA forms contain JavaScript, which needs some considerable tidying up to convert into content which will run on a Browser.&lt;/p&gt;

&lt;p&gt;In this technical article, our lead developer of FormVu (which converts Acrobat forms into standalone HTML5) gives you an insight into some of the technical issues involved. FormVu is the best tool for filling PDF forms in HTML.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://files.idrsolutions.com/Examples/XFAForms/Purchase_Order_Blank/form.html" rel="noopener noreferrer"&gt;An XFA form with an example of resolveNode&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this article I do an overview of some factors that have to be taken into consideration prior to implementing resolveNode subroutine in your code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why resolveNode?
&lt;/h2&gt;

&lt;p&gt;Adobe lifecycle designer follows the Ecma Script 357 specification to represent the SOM model structure.&lt;/p&gt;

&lt;p&gt;In a simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;class&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;student&amp;gt;&amp;lt;name&amp;gt;&lt;/span&gt;john&lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&amp;lt;/student&amp;gt;&lt;/span&gt;.

&lt;span class="nt"&gt;&amp;lt;student&amp;gt;&amp;lt;name&amp;gt;&lt;/span&gt;david&lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&amp;lt;/student&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/class&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In case you want to access the name of the second student, then you need to pass the query as “&lt;code&gt;class.student[1].name&lt;/code&gt;” for access&lt;/p&gt;

&lt;p&gt;But such an array-based access algorithm is not available in regular JavaScript; therefore, the resolveNode method is implemented to reference the node information from the ECMAScript 357 supported script.&lt;/p&gt;

&lt;p&gt;The resolveNode method plays a major role in adding, removing, and moving subform instances on the fly:&lt;/p&gt;

&lt;p&gt;A nice HTML implementation example of this functionality can be found in this converted example.&lt;/p&gt;

&lt;p&gt;Have a go at trying to add and delete items from the purchase order form.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steps to handle resolveNode function:
&lt;/h2&gt;

&lt;p&gt;The following are steps that simplify the process of handling resolveNode functions.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Write down the short representation of your full XFA form model by removing the internal node structure of fields, so you can track the method insertion point and the caller of the function very quickly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Always use descendant search prior to ascendant search: if you do not find the required item in descendants, then move to the ascendant nodes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use parent-by-parent search while traversing to ascendant nodes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check for [*] symbol: if you come across this sign, try to traverse through all the nodes that have the same named descendants of a particular node.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check for “..” symbol for descendant search and “.parent” for accessing parent node.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As you can see, it can be done, but requires a large amount of pre-processing.&lt;/p&gt;

</description>
      <category>html</category>
      <category>pdf</category>
      <category>web</category>
      <category>programming</category>
    </item>
    <item>
      <title>PDF to HTML5 conversion – Embed an image in HTML5 with Base64 encoding</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Fri, 15 May 2026 13:40:13 +0000</pubDate>
      <link>https://dev.to/idrsolutions/pdf-to-html5-conversion-embed-an-image-in-html5-with-base64-encoding-2oki</link>
      <guid>https://dev.to/idrsolutions/pdf-to-html5-conversion-embed-an-image-in-html5-with-base64-encoding-2oki</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;HTML5 can contain links to external images and other resources (which often makes the HTML5 page much faster to load because it is a small text file with links to the images, videos, or audio it needs). This work fine so long as you have network connectivity…&lt;/p&gt;

&lt;h2&gt;
  
  
  Embedding Images with Base64
&lt;/h2&gt;

&lt;p&gt;One of the big new features in HTML5 is the ability for the code to work without a network connection and to store data offline in a cache. Sometimes, however, this functionality is overkill and you can embed an image more simply by just inserting the data into the HTML5 file.&lt;/p&gt;

&lt;p&gt;An image consists of binary data so it needs to be stored in a suitable format inside the text file. Base64 encoding (a simple algorithm which converts bytes into a block of what looks like text data) is ideal (this is what you often use in emails to add in binary content). So instead of the more usual HMTL5 format of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"Im0″ style="&lt;/span&gt;&lt;span class="na"&gt;display:&lt;/span&gt; &lt;span class="na"&gt;none&lt;/span&gt;&lt;span class="err"&gt;;"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/1/Im0.png"&lt;/span&gt;
&lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Im0″ width="&lt;/span&gt;&lt;span class="err"&gt;540″&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"720″ /&amp;gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you would see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;base64,iV…Big block of chars here…rDYgg=="
alt="Im0″ width="540″ height="720″ /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to try &lt;a href="https://www.idrsolutions.com/buildvu/" rel="noopener noreferrer"&gt;BuildVu&lt;/a&gt;, there is a new flag to enable it in today’s release (it is commented out by default in ExtractPagesAsHTML.java example).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="cm"&gt;/**
 * embed image inside PDF as base64 encoded stream
 */&lt;/span&gt;
&lt;span class="nc"&gt;HTMLoutput&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setBooleanValue&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;HTMLDisplay&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;EmbedImageAsBase64Stream&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Of course once you start playing with images, you may want to have far more control on images and be able to control their exact size.&lt;/p&gt;

</description>
      <category>html</category>
      <category>pdf</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>What is AVIF image format?</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Wed, 13 May 2026 09:03:18 +0000</pubDate>
      <link>https://dev.to/idrsolutions/what-is-avif-image-format-46b9</link>
      <guid>https://dev.to/idrsolutions/what-is-avif-image-format-46b9</guid>
      <description>&lt;h2&gt;
  
  
  What is AVIF?
&lt;/h2&gt;

&lt;p&gt;AVIF stands for &lt;strong&gt;AV1 Image File Format&lt;/strong&gt; and is used for storing images and video. It uses the same container format as HEIC images but with potentially better compression. It offers lossy and lossless compression. It offers an alternative to HEIC and JPEG image file formats but is not as well supported in web browsers.&lt;/p&gt;

&lt;p&gt;It is an open standard with no patents.&lt;/p&gt;

&lt;p&gt;The file name extension for this format is: &lt;code&gt;.avif&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here are some other questions about AVIF you might also want to ask. If you have any other questions, please feel free to &lt;a href="https://www.idrsolutions.com/contact-us" rel="noopener noreferrer"&gt;contact us&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is it used for?
&lt;/h2&gt;

&lt;p&gt;The format has many different use cases. It is an optimal choice for web developers using the format for still images, as it provides rich and vibrant images with a smaller size, leading to stable performance and a better user experience, which is why Web developers use AVIF to deliver fast-loading, visually rich websites.&lt;/p&gt;

&lt;p&gt;The format is especially appealing for high-resolution photography, web graphics, icons, and animations due to its superior compression. Tests have shown AVIF files can be 50% smaller than JPEGs at similar quality, and even outperform WebP in many cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Differences compared to HEIC
&lt;/h2&gt;

&lt;p&gt;While both use the HEIF container, AVIF also uses the AV1 compression format. AVIF often delivers better quality at lower file sizes and is an open standard with no patent concerns, making it more appealing for universal and commercial use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is it better than JPEG?
&lt;/h2&gt;

&lt;p&gt;It may produce better compression than JPEG but JPEG is better supported by web browsers and general software. It is possible to convert AVIF to JPG using third-party software like JDeli.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limitations and Browser Support
&lt;/h2&gt;

&lt;p&gt;While AVIF is gaining significant popularity, particularly for web use, not all browsers and devices support it yet. Chrome, Firefox, and Safari (as of 2024/2025) include AVIF decoding, but some older browsers and operating systems may require fallback formats like JPEG or PNG.&lt;/p&gt;

&lt;p&gt;Software support for editing and conversion is growing but still lags behind legacy image standards.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is it possible to convert AVIF to PNG?
&lt;/h2&gt;

&lt;p&gt;Yes. The reason many people do this is because PNG is a much better supported Image file format. To convert AVIF to PNG you will need to use a third-party software library.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to open AVIF files in Java?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/javax/imageio/package-summary.html" rel="noopener noreferrer"&gt;ImageIO&lt;/a&gt; (the built-in Java Image library) does not support AVIF images by default. JDeli lets you &lt;a href="https://blog.idrsolutions.com/how-to-read-avif-files-in-java-tutorial/" rel="noopener noreferrer"&gt;read&lt;/a&gt; and &lt;a href="https://blog.idrsolutions.com/how-to-write-avif-image-files-in-java-tutorial/" rel="noopener noreferrer"&gt;write&lt;/a&gt; Avif images or add AVIF support to ImageIO.&lt;/p&gt;

</description>
      <category>java</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
