Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8542017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:57:45+00:00 2026-06-11T11:57:45+00:00

I need to refactor some reports (generated with Jasper) using MS Reporting Services. Copies

  • 0

I need to refactor some reports (generated with Jasper) using MS Reporting Services. Copies of original reports are available in PDF. The requirement is to make the new reports “pixel perfect” which is very cumbersome…

For making life easier I would like to have a tool which overlays the original and generated report PDFs in order to measure if they are pixel perfect or not.

Is such a tool out there?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T11:57:47+00:00Added an answer on June 11, 2026 at 11:57 am

    The most simple, immediately available method to do this: use ImageMagick’s compare (which is also available on Windows/Linux/Mac and other).

    It can even compare PDF pages (though it uses Ghostscript as its delegate to render the PDF pages to pixel images first):

     compare.exe         ^
        tested.pdf[0]    ^
        reference.pdf[0] ^
       -compose src      ^
        delta.pdf
    

    The resulting delta.pdf will depict each pixel as red which has a different color between the two compared PDF pages. All identical pixels will be purely white. The [0] tell compare to use the first pages of each file for comparison (page count is zero-based).

    You can see how this works out with the following example:

     compare.exe                      ^
        http://qtrac.eu/boson1.pdf[1] ^
        http://qtrac.eu/boson2.pdf[1] ^
       -compose src                   ^
        delta.pdf
    

    Here are the respective pages (converted to scaled-down PNGs for web display). The reference page is on the left, the modified page is the middle one, the ‘delta-pixel-are-red’ image is on the right:

    first page second page delta image

    A slightly different visual result you can get by skipping the -compose src parameter. Then you’ll get the original file’s pixels as a gray-shaded background (for context) with the delta pixels in red:

     compare.exe                      ^
        http://qtrac.eu/boson1.pdf[1] ^
        http://qtrac.eu/boson2.pdf[1] ^
        delta.pdf
    

    first page second page delta.pdf

    If you don’t like the red color for pixel differences, use -highlight-color:

     compare.exe                      ^
        http://qtrac.eu/boson1.pdf[1] ^
        http://qtrac.eu/boson2.pdf[1] ^
       -highlight-color green         ^
        delta.pdf
    

    The default resolution used to render the PDF pages is 72 dpi. Should you need a higher precision, you can switch to 300 dpi using the -density parameter like this:

     compare.exe                      ^
       -density 300                   ^
        http://qtrac.eu/boson1.pdf[1] ^
        http://qtrac.eu/boson2.pdf[1] ^
        delta.pdf
    

    Note, switching to higher densities will slow down the process and create bigger files.

    You can even create a *.txt file for the delta image which describes each pixel’s coordinates and the respective color values:

     compare                          ^
        http://qtrac.eu/boson1.pdf[1] ^
        http://qtrac.eu/boson2.pdf[1] ^
       -compose src                   ^
       -highlight-color black         ^
        delta.txt
    

    Then simply count the number of total vs. black pixels (sorry, this is Unix/Linux/MacOSX syntax):

     total_pixels=$(( $(cat delta.txt | wc -l) - 1))
     black_pixels=$(( $(grep black delta.txt | wc -l) -1 ))
    

    In the example used for the illustrations above, I get

     total_pixels=500990
     black_pixels=8727
    

    Of course the ‘ideal’ result would be

     black_pixels=0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In order to refactor some methods into smaller ones, I need pass by reference,
I need to refactor my project in order to make it immune to OutOfMemory
I have an old untyped class pre Java1.5 and need to refactor it using
I've got some sample code that I'd like to refactor as I need it
I have a problem with some code I need to refactor. Right now it
I'm trying to refactor some slow running code which writes XML using nested loops
I need to refactor some code across multiple php files stored in multiple folders.
I need help to refactor some parts of this code example from where if
I'm working with some code that I need to refactor. A view controller is
I am working with some legacy C code which I need to refactor and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.