We're sorry GroupDocs doesn't work properply without JavaScript enabled.

Free Support Forum - groupdocs.com

How to run ASP.NET Web Forms C#, .NET Framework 2.0 Demo


I have to test viewer. I ran the samples on git but it failed.
Please send the sample source code.
ASP.NET Web Forms C#, .net framework 2.0
If successful, I should buy it right away and go ahead with the project.

email : radian75@prmsys.co.kr

Please reply as soon as possible.


This Topic is created by vladimir.litvinchik using Email to Topic tool.


We provide ASP.NET Web Forms Demo that is available on GitHub. The project is targeting .NET Framework 4.8.

Do you strictly bound to .NET Framework 2.0?

Download a minimal demo project that is targeting .NET Framework 2.0 from Dropbox.

You can evaluate Viewer without a license or request a temporary license. See the Licensing topic for more information.

Yes. I will only add a viewer function to an existing project.
.net framework upgrade is not planned for this project.

Thank you for your help.


Got it, thank you for the feedback!


I have a few questions during the test.
I’m running the test with ‘WebFormsMinimal_NET_Framework_2.0’.

1.I need to show the selected file right after loading.
2.The directory select button should be removed.
3.For security reasons, the text of the document should not be copied.

I looked at the source code, but I don’t know which part to modify.
Please help.


There are a couple of options here

  1. Set the default document in the config. Open ConfigHandler.cs and specify the document to open by default e.g. defaultDocument = "resume.docx"
  2. Do the same using query string parameter file e.g. http://localhost:61344/?file=resume.docx

To disable the file browser button Open ConfigHandler.cs and set browse = false.

Two options here:

  1. You can disable right-click on the document in ConfigHandler.cs and set enableRightClick= false.
  2. You can render the document to PNG or JPEG instead of HTML but you won’t be able to perform a search.

Thank you for your kind help.
I’ve tested a few more, and I have a question.

htmlMode = false,
No images are output.
Is it possible to display only some specific pages as images? ex)1-3

watermarkText = “opened by radian75 2022/11/15 12:10”,
No watermark is displayed.


You’re welcome!

I’ve added support for image mode to the sample app.

See the following topics for more information: Render to HTML and Render to PNG or JPEG.

HTML or Image mode is supported.

I’ve also added support for watermarks to the sample app. See Watermark class reference for the supported options.

You’re awesome.

I tested the watermark. However, I only get a screen like the one below.
It seems that it is a temporary license, is it right?
image.png (7.8 KB)

And then, If there are many pages in the document, I would like to implement loading of only some of the pages due to loading time.
I simply implemented it as below, but if there is a better way, please advise.

var pages = new List<PageDesc>();
foreach (var page in viewInfo.Pages)
    if (page.Number > 3) { break; }
    pages.Add(new PageDesc
        Width = page.Width,
        Height = page.Height,
        SheetName = page.Name,
        Number = page.Number,

Have a good day.


You’re welcome!

The solution you’ve shared should work well.

Can you please share a complete browser screenshot so I could see how it is rendering?

image.png (344.8 KB)

Send a screen capture. Please advice.

image.png (42.8 KB)

Thank you for your help.


Unfortunately, I can’t reproduce this issue. Here is the output that I’ve got watermark.png (135.6 KB). Can you please make sure you’re using the latest version of a sample app? You can also make sure that Watermark property initialized as following viewOptions.Watermark = new Watermark(WatermarkText);.

I downloaded again.
And then I made sure that the corresponding source code is used.
image.png (113.3 KB)
image.png (263.4 KB)

However, it is not watermarked like the capture.
I think it’s because of the license.



Can you please send me the app you’re running so I can reproduce the issue on my side including a license in case you have it?

I send you my test file.
Thank you for your helps.


Unfortunately, I can’t reproduce this issue on my side but there is a workaround. You can add a watermark using a bit of code.

 viewOptions = new PngViewOptions(
     number => new MemoryStream(),
     (number, stream) =>
         MemoryStream memoryStream = ((MemoryStream)stream);

         AddWatermark(memoryStream, WatermarkText);

         byte[] bytes = memoryStream.ToArray();
         string base64 = Convert.ToBase64String(bytes);

         pages.Add(new Page { Number = number, Data = base64 });


private static void AddWatermark(MemoryStream memoryStream, string watermarkText)
    using (Image bitmap = Image.FromStream(memoryStream))
    using (Graphics g = Graphics.FromImage(bitmap))
            new Font("Arial", 20, FontStyle.Regular),
            new SolidBrush(Color.Red),
            new PointF(10, 10));

        bitmap.Save(memoryStream, ImageFormat.Png);

Updated application: WebFormsMinimal_NET_Framework_2.0_CustomWatermark.zip

The following image demonstrates the result:

it’s wonderful.

Is it possible to transfer watermark value in Default.aspx.cs?
I can’t use get method and post method for security reasons.

Thank you so much.


The UI is designed in a way that it expects a service that will serve the data using GET and POST methods. The source code of the UI can be found at https://github.com/groupdocs-total/GroupDocs.Total-Angular.

Sorry, I checked the sample source, but I can’t figure out how to use it at all.
I just want to use config of watermark text.

protected const string WatermarkText = "My watermark";

watermarkText = "by roy 2022/12/01",

var config = new
    pageSelector = true,
    download = false,
    upload = false,
    print = true,
    browse = true,
    rewrite = false,
    enableRightClick = true,
    defaultDocument = string.Empty,
    *watermarkText = "by roy 2022/12/01",*
    preloadPageCount = 0,
    zoom = true,
    search = true,
    thumbnails = true,
    rotate = false,
    htmlMode = HtmlMode,
    cache = true,
    saveRotateState = true,
    printAllowed = true,
    showGridLines = true,
    cacheFolderName = string.Empty,
    showLanguageMenu = false,


I’m sorry for the delayed response. We’ll take a look and update you.