[Solved] Large PDF after export - dynamic PictureBox images

1 Answer 18 Views
.NET Core General Discussions PictureBox Rendering Report Viewer - HTML5
Marina
Top achievements
Rank 1
Marina asked on 29 Jun 2026, 04:22 PM | edited on 30 Jun 2026, 12:08 PM

Hello,
We use Telerik Reporting R2022.3.2112 with .NET 10 / ASP.NET Core on Linux.

Problem

When reports contain many attachment images, the exported PDF is very large.
We tried to resize and compress images before embedding (fit to PictureBox size, JPEG re-encode, byte budget per image). This reduced PDF size, but image quality became too low  (in the viewer and in the pdf also) — text and details in attachments were hard or impossible to read.

So we are stuck between large PDFs and unreadable images.

Example: [ ~50 images (about 3,5 mb in total) → ~15 MB PDF]

We've tried to resize and compress the images - it helped reduce pdf size, but quality was really low.

How we work with reports

Reports (.trdp) are stored in Azure Blob Storage
A custom IReportSourceResolver loads the report and fills it with data/images on the server
Users view reports in the Telerik HTML5 Report Viewer (18.2.24.924) in the browser
PDF is exported from the viewer (Print / Export)

How we insert images into PictureBox

Images are downloaded as blobs from Azure Blob Storage. We use SkiaSharp to decode them and, for attachments, to resize/re-compress before embedding.

Logos — Skia decode → Telerik image on pictureBox.Value
Images in list rows (our main case) — Skia optimize → Telerik image on Processing.PictureBox.Image in ItemDataBinding (bytes on Value did not render in PDF)
Fixed PictureBoxes (supported in code, optional) — Skia optimize → JPEG/PNG bytes on Value + MimeType
SVG — SVG text on Value + MimeType = image/svg+xml



Questions

What is the recommended way to assign images to PictureBox to balance PDF size and quality?
Does Telerik re-embed images at full resolution even when the PictureBox is small on the page?
Are there PDF export settings (compression, downsample, JPEG quality) we should use with the HTML5 viewer or ReportProcessor?
Is there a way to embed images at display resolution without losing readability (especially for screenshots with small text)?

Thank you.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 01 Jul 2026, 01:39 PM

Hello Marina,

Thank you for the provided information about your scenario!

What is the recommended way to assign images to PictureBox to balance PDF size and quality?

I wouldn't say that there is a "recommended" way, but most commonly, our users seem to either embed the image in the PictureBox element or provide it via an expression set to the Value property of the item(through the report designer).

You seem to be doing this in a more complex way, which is perhaps due to the images being stored on the Azure storage. However, how the image is provided to the item should not affect the rendering result.

Does Telerik re-embed images at full resolution even when the PictureBox is small on the page?

Yes, the images keep their original size when exported to PDF. There has been a feature request to enable the ability to resize those images one export, and it has been approved, but it is not yet implemented. Nonetheless, I have cast your vote for the item since you may be interested in getting updates about it - Resize Picture while Export to PDF.

Are there PDF export settings (compression, downsample, JPEG quality) we should use with the HTML5 viewer or ReportProcessor?

Unfortunately, such are not available out of the box.  Please feel free to request either of those on the public portal - Progress® Telerik® Reporting Feedback Portal, and our team will review the request.

Is there a way to embed images at display resolution without losing readability (especially for screenshots with small text)?

I mentioned out of the box in the previous answer, as you can include custom logic that handles the images differently when you are exporting to PDF.

There are a couple of global objects available within the context of the expression used in a report, and one of them is the RenderingFormat object, which has a Name property - the name of the current rendering format.

Our engine also supports the creation and usage of custom functions. What you could do with that is create functions that return your PictureBox's images rather than setting them from the custom resolver, or elsewhere.

To those functions, you can pass the RenderingFormat.Name string, and you can use that to adjust your images when the format is PDF. For example, this is what an expression on the Value property of a PictureBox item can look like:

= GetLogoImage(RenderingFormat.Name)

The question here would be what to do with the image when the format is PDF, so that the size of the PDF is not too big, but the text in the image remains readable. Given the latter, I believe that some sort of balance on the size and the quality of the embedded image will need to be found.

For example, when the format is PDF, your function could:

  1. Decode the original image.
  2. Determine whether it's worth resizing.
  3. Resize it using a high-quality resampler.
  4. Encode it with appropriate compression.

If your function also knows the display size of the PictureBox, it may help with computing the target pixel dimensions based on a desired effective DPI. You can pass the width and height of the PictureBox item via function parameters as well:

= GetLogoImage(RenderingFormat.Name, ReportItem.Width, ReportItem.Height)

For screenshots with small text, 150–200 DPI is often a good balance between readability and file size. If the text is especially small (e.g., code editors or terminal windows), 200–250 DPI may be worthwhile. This should be more effective than scaling every image by, say, 50%, because each image is resized only as much as its displayed size allows.

I hope that the provided information and suggestions will help in achieving the desired balance of size and quality of the PDFs!

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
.NET Core General Discussions PictureBox Rendering Report Viewer - HTML5
Asked by
Marina
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or