<?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>Headless Java servers and the fonts nobody installed</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Fri, 13 Nov 2026 16:46:37 +0000</pubDate>
      <link>https://dev.to/idrsolutions/headless-java-servers-and-the-fonts-nobody-installed-o40</link>
      <guid>https://dev.to/idrsolutions/headless-java-servers-and-the-fonts-nobody-installed-o40</guid>
      <description>&lt;p&gt;If your Java service draws text anywhere (a chart in a PDF report, a label on a generated thumbnail, a watermark on an uploaded image), it depends on whatever fonts are installed on the machine it runs on. Most developers never think of fonts as a dependency. Their laptop has a few hundred of them. The production container has a handful, or none, and nobody wrote that down.&lt;/p&gt;

&lt;p&gt;I’ve spent a lot of time on Java code that puts text into images and documents, and font problems are some of the most annoying bugs I know of. They rarely crash anything important. They just make output slightly wrong in a way that only shows up on one machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  The container with no fonts at all
&lt;/h2&gt;

&lt;p&gt;Slim base images leave out fontconfig and freetype because almost nothing on a server needs them. AWT does, even in headless mode. Setting -&lt;code&gt;Djava.awt.headless=true&lt;/code&gt; only tells the JVM there’s no display. When you call &lt;code&gt;drawString&lt;/code&gt; on a &lt;code&gt;Graphics2D&lt;/code&gt; from a &lt;code&gt;BufferedImage&lt;/code&gt;, the JDK still has to find a font file and rasterize glyphs, and on Linux it asks fontconfig where the fonts are.&lt;/p&gt;

&lt;p&gt;If the native libraries are missing, you’ll typically get something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;java.lang.UnsatisfiedLinkError: .../libfontmanager.so: libfreetype.so.6: cannot open shared object file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the libraries are there but there are no fonts, recent JDKs tend to fail with a NullPointerException from inside &lt;code&gt;sun.awt.FontConfiguration&lt;/code&gt;. Neither message tells you to install a package. And because font initialization happens on first use, the service starts cleanly and fails on the first request that renders text, which might be hours after deploy.&lt;/p&gt;

