none
Exporting a report as PDF amplifies JPEG artifacts. Is there any way around that? RRS feed

  • Question

  • Repro:

    1. Create a graphics file with no JPEG compression artifacts (i.e., use a lossless format such as PNG, or save it as a JPG with 100% quality).
    2. Save the same file with some small JPEG compression artifacts (e.g., JPG with 95% quality).
    3. Embed both in an MS Access report.
    4. Export the report to PDF (using standard quality, i.e., the equivalent of DoCmd.OutputTo with acExportQualityPrint).

    Expected results:

    The first graphic is crisp clear, the second graphic shows some small JPEG compression artifacts.

    Actual result (tested with both Access 2007 and 2016):

    The first graphic is crisp clear, the second graphic shows *huge* JPEG compression artifacts (much larger than in the original JPG).

    Is there any way around that? Unfortunately, our customers cannot always provide us with vector graphics or lossless graphic files, and any small artifacts present get heavily amplified when exporting the report to PDF.

    Note that this is NOT a matter of file format: A JPEG file created with 100% quality will be just a crisp as the original, lossless PNG, and the artifact amplification also occurs when I save the (lossy) 95% JPEG file as PNG.

    Here are the files I used for testing, in case someone wants to play around with them and reproduce the results:

    • 100% quality JPEG (crisp clear in PDF): http://support.moware.at/Download/img-repro/100.jpg
    • 95% quality JPEG (tiny artifacts in the file, huge artifacts in PDF): http://support.moware.at/Download/img-repro/95.jpg
    • resulting PDF: http://support.moware.at/Download/img-repro/Report1.pdf

    Thanks, best regards
    Heinzi

    PS: I know that PNG is a lossless format and that JPG is not. Explaining that again is not helpful. The question is not about that.

    • Edited by Heinzi.at Friday, November 24, 2017 12:59 PM
    Friday, November 24, 2017 12:56 PM

All replies

  • I don't see the huge artifacts:


    -Tom. Microsoft Access MVP

    Friday, November 24, 2017 3:44 PM
  • Here is what I see when comparing the original JPGs (left; scaled to 400% without interpolation) with the PDF output (right; screen capture with Acrobat Reader zoom at 400%):

    100.jpg:

    95.jpg:

    Here you can see tiny artefacts in the original JPG, but large ones in the PDF output. It doesn't make a big difference when viewed on the screen without zoom, but on print the difference is significant.

    Thanks, best regards
    Heinzi

    Friday, November 24, 2017 4:06 PM
  • Hello,

    Here are the pictures saved from your links.

    Here are the pdf printed from your picture links. I open the link in IE, right-click and select Print picture.

    100%

    95%:

    Output followed your repro step:


    I could not see any artifacts too. Could you reproduce the issue using different machines and different printer?

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, November 27, 2017 2:50 AM
    Moderator
  • Hi Celeste!

    Thank you for looking into this issue.

    What exactly do you mean by "different printer"? I am talking about Access' built-in "Export to PDF" functionality (DoCmd.OutputTo, or the button in the tool bar), not a system-installed PDF printer.

    Or did I misunderstand your answer?

    Thanks, best regards
    Heinzi

    Monday, November 27, 2017 10:30 AM
  • When access uses OutputTo, it may use some Windows APIs to get information about the output device that this will be "printed" on, calls like (off the top of my head) CreateIC, CreateDC, CreatePrinterDC. Worth ruling that out.

    We know you don't want to print to a physical printer, but printing to PDF is VERY much the same, under the hood.


    -Tom. Microsoft Access MVP

    Monday, November 27, 2017 2:14 PM
  • Hi Heinzi.at,

    I see the PDF file and notice that in a normal condition everything looks correct.

    we cannot find the difference between two images.

    we can see some difference when we try to zoom the image like more then 400 %.

    here, I want to confirm with you that is there any need to zoom the image every time?

    is there any specific requirement where quality of image matters?

    let us know , how it affect and where you want to use it.

    so that we can try to understand your requirement in a better way.

    thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, November 28, 2017 7:49 AM
    Moderator
  • Hi Deepak!

    Thanks for your answer, I will gladly explain my use case in more detail:

    We are software developers, selling MS-Access-based software. One of our products is invoicing software, which can create documents such as order confirmations, invoices, etc. These are PDF files, created with MS Access reports and DoCmd.OutputTo. On the top of these reports, there's the company's letterhead, usually provided to us as an image file.

    Our customers do various things with those PDF files: They print them, they send them to their customers by e-mail, etc. 

    Now, the problem is as follows: Our customers complain that the quality of the letterhead in the PDF file is worse than the quality of the image file they provided us with.

    And they are right: If they zoom into the PDF file or print it, they notice that the image is (a) more blurry and (b) has more artifacts than the original image file they provided us with (see my example "95.jpg" above).

    We want our customers to be happy, so we want to fix this problem. Hence, I investigated the problem, prepared a minimal, complete and verifiable example, and posted it here.

    Please feel free to follow up with any questions if anything is still unclear.

    Thanks, best regards
    Heinzi


    • Edited by Heinzi.at Tuesday, November 28, 2017 8:48 AM
    Tuesday, November 28, 2017 8:48 AM
  • Hello,

    Thanks for the detail information.

    Sorry that we could not find any solution or workaround for the issue. I suggest you contact Microsoft professional support and you won't be charged if the support engineer determines that the issue is the result of a bug.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, November 29, 2017 9:43 AM
    Moderator
  • Hi Celeste!

    Thanks for your suggestion. I've tried professional support a few times in the past years, and it has always been a huge waste of time ("Yes, it's probably a bug. Sorry, root cause analysis is not included in professional support. We'll put it in our internal bug database, if it's not already there. No, we can't tell you if or when it will be fixed. Here's your money back, have a nice day. Oh, and since you haven't wasted enough time already, please fill out this satisfaction survey!").

    I'll just leave the question open for a while, maybe one of the MVPs who has some deeper insights into MS Access' PDF export will come up with an idea or explanation.

    Thanks, best regards
    Heinzi

    Wednesday, November 29, 2017 10:15 AM
  • OK. Hope MVPs could offer some suggestions for the issue. 

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 30, 2017 7:54 AM
    Moderator