Groupdocs viewer for .NET - original pdfs returned to browser on clicking Print button

Hi, I have configured GroupDocs Viewer in asp.net core 8 application. Viewer type jpg has been set.
When I render pdf document, it correctly renders as images per page.

However when print button is clicked, it appear to return directly the pdf file and user can simply choose text on print preview and click on Save as Pdf and saves file. This is bit concern as why one should use viewer, if entire pdf is being returned to user.
Is there any way to avoid this. Old groupdocs viewer for .NET actually returns images for pdfs and not entire PDF file.
Any workaround would be good for this. Thanks!

@sachinerande

I got your point, and I believe it is valid when you want to protect the data from being copied. We’ll take a look at how it can be fixed. As a temporary fix you can hide download and print buttons.

var builder = WebApplication.CreateBuilder(args);

builder.Services
    .AddGroupDocsViewerUI((config) =>
    {
        config.DisableFileDownload();
        config.DisablePrint();
    });

See sample-app.zip (89.8 KB) as an example.

Thanks @vladimir.litvinchik , when do you think it will get resolve or at least any workaround to let printing works.

@sachinerande

This week we’ll take a look closer at this issue. At the moment we considering to print PDF which is assembled with JPEG images instead of printing JPEG images. By taking this approach the UI part won’t be changed and users won’t be able to copy the text. Will it work for you?

1 Like

Hi @vladimir.litvinchik
If my understanding is correct images are rendered first in backend and those are sent to browser.
Now you are going to render all and assemble that into single pdf, and return that file for printing.
is that right ? as long as we print images which gets rendered in browser this should be fine.

@sachinerande

Yes, that’s right. Thank you for the feedback.

1 Like

Hi @vladimir.litvinchik : any rough idea when do you think this would be released.
thanks!

@sachinerande

At the moment, I’m not ready to share the ETA for this issue. We’ll investigate it this week in detail and share update with you.

1 Like

@sachinerande

After considering this feature we decided to implement changes to print images instead of creating PDF file as adds overhead since we need to build PDF file when we already have images.

Thanks @vladimir.litvinchik, no problem, hope that will print all pages (entire pdf) just not the one that got rendered.

@sachinerande

Sure, all the pages should be printed.

1 Like

Thanks @vladimir.litvinchik , when likely do you think this would be released?

@sachinerande

I’m sorry for the delayed response. We have planned this feature for implementation for the next week. We’ll let you know in case of any updates.

1 Like

Hi @vladimir.litvinchik just chasing up on this to make sure this is in progress. thanks!

@sachinerande

This task is in our plans for implementation. We’ll keep you updated.

Thanks @vladimir.litvinchik, appreciate if follow-up can be done for this and picked up earliest, as we are blocked on this now.

@sachinerande

Sure, as soon as I have any updates I’ll notify you here.

1 Like

@sachinerande

To fix this issue please update GroupDocs.Viewer.UI to the latest version 6.0.20.

<PackageReference Include="GroupDocs.Viewer.UI" Version="6.0.20" />

When viewer type is set to ViewerType.Png or ViewerType.Jpg PNG or JPEG images will be printed instead of PDF file.

Please check this changes with your typical files and let us know if it fulfils your requirements.

1 Like

Thanks very much @vladimir.litvinchik for having good progress on this.
However I have noticed few issues with the printing now

  1. One empty page (contains “Print window” text) is added before every actual page. that doubles no of pages being printed (in both portrait and landscape mode).
    could you please have a look on it and get that removed.
    empty_page.PNG (3.4 KB)

  2. All pages are not printed in first attempt, only preload page count set pages are printed along with empty pages mentioned in point 1.
    E.g. when say a pdf containing 10 pages, and preload page count is set 2.
    Once viewer is loaded first 2 pages got rendered.
    Click on print button (note there is some delay here to load all pages from backend)
    Print window opens with only 2 pages along with 3 empty pages as mentioned in point 1.
    Close print window
    Click again on print button. All pages are now in print window along with the empty pages.
    I think this issue also needs a fix.

  3. After clicking print button, there could be some popup showing loading all document pages for printing, so user might know something is happening. (old viewer had this).

  4. Header of the every print page is simply “Print window”. I think this can be actual page title under which iframe is loaded (the one that appears on the browser tab) - old viewer had this

@sachinerande

Thank you for the feedback. We’ll take a look. What browser do you use?

1 Like