&lt;p&gt;The fix is to install them explicitly, if your base image doesn’t already:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt; eclipse-temurin:17-jre
&lt;span class="k"&gt;RUN&lt;/span&gt; apt-get update \
 &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get install -y --no-install-recommends fontconfig fonts-dejavu-core \
 &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; rm -rf /var/lib/apt/lists/*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some JDK images include fontconfig and some don’t, and package names differ on Alpine, so check what your image actually contains rather than trusting this snippet.&lt;/p&gt;

&lt;h2&gt;
  
  
  The font you asked for isn’t the font you got
&lt;/h2&gt;

&lt;p&gt;This one is worse because nothing fails.&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="nc"&gt;Font&lt;/span&gt; &lt;span class="n"&gt;f&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;Font&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Arial"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;Font&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;PLAIN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;out&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getFamily&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// "Dialog" if Arial isn't installed&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Font constructor doesn’t throw when the family doesn’t exist. It falls back to Dialog and carries on. Java’s five logical fonts (Dialog, DialogInput, Monospaced, SansSerif and Serif) are mapped to different physical fonts on every platform, so “SansSerif” on your Mac and “SansSerif” on a Debian server are different typefaces with different metrics.&lt;/p&gt;

&lt;p&gt;So text that fit inside a box on your machine overflows it in production. Line breaks move. Golden-image tests pass locally and fail in CI, and I’ve watched teams respond by loosening the pixel tolerance until the test stopped meaning anything.&lt;/p&gt;

&lt;p&gt;If you need to know what’s available, ask:&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="kt"&gt;String&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;families&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;GraphicsEnvironment&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getLocalGraphicsEnvironment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getAvailableFontFamilyNames&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Logging that list once at startup has saved me more time than I’d like to admit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bundle the font you actually mean
&lt;/h2&gt;

&lt;p&gt;If the output has to look the same everywhere, stop relying on the host and ship the font with your application:&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="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;InputStream&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Renderer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getResourceAsStream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/fonts/DejaVuSans.ttf"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;Font&lt;/span&gt; &lt;span class="k"&gt;base&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Font&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createFont&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Font&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;TRUETYPE_FONT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nc"&gt;GraphicsEnvironment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getLocalGraphicsEnvironment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;registerFont&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;base&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nc"&gt;Font&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;base&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deriveFont&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;14f&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// use body for rendering&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;createFont&lt;/code&gt; throws &lt;code&gt;FontFormatException&lt;/code&gt; and &lt;code&gt;IOException&lt;/code&gt;, and both are worth handling loudly rather than falling back to Dialog without telling anyone.&lt;/p&gt;

&lt;p&gt;Bundling a font is redistributing it, so the license matters. DejaVu, Liberation and Noto all allow this. Copying Arial out of C:\Windows\Fonts into src/main/resources almost certainly doesn’t, and I’d rather someone in legal heard about that from you than from an audit.&lt;/p&gt;

&lt;h2&gt;
  
  
  The characters your font doesn’t have
&lt;/h2&gt;

&lt;p&gt;DejaVu covers Latin, Greek and Cyrillic well. It doesn’t cover Chinese, Japanese or Korean, and it won’t help with most emoji. If a user’s name is in a script your font lacks, you get empty rectangles where the text should be.&lt;/p&gt;

&lt;p&gt;Logical fonts are composite fonts, so they can fall back across several physical fonts per character. A font you load with &lt;code&gt;createFont&lt;/code&gt; is a single font with no fallback. You can check before rendering:&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="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;firstMissing&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;canDisplayUpTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;firstMissing&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// body can't render text from index firstMissing onward&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What you do then depends on your product. Some teams switch to a Noto CJK font for that string, some reject the input, and some just accept the boxes for a while because it’s rare. I don’t think there’s one right answer, but there’s definitely a wrong one, which is finding out from a customer screenshot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before it ships
&lt;/h2&gt;

&lt;p&gt;The questions I ask now are short. Which fonts does the production image contain, and does the build install them on purpose? Is any code requesting a font family by name that only exists on developer machines? Do the rendering tests run in the same image as production? What happens when the input contains a script nobody tested?&lt;/p&gt;

&lt;p&gt;None of these take long to answer. They tend to get answered after the first bug report, though, usually by whoever happens to be on call.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>docker</category>
      <category>java</category>
      <category>linux</category>
    </item>
    <item>
      <title>Native dependencies are the part of your Java stack nobody owns</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Fri, 06 Nov 2026 14:29:40 +0000</pubDate>
      <link>https://dev.to/idrsolutions/native-dependencies-are-the-part-of-your-java-stack-nobody-owns-i45</link>
      <guid>https://dev.to/idrsolutions/native-dependencies-are-the-part-of-your-java-stack-nobody-owns-i45</guid>
      <description>&lt;p&gt;Most Java services I've looked at have at least one dependency that isn't really Java. It usually arrives as a wrapper: a JNI binding or a &lt;code&gt;ProcessBuilder&lt;/code&gt; call around Ghostscript, a headless browser, ImageMagick or libvips. The Java side looks tidy, with a Maven coordinate and a sensible API. The part doing the actual work is a &lt;code&gt;.so&lt;/code&gt; file or a binary on the PATH, and nobody on the team thinks of it as theirs.&lt;/p&gt;

&lt;p&gt;That's fine right up until it isn't. In my experience it stops being fine at one of three moments, and none of them are when you'd choose.&lt;/p&gt;

&lt;h2&gt;
  
  
  The base image changes
&lt;/h2&gt;

&lt;p&gt;Someone moves the service to a slimmer container image to cut startup time or image size. Alpine is the classic choice, and Alpine uses musl instead of glibc. A native library built against glibc either refuses to load or loads and then behaves strangely, and the error you get is an &lt;code&gt;UnsatisfiedLinkError&lt;/code&gt; that tells you almost nothing about why.&lt;/p&gt;

&lt;p&gt;The Java code didn't change and the JVM didn't care, but the binary underneath did.&lt;/p&gt;

&lt;h2&gt;
  
  
  The CPU architecture changes
&lt;/h2&gt;

&lt;p&gt;A few years ago this was rare. Now half the developers on a team are on Apple Silicon laptops, and the cloud bill keeps nudging people toward ARM instances like AWS Graviton. The JDK has run on ARM for a long time, so pure Java code moves across without anyone noticing. A native dependency needs an ARM build to exist, to be packaged, and to be the same version as the x86 one you tested against. Sometimes all three are true. Often one isn't, and you find out in CI or, worse, on the first deploy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Someone publishes a CVE
&lt;/h2&gt;

&lt;p&gt;In September 2023, libwebp had a heap buffer overflow (CVE-2023-4863) that was being exploited in the wild. It was patched in Chrome quickly. It was patched much more slowly in everything else that had quietly bundled libwebp, which turned out to be a lot of things, including a lot of server-side image pipelines.&lt;/p&gt;

&lt;p&gt;If your image handling goes through a native library, patching means knowing that library is there, knowing which version you shipped, and rebuilding whatever image or package contains it. If it's a Java library, patching is a version bump in your build file, and your existing dependency scanning probably flagged it already.&lt;/p&gt;

&lt;p&gt;There's also a difference in how bad the bug is. A malformed file that triggers an out-of-bounds read in C is a potential remote code execution. The same malformed file in Java hits a bounds check and throws an exception. That's still a bug, and a crafted file can still cause a denial of service, but it's a much smaller category of bad day.&lt;/p&gt;

&lt;h2&gt;
  
  
  The licensing question nobody asked
&lt;/h2&gt;

&lt;p&gt;Ghostscript is AGPL unless you buy a commercial license. That's a perfectly reasonable model, and Artifex is entitled to it, but I've seen it turn up in a dependency audit long after the service shipped, at which point the conversation involves lawyers instead of developers! Native tools tend to be pulled in by someone who needed it working by Friday, and license review doesn't always follow binaries the way it follows Maven dependencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  What pure Java costs you
&lt;/h2&gt;

&lt;p&gt;I'd be misrepresenting things if I said pure Java is free because it isn't!&lt;/p&gt;

&lt;p&gt;Somebody has to implement the format. The PDF specification is enormous, image formats are full of vendor quirks, and a native library that's been hammered on for twenty years has handled edge cases a newer implementation may not have met yet. &lt;/p&gt;

&lt;p&gt;Performance can also lag for some workloads, particularly where the native code leans on hand-tuned SIMD.&lt;/p&gt;

&lt;p&gt;The JDK itself doesn't help as much as you'd hope. ImageIO dates back to Java 1.4, picked up TIFF support in Java 9, and still has no built-in support for WebP, AVIF or HEIC. It also has habits that waste an afternoon, like &lt;code&gt;ImageIO.read&lt;/code&gt; returning &lt;code&gt;null&lt;/code&gt; when it can't find a reader instead of throwing, or rejecting CMYK JPEGs that every other tool opens without complaint. So "just use the JDK" often isn't an option, and you end up choosing between a native wrapper and a third-party Java library anyway.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to decide
&lt;/h2&gt;

&lt;p&gt;Before adding a native dependency, I'd want answers to a few things. Who updates it when a CVE lands, and how would we find out? Does it have builds for every OS, libc and CPU architecture we run on, including developer laptops? What happens to the JVM if it segfaults? (The answer is that the whole process dies and leaves an &lt;code&gt;hs_err_pid&lt;/code&gt; file behind, which is a worse failure mode than an exception you can catch.) What's the license, and has anyone outside engineering looked at it?&lt;/p&gt;

&lt;p&gt;If those answers are all good, a native library will be the right call. Plenty of them are excellent. But the questions usually get asked after the first incident rather than before the first commit.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: I work at a company that builds pure Java libraries for PDF and image processing, so I'm not neutral on this. The tradeoffs above apply regardless of whose library you use.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>docker</category>
      <category>java</category>
      <category>security</category>
    </item>
    <item>
      <title>How to print PDF files from Java (Tutorial)</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Wed, 30 Sep 2026 09:45:05 +0000</pubDate>
      <link>https://dev.to/idrsolutions/how-to-print-pdf-files-from-java-tutorial-4d84</link>
      <guid>https://dev.to/idrsolutions/how-to-print-pdf-files-from-java-tutorial-4d84</guid>
      <description>&lt;p&gt;Printing PDF files from Java is something that raises a lot of general questions, so this short article is a general guide to the options available. Java itself contains a built-in print system (JPS). This does not internally support the PDF file format. We will print PDF using Java with &lt;a href="https://www.idrsolutions.com/jpedal/" rel="noopener noreferrer"&gt;JPedal&lt;/a&gt; (JPedal is our PDF library for Java) to &lt;a href="https://blog.idrsolutions.com/java-pdf-to-image-conversion-tutorial/" rel="noopener noreferrer"&gt;Convert&lt;/a&gt;, &lt;a href="https://blog.idrsolutions.com/how-to-print-pdf-files-from-java/" rel="noopener noreferrer"&gt;Print&lt;/a&gt;, &lt;a href="https://blog.idrsolutions.com/how-to-view-pdf-files-in-java/" rel="noopener noreferrer"&gt;View&lt;/a&gt; PDF files).&lt;/p&gt;

&lt;h2&gt;
  
  
  What is JPS
&lt;/h2&gt;

&lt;p&gt;Java Print System is built into all versions of Java. It renders a page for printing and can plug into the existing Windows or Unix/Linux/Mac printing system. This provides a generic solution but the files tend to be larger and it relies on the capabilities of the Java PDF library which vary. It does not support all formats but does include callbacks to allow these to be implemented.&lt;/p&gt;

&lt;p&gt;We have added PDF support for JPS to our JPedal Java PDF library. There is a detailed &lt;a href="https://www.idrsolutions.com/docs/jpedal/tutorials/printing/pdf-printing-quick-start-tutorial" rel="noopener noreferrer"&gt;5-step tutorial&lt;/a&gt; showing how you can print (which will be relevant to any library using JPS).&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Print PDF in Java
&lt;/h3&gt;

&lt;p&gt;Our JPedal Java PDF library implements JPS so here is the minimal code you would use to &lt;a href="https://www.idrsolutions.com/jpedal/print-pdf-in-java" rel="noopener noreferrer"&gt;print a PDF file&lt;/a&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;1. Create a DocPrintJob&lt;/li&gt;
&lt;li&gt;Wrap your Pageable or Printable object inside a doc, specifying which interface to use in the call&lt;/li&gt;
&lt;li&gt;Add a listener to track what happens.&lt;/li&gt;
&lt;li&gt;Call the print method&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  and the Java code to print PDF…
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;PrintService&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;PrinterJob&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;lookupPrintServices&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;//list of printers&lt;/span&gt;
&lt;span class="n"&gt;printJob&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;].&lt;/span&gt;&lt;span class="na"&gt;createPrintJob&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;//is whichever printer you use&lt;/span&gt;
&lt;span class="nc"&gt;Doc&lt;/span&gt; &lt;span class="n"&gt;doc&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;SimpleDoc&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;decode_pdf&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;DocFlavor&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;SERVICE_FORMATTED&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;PAGEABLE&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;printJob&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;addPrintJobListener&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;PDFPrintJobListener&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;PDFPrintJobListener&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;PrintJobListener&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;printDataTransferCompleted&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PrintJobEvent&lt;/span&gt; &lt;span class="n"&gt;printJobEvent&lt;/span&gt;&lt;span class="o"&gt;)&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;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"printDataTransferCompleted = "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;printJobEvent&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toString&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;printJobCompleted&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PrintJobEvent&lt;/span&gt; &lt;span class="n"&gt;printJobEvent&lt;/span&gt;&lt;span class="o"&gt;)&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;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"printJobCompleted = "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;printJobEvent&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toString&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;printJobFailed&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PrintJobEvent&lt;/span&gt; &lt;span class="n"&gt;printJobEvent&lt;/span&gt;&lt;span class="o"&gt;)&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;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"printJobEvent = "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;printJobEvent&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toString&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;printJobCanceled&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PrintJobEvent&lt;/span&gt; &lt;span class="n"&gt;printJobEvent&lt;/span&gt;&lt;span class="o"&gt;)&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;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"printJobFailed = "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;printJobEvent&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toString&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;printJobNoMoreEvents&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PrintJobEvent&lt;/span&gt; &lt;span class="n"&gt;printJobEvent&lt;/span&gt;&lt;span class="o"&gt;)&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;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"printJobNoMoreEvents = "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;printJobEvent&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toString&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;printJobRequiresAttention&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PrintJobEvent&lt;/span&gt; &lt;span class="n"&gt;printJobEvent&lt;/span&gt;&lt;span class="o"&gt;)&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;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"printJobRequiresAttention = "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;printJobEvent&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toString&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;printJob&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;print&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

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

&lt;/div&gt;



</description>
      <category>java</category>
      <category>tutorial</category>
      <category>programming</category>
      <category>pdf</category>
    </item>
    <item>
      <title>4 tools for viewing Image Metadata</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Fri, 25 Sep 2026 14:40:01 +0000</pubDate>
      <link>https://dev.to/idrsolutions/4-tools-for-viewing-image-metadata-1bpg</link>
      <guid>https://dev.to/idrsolutions/4-tools-for-viewing-image-metadata-1bpg</guid>
      <description>&lt;p&gt;In this article, we will show you some free and commercial multi-platform tools which can be used for viewing Image Metadata on various platforms.&lt;/p&gt;

&lt;h2&gt;
  
  
  Browser plugins for Firefox and Chrome
&lt;/h2&gt;

&lt;p&gt;There is a &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/exif-viewer/" rel="noopener noreferrer"&gt;free plugin&lt;/a&gt; for Firefox  and several plugins for Chrome that work on JPEG files.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7re9v0fe52a8o3rt0qbn.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%2F7re9v0fe52a8o3rt0qbn.png" alt="browser plugin image metadata" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  PhotoshopDC
&lt;/h2&gt;

&lt;p&gt;Photoshop is a high-end commercial image editor from Adobe. It allows comprehensive access to metadata on all image file format. This is hidden under File – File Info&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbd02dit1fibbfxxeh9s6.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%2Fbd02dit1fibbfxxeh9s6.png" alt="photoshop image metadata" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  JAlbum
&lt;/h2&gt;

&lt;p&gt;JAblum is a commercial application which can also edit and help to organise images. It will let you not only view but edit several of the metadata fields including a location. It is cross-platform and there is also a cloud version. FInd out more &lt;a href="https://jalbum.net/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7h2e6lddrqvbisrh9kq3.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%2F7h2e6lddrqvbisrh9kq3.png" alt="jalbum image metadata" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Gimp
&lt;/h2&gt;

&lt;p&gt;Gimp is an Open Source multi-platform Image editor which can view and edit image metadata in mutliple formats including Exif and XMP. This is under Image – Image Data menu option.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F13kcrc64ihovc9xmt7wc.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%2F13kcrc64ihovc9xmt7wc.png" alt="Gimp image metadata" width="800" height="686"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On &lt;a href="https://blog.idrsolutions.com/" rel="noopener noreferrer"&gt;our blog&lt;/a&gt; we look at some libraries which can programmatically access this data, including our own JDeli library. JDeli is the best pure Java image library for performance and efficiency and working with metadata.&lt;/p&gt;

&lt;p&gt;What are your favourite tools to view and edit image metadata?&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>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to add an image annotation to a PDF in Java</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Thu, 24 Sep 2026 09:44:03 +0000</pubDate>
      <link>https://dev.to/idrsolutions/how-to-add-an-image-annotation-to-a-pdf-in-java-moj</link>
      <guid>https://dev.to/idrsolutions/how-to-add-an-image-annotation-to-a-pdf-in-java-moj</guid>
      <description>&lt;p&gt;If you’ve been struggling to find a solution for inserting image annotations into a PDF, look no further. With JPedal you now have the ability to insert image annotations into PDF files using a few lines of Java.&lt;/p&gt;

&lt;p&gt;All you need is a copy of &lt;a href="https://www.idrsolutions.com/jpedal/#why-buy" rel="noopener noreferrer"&gt;JPedal&lt;/a&gt;, a BufferedImage, and a few lines of Java.&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;final&lt;/span&gt; &lt;span class="nc"&gt;WritableAnnotation&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;annotations&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;WritableAnnotation&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;annotations&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="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ImageAnnotation&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;x1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bufferedImage&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;AnnotationWriter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;writeAnnotations&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="s"&gt;"input.pdf"&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="s"&gt;"output.pdf"&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt; &lt;span class="n"&gt;annotations&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The bottom left corner of the image will be at (x0, y0) and the top right corner will be at (x1, y1). The image is scaled to fit within these bounds.&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>What is EXIF metadata?</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Fri, 18 Sep 2026 13:30:05 +0000</pubDate>
      <link>https://dev.to/idrsolutions/what-is-exif-metadata-1e4o</link>
      <guid>https://dev.to/idrsolutions/what-is-exif-metadata-1e4o</guid>
      <description>&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;Quick summary is that HEIC, JPEG, PNG, TIFF can contain easily read predefined data about images. This can be very useful to tell you about images, but you should also be aware it is there.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Exif?
&lt;/h2&gt;

&lt;p&gt;EXIF is a common International standard format for storing metadata as part of an image. This has the advantage of simplicity and convenience. It stands for Exchangeable image file format and is found in &lt;a href="https://www.idrsolutions.com/jdeli/avif" rel="noopener noreferrer"&gt;Avif&lt;/a&gt;, &lt;a href="https://www.idrsolutions.com/jdeli/heic" rel="noopener noreferrer"&gt;Heic&lt;/a&gt;, &lt;a href="https://www.idrsolutions.com/jdeli/jpg" rel="noopener noreferrer"&gt;Jpeg&lt;/a&gt;, &lt;a href="https://www.idrsolutions.com/jdeli/jpeg-xl" rel="noopener noreferrer"&gt;Jpeg XL&lt;/a&gt;, &lt;a href="https://www.idrsolutions.com/jdeli/png" rel="noopener noreferrer"&gt;PNG&lt;/a&gt;, &lt;a href="https://www.idrsolutions.com/jdeli/tiff" rel="noopener noreferrer"&gt;Tiff&lt;/a&gt;, and &lt;a href="https://www.idrsolutions.com/jdeli/webp" rel="noopener noreferrer"&gt;WebP&lt;/a&gt; image file formats and wav sound files. It was first proposed in 1995 and is currently at version 2.32&lt;/p&gt;

&lt;p&gt;It was originally developed for the Tiff file format and consists of a set of predefined Exif tags (such as Image width, height, copyright, location, etc) which take a predefined value (Copyright is a String). There is a nice list of EXIF tags &lt;a href="https://exiv2.org/tags.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How can I view EXIF?
&lt;/h2&gt;

&lt;p&gt;A big advantage of EXIF data is that it can be easily viewed without specialist tools in many applications on Mac, Linux and Windows and mobile. Here is the obligatory cat picture on my Mac with the metadata shown in Preview and Finder on my Mac.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flqcn0mw98ttgy2vd87dr.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%2Flqcn0mw98ttgy2vd87dr.png" alt="Finding EXIF metadata on Mac 1" width="800" height="781"&gt;&lt;/a&gt;&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7gge1lo0l7sgd8b2l6zt.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%2F7gge1lo0l7sgd8b2l6zt.png" alt="Finding EXIF metadata on Mac 2" width="530" height="2106"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What are the advantages and disadvantages of EXIF?
&lt;/h2&gt;

&lt;p&gt;It works very well if the data you are interested in matches the Exif specification. But a weakness of EXIF is that you cannot alter or add your own tags to suit your workflow. This has led to alternative metadata formats such as XMP which is an extensible XML markup developed by Adobe.&lt;/p&gt;

&lt;p&gt;Another potential issue with EXIF data is that there is no security or encryption. Anyone can access the information and it may includes things you do not wish to reveal, such as the location where the photo was taken.&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>
    </item>
    <item>
      <title>How JPedal allows you to view the commands in a PDF stream</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Tue, 15 Sep 2026 11:51:24 +0000</pubDate>
      <link>https://dev.to/idrsolutions/how-jpedal-allows-you-to-view-the-commands-in-a-pdf-stream-1bai</link>
      <guid>https://dev.to/idrsolutions/how-jpedal-allows-you-to-view-the-commands-in-a-pdf-stream-1bai</guid>
      <description>&lt;p&gt;A new version of JPedal has been released, and it contains an exciting new feature—the object stream decoder. JPedal is the best Java PDF library for developers. If you want to use this for yourself, you can download the latest version of JPedal &lt;a href="https://www.idrsolutions.com/jpedal/#why-buy" rel="noopener noreferrer"&gt;here&lt;/a&gt;. You can also view the release notes &lt;a href="https://www.idrsolutions.com/docs/jpedal/release-notes/2023/2023-04-release-notes" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are PDF streams?
&lt;/h2&gt;

&lt;p&gt;Objects in a PDF file contain &lt;a href="https://blog.idrsolutions.com/what-are-pdf-object-streams/" rel="noopener noreferrer"&gt;streams&lt;/a&gt; however, these are usually stored in binary format and often compressed. JPedal now has the ability to decode these PDF streams into plain text for you to view.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get started
&lt;/h2&gt;

&lt;p&gt;Using our &lt;a href="https://www.idrsolutions.com/docs/jpedal/tutorials/viewer/inspect-the-contents-of-pdf-files-with-the-inspector" rel="noopener noreferrer"&gt;PDF Inspector tool&lt;/a&gt; you can look at the internal structure and contents of any PDF file. If you open up the Cross-Reference Viewer or the Object Viewer you will see there is a new ‘Decode Stream’ button.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fub2ugysaznp2prxvp5jj.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%2Fub2ugysaznp2prxvp5jj.png" alt="Object Viewer JPedal PDF Inspector" width="800" height="517"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you select a PDF stream object and hit this button a new window will popup with the decoded contents of the PDF stream. This will then allow you to view the commands inside a PDF file.&lt;/p&gt;

&lt;p&gt;Here is an example of what this could look like:&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F13q5s3gtfctdxtxiqnuw.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%2F13q5s3gtfctdxtxiqnuw.png" alt="Stream Viewer JPedal PDF Inspector" width="800" height="649"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn more
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.idrsolutions.com/jpedal/#why-buy" rel="noopener noreferrer"&gt;Download JPedal and try for yourself.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.idrsolutions.com/jpedal/pdf-inspector" rel="noopener noreferrer"&gt;Learn more about JPedal’s PDF Inspector.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>pdf</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to view Multi-TIFF files in Java (Tutorial)</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Wed, 09 Sep 2026 11:24:58 +0000</pubDate>
      <link>https://dev.to/idrsolutions/how-to-view-multi-tiff-files-in-java-tutorial-d53</link>
      <guid>https://dev.to/idrsolutions/how-to-view-multi-tiff-files-in-java-tutorial-d53</guid>
      <description>&lt;p&gt;In this article, I will show you how to read and view Multi-TIFF files in Java. We already have an article on &lt;a href="https://blog.idrsolutions.com/how-to-read-tiff-images-in-java/" rel="noopener noreferrer"&gt;How to read TIFF images in Java&lt;/a&gt;, why not check it out!&lt;/p&gt;

&lt;p&gt;JDeli helps you &lt;a href="https://www.idrsolutions.com/jdeli/tiff" rel="noopener noreferrer"&gt;read, write and convert TIFF files&lt;/a&gt; in pure Java.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Multi-TIFF file?
&lt;/h2&gt;

&lt;p&gt;TIFF (Tag Image File Format) files are able to contain multiple images. This is what we would call a Multi-TIFF file.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to view in Java?
&lt;/h2&gt;

&lt;p&gt;First you need to read the images into Java. The standard JDK does not support multi-tiff images so you will need to use an additional library such as JDeli. JDeli is the best pure Java image library for performance and efficiency. You can only store one image in a BufferedImage, so JDeli returns an image count and a method to read each image.&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;final&lt;/span&gt; &lt;span class="nc"&gt;TiffDecoder&lt;/span&gt; &lt;span class="n"&gt;tiff&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;TiffDecoder&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;imageCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tiff&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getImageCount&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="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="n"&gt;tiff&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;readImageAt&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;currentIm&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have the images as BufferedImages, they are easy to display in Java.&lt;/p&gt;

&lt;p&gt;If you have read my previous post on &lt;a href="https://blog.idrsolutions.com/how-to-view-images-in-java/" rel="noopener noreferrer"&gt;How to view images in Java&lt;/a&gt;, then you already have an image viewer in Java or you can clone our &lt;a href="https://github.com/idrsolutions/Java-Image-Viewer" rel="noopener noreferrer"&gt;Java Image Viewer GitHub repository&lt;/a&gt;. You can now modify it to view multi-TIFF images.&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional code needed to support Multi-Tiff files in Java Viewer
&lt;/h3&gt;

&lt;p&gt;First, you  need to read each image in the file and display it. You can achieve this by keeping a count of the images in the file:&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;final&lt;/span&gt; &lt;span class="nc"&gt;TiffDecoder&lt;/span&gt; &lt;span class="n"&gt;tiff&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;TiffDecoder&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;imageCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tiff&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getImageCount&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then displaying them one by one with buttons to allow you to cycle through them, much like in our &lt;a href="https://www.idrsolutions.com/jdeli/?mtm_campaign=Blog-trial-downloads&amp;amp;mtm_kwd=blog%20articles&amp;amp;mtm_campaign=BlogTrialDownloads" rel="noopener noreferrer"&gt;JDeli viewer&lt;/a&gt;.&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;final&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;currentIm&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="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;JButton&lt;/span&gt; &lt;span class="n"&gt;next&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;JButton&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Next image"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;JButton&lt;/span&gt; &lt;span class="n"&gt;prev&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;JButton&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Previous image"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;addActionListener&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;currentIm&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;imageCount&lt;/span&gt; &lt;span class="err"&gt;–&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;currentIm&lt;/span&gt;&lt;span class="o"&gt;++;&lt;/span&gt;
    &lt;span class="n"&gt;drawImage&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;});&lt;/span&gt;
&lt;span class="n"&gt;prev&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;addActionListener&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;currIm&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;curentIm&lt;/span&gt;&lt;span class="err"&gt;–&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;drawImage&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
  &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;});&lt;/span&gt;
&lt;span class="c1"&gt;// Add the buttons to the viewer&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;JPanel&lt;/span&gt; &lt;span class="n"&gt;multiButtons&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;JPanel&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;multiButtons&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prev&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;multiButtons&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;multiButtons&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;BorderLayout&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;PAGE_END&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;The draw image method would be one you’d use to set the image each time something like:&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="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="n"&gt;tiff&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;readImageAt&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;currentIm&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="n"&gt;imageLabel&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setIcon&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;ImageIcon&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can view all the images in your multi-TIFF file!&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>How to copy bookmarks from one PDF to another</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Fri, 04 Sep 2026 15:51:57 +0000</pubDate>
      <link>https://dev.to/idrsolutions/how-to-copy-bookmarks-from-one-pdf-to-another-54m6</link>
      <guid>https://dev.to/idrsolutions/how-to-copy-bookmarks-from-one-pdf-to-another-54m6</guid>
      <description>&lt;p&gt;JPedal already has the ability to &lt;a href="https://www.idrsolutions.com/docs/jpedal/tutorials/extract-text/extract-document-outline-from-any-pdf-file" rel="noopener noreferrer"&gt;read bookmarks from PDF files&lt;/a&gt; so now you can chain this functionality with our &lt;a href="https://javadoc.idrsolutions.com/org/jpedal/io/outline/OutlineWriter.html" rel="noopener noreferrer"&gt;OutlineWriter&lt;/a&gt; to copy bookmarks from one PDF to another. JPedal is the best Java PDF library for developers.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Copy bookmarks using Java
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Add JPedal to your class or module path. (Download the &lt;a href="https://www.idrsolutions.com/jpedal/#why-buy" rel="noopener noreferrer"&gt;trial JAR&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Next, read the outline into a &lt;a href="https://docs.oracle.com/javase/8/docs/api/org/w3c/dom/Document.html" rel="noopener noreferrer"&gt;Document&lt;/a&gt; object:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Read&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;ExtractOutline&lt;/span&gt; &lt;span class="n"&gt;extract&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;ExtractOutline&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"source.pdf"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;extract&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;openPDFFile&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;Document&lt;/span&gt; &lt;span class="n"&gt;outlines&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;extract&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getPDFTextOutline&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;extract&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;closePDFfile&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Then, write the Document object to the destination PDF:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Write&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="nc"&gt;OutlineWriter&lt;/span&gt; &lt;span class="n"&gt;writer&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;OutlineWriter&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"destination.pdf"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;outlines&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;writer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;writeOutline&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Copy bookmarks using the command line
JPedal also provides a convenient command line method to copy bookmarks between PDF files:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;java &lt;span class="nt"&gt;-jar&lt;/span&gt; jpedal.jar –copyoutline &lt;span class="s2"&gt;"oldfile.pdf"&lt;/span&gt; &lt;span class="s2"&gt;"newfile.pdf"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Working with PDFs can be troublesome. We have a list of different articles to help you &lt;a href="https://blog.idrsolutions.com/understanding-the-pdf-file-format/" rel="noopener noreferrer"&gt;understand the PDF format&lt;/a&gt; and maximise its functionality.&lt;/p&gt;

</description>
      <category>java</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>pdf</category>
    </item>
    <item>
      <title>HTML and SVG Explained (Along with Use Cases)</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Fri, 28 Aug 2026 14:40:01 +0000</pubDate>
      <link>https://dev.to/idrsolutions/html-and-svg-explained-along-with-use-cases-1l7l</link>
      <guid>https://dev.to/idrsolutions/html-and-svg-explained-along-with-use-cases-1l7l</guid>
      <description>&lt;p&gt;In this article I will explain what HTML and SVG, how they’re related and which might be suited for your use case.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is HTML?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/HTML" rel="noopener noreferrer"&gt;HTML&lt;/a&gt; is the text-based language invented by Tim Berners-Lee at CERN to create web pages. It is displayed by Browsers (IE, Safari, Chrome, Firefox, etc).&lt;/p&gt;

&lt;p&gt;The HTML language is defined by an international committee that releases a public specification. We are currently on HTML Version 5 (HTML5). You will find minor differences (which we often document on this blog) in support across browsers but no ‘major’ issues with HTML5 support in the major browsers.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does HTML work?
&lt;/h2&gt;

&lt;p&gt;This page you are reading is written in HTML but how does html code work? HTML contains both the text and instructions on how to display the text, links to images, etc. You might be wondering how HTML is used, I like to think of HTML as containing the page content, the structure of the page (HyperText Markup), and the style of the page (CSS).&lt;/p&gt;

&lt;p&gt;You can write it from scratch in a text editor, but most people use tools to create it. There is now a huge range of dedicated tools to do this and many other applications (like the &lt;a href="http://www.netbeans.org/" rel="noopener noreferrer"&gt;NetBeans IDE&lt;/a&gt;) also support it.&lt;/p&gt;

&lt;h2&gt;
  
  
  HTML5 Features
&lt;/h2&gt;

&lt;p&gt;HTML5 had some major additions to the HTML features including:-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Canvas (for writing action games and animation).&lt;/li&gt;
&lt;li&gt;Support for video and sound&lt;/li&gt;
&lt;li&gt;Offline support&lt;/li&gt;
&lt;li&gt;Location functionality&lt;/li&gt;
&lt;li&gt;SVG support (so SVG is now part of HTML)&lt;/li&gt;
&lt;li&gt;Improved CSS support (which can also be used for animations and transitions).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;HTML also includes support for fillable forms and interactive elements. The pages can contain JavaScript code and be dynamically updated.&lt;/p&gt;

&lt;p&gt;HTML5 is the first version of HTML which we feel is good enough to make a decent conversion from PDF possible. You can try yourself and see what you think with our &lt;a href="https://www.idrsolutions.com/online-pdf-to-html5-converter" rel="noopener noreferrer"&gt;free PDF online converter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here is what HTML looks like as a page and the raw HTML code. The HTML is text but can include links to images and other pages.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fogbvw2m8j5ink32j8d6m.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%2Fogbvw2m8j5ink32j8d6m.png" alt="HTML example" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you’re working with PDFs and would like to convert them to HTML for your web applications, you can learn more about our product &lt;a href="https://www.idrsolutions.com/buildvu/pdf-to-html" rel="noopener noreferrer"&gt;BuildVu&lt;/a&gt;. BuildVu is the best tool for converting PDF to HTML.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is SVG?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Scalable_Vector_Graphics" rel="noopener noreferrer"&gt;SVG&lt;/a&gt; stands for Scalable Vector Graphics (although it can also include text and bitmaps). Such vector graphics do not lose their quality when zoomed or resized because they are scalable. This means that you define the content using simple text instructions, and when it is scaled, the browser will redraw it at the required resolution – so the Vector content is sharp with no pixelation at any resolution.&lt;/p&gt;

&lt;h2&gt;
  
  
  SVG Support
&lt;/h2&gt;

&lt;p&gt;SVG has been around since 1999 (the joke was that it was the technology of the future and always would be). However, all modern browsers now support SVG either directly or as part of the HTML5 specification, so it is becoming increasingly common to use. It is based on XML and provides a text-based language to create shapes, text and embed images.&lt;/p&gt;

&lt;h2&gt;
  
  
  How does SVG work?
&lt;/h2&gt;

&lt;p&gt;When SVG is used to build a page, more complicated pages can take longer to render. If you are interested in improving SVG files, my colleague Leon wrote a blog post describing &lt;a href="https://blog.idrsolutions.com/6-tips-optimising-svg-files/" rel="noopener noreferrer"&gt;six ways of optimising SVG files&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can embed forms and video in SVG as Foreign objects, but in general, it lacks the wide range of features available in HTML5. It has arguably better drawing capabilities than HTML5 and when we compare the results of HTML5 and SVG from our converter side by side, the SVG generally looks ‘better’ (you can see 2 examples on this page to compare).&lt;/p&gt;

&lt;p&gt;Here is what SVG looks like as a page and the raw SVG code. The SVG is text but can include links to images and other pages. You can use &lt;a href="https://www.idrsolutions.com/buildvu/pdf-to-svg" rel="noopener noreferrer"&gt;BuildVu&lt;/a&gt; to convert your PDFs to SVG for display on your own web applications.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyvtral93arofljraz5jf.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%2Fyvtral93arofljraz5jf.png" alt="SVG example" width="799" height="520"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  More examples of HTML and SVG
&lt;/h2&gt;

&lt;p&gt;Visit our BuildVu page to see more sample HTML and SVG files created from our PDF converter.&lt;/p&gt;

&lt;p&gt;There is a very popular library called &lt;a href="http://d3js.org/" rel="noopener noreferrer"&gt;D3.js&lt;/a&gt; that has been used for some amazing things.&lt;/p&gt;

&lt;p&gt;You can find an impressive example of animated SVG &lt;a href="http://bl.ocks.org/mbostock/1153292" rel="noopener noreferrer"&gt;here&lt;/a&gt; (click and drag the nodes).&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusions – our take on HTML and SVG…
&lt;/h2&gt;

&lt;p&gt;Our experience of HTML5 and SVG from developing our PDF converter has been that both have their strengths and weaknesses.&lt;/p&gt;

&lt;p&gt;SVG is superior if you want a static display of vector content.&lt;/p&gt;

&lt;p&gt;If you want to write animation, HTML5 has a canvas mode.&lt;/p&gt;

&lt;p&gt;If you want to use JavaScript or Fillable forms HTML5 is the choice.&lt;/p&gt;

&lt;p&gt;In practice, the fact that SVG is part of HTML5 means that you can use them together and this is the choice we have adopted for &lt;a href="https://www.idrsolutions.com/online-pdf-to-html5-converter" rel="noopener noreferrer"&gt;our PDF converter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>html</category>
      <category>web</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Comparing PNG Compression Algorithms</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Thu, 27 Aug 2026 08:38:13 +0000</pubDate>
      <link>https://dev.to/idrsolutions/comparing-png-compression-algorithms-4cfb</link>
      <guid>https://dev.to/idrsolutions/comparing-png-compression-algorithms-4cfb</guid>
      <description>&lt;p&gt;In this article, we will be comparing the different compression methods available for use in &lt;a href="https://www.idrsolutions.com/jdeli/png" rel="noopener noreferrer"&gt;PNG images&lt;/a&gt;. To do this, we will be using our Java image library, &lt;a href="https://www.idrsolutions.com/jdeli/" rel="noopener noreferrer"&gt;JDeli&lt;/a&gt;. JDeli is the best pure Java image library for performance and efficiency. We will be comparing against file size, quality of output, and speed.&lt;/p&gt;

&lt;p&gt;For the baseline of our comparisons, we will be using the following image. It has a file size of 39.3MB and takes just under 5 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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1we2ikguywx4j3b5g07f.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%2F1we2ikguywx4j3b5g07f.png" alt="PNG example image" width="800" height="814"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  DEFLATE
&lt;/h2&gt;

&lt;p&gt;DEFLATE was designed in the 1990s and is most commonly using in ZIP file archives due to its lossless property.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0p7dhankk66grqwt4tju.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%2F0p7dhankk66grqwt4tju.png" alt="Deflate PNG example" width="800" height="814"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using DEFLATE, the file size is reduced to 5.1MB taking around 6 seconds to encode. Since DEFLATE is lossless, the image quality is preserved and matches the original file.&lt;/p&gt;

&lt;h2&gt;
  
  
  QUANTISE
&lt;/h2&gt;

&lt;p&gt;QUANTISE is a lossy compression technique that reduces file size by limiting the range of available colours. It is commonly used in PNG and GIF images.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2ee9o1sayw4qym746axf.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%2F2ee9o1sayw4qym746axf.png" alt="Quantise PNG example" width="800" height="814"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using QUANTISE, the file size is reduced to 3.5MB. QUANTISE is lossy, so there is a reduction in image quality, most noticeably in the range of colours which are output. It also takes around 6 seconds to encode.&lt;/p&gt;

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

&lt;p&gt;In conclusion, there are not a great deal of options when it comes to different compression algorithms in PNG files. DEFLATE is a clear winner here as it reduces the file size with no loss of quality. QUANTISE would only be better when the smallest possible file size is necessary.&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>automation</category>
    </item>
    <item>
      <title>How to debug PDF files</title>
      <dc:creator>IDRSolutions</dc:creator>
      <pubDate>Fri, 21 Aug 2026 13:09:55 +0000</pubDate>
      <link>https://dev.to/idrsolutions/how-to-debug-pdf-files-n5k</link>
      <guid>https://dev.to/idrsolutions/how-to-debug-pdf-files-n5k</guid>
      <description>&lt;p&gt;The first JPedal release of 2023 has just been published and with it, some exciting new features have been added to our Java PDF debugger! With a PDF debugger, you can inspect and debug PDF files easily. Read about our new release &lt;a href="https://www.idrsolutions.com/docs/jpedal/release-notes/2023/2023-01-release-notes" rel="noopener noreferrer"&gt;here&lt;/a&gt; to find out more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Viewing Images in the PDF debugger
&lt;/h2&gt;

&lt;p&gt;You can now view images in JPedal’s own PDF debugger.&lt;/p&gt;

&lt;p&gt;The Xref Viewer and the Object Tree Viewer both allow you to view the image content of XObjects. This can be done by selecting an XObject and pressing ‘Show Image’.&lt;/p&gt;

&lt;p&gt;The Command Window allows you to view the image content of ID and DO commands. This can be done by right-clicking on the command and pressing ‘View Image’.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8m0yit4ttulgvxuw9wjd.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%2F8m0yit4ttulgvxuw9wjd.png" alt="JPedal PDF Inspector" width="800" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Read more about viewing images in the inspector &lt;a href="https://www.idrsolutions.com/docs/jpedal/tutorials/viewer/inspect-the-contents-of-pdf-files-with-the-inspector#view-images" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Debug Breakpoints
&lt;/h2&gt;

&lt;p&gt;The Limit Decode Slider in the PDF debugger now has breakpoints.&lt;/p&gt;

&lt;p&gt;You can select a command to toggle a breakpoint and pressing the resume button will decode the page up until the next breakpoint.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnhn8qvgfhqbobvmfku4r.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%2Fnhn8qvgfhqbobvmfku4r.png" alt="Breakpoints JPedal PDF Inspector" width="800" height="560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Read more about breakpoints &lt;a href="https://www.idrsolutions.com/docs/jpedal/tutorials/viewer/inspect-the-contents-of-pdf-files-with-the-inspector#pause-decoding-at-a-specific-command" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Xref Viewer Improvements
&lt;/h2&gt;

&lt;p&gt;The Xref Viewer has been updated and now supports cross-reference streams as well as Xref tables.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff76kdkbls9y8fbkdk79m.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%2Ff76kdkbls9y8fbkdk79m.png" alt="Xref Viewer JPedal PDF Inspector" width="750" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Read more about the Xref Viewer &lt;a href="https://www.idrsolutions.com/docs/jpedal/tutorials/viewer/inspect-the-contents-of-pdf-files-with-the-inspector#view-the-cross-references" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn more
&lt;/h2&gt;

&lt;p&gt;You can read more about JPedal’s PDF inspector &lt;a href="https://www.idrsolutions.com/jpedal/pdf-inspector" rel="noopener noreferrer"&gt;on our website&lt;/a&gt;.&lt;/p&gt;

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