Sample Viewer application in WebForms .NET

Hi, i gone through the modern UI for viewer but the problem is I want to implement the Groupdocs viewer in my .net framework 4.5(simple webform ). So if you are having and sample source where viewer is implemented with aspx, aspx.cs and JS page only pls share.

Pls consider this as a high pirorty…

Thanks

1 Like

@Rajesh2312,

Please explore our GroupDocs.Viewer WebForms project.

Hi atirtahir,

Do u have javascript and jquery code for calling controller instead of angualr code for Groupdocs Viewer…

Pls reply as soon as possible.

Thanks & Regards
Rajesh

@Rajesh2312

We discontinued jQuery support and our all showcase projects are now in Anuglar. However, you can explore this project (it uses jQuery) to get an idea. But this is an old project that uses older version of the API.
Please note that GroupDocs.Viewer for .NET is a back-end, UI-Agnostic API. Hence, you can implemnet it in any of your .NET project that could use JS, jQuery or Angular at its front-end.
The core purpose of API is to render a source file to PDF, Image or HTML format (it depends on your use-case or business logic). Once the document is rendered, you can open the resultant (PDF, Image or HTML) file in browser using JS, jQuery or Angular.

No js file is fresent in this folder, can u hel me to get this JS files…

Downloads\GroupDocs.Viewer-for-.NET-WebForms-latest_jquery\GroupDocs.Viewer-for-.NET-WebForms-latest_jquery\src\Resources\common\js

error is showing: Severity Code Description Project File Line Suppression State
Error TS6053 File ‘C:/Users/rajeshc/Downloads/GroupDocs.Viewer-for-.NET-WebForms-latest_jquery/GroupDocs.Viewer-for-.NET-WebForms-latest_jquery/src/Resources/common/js/es6-promise.auto.js’ not found. GroupDocs.Viewer.WebForms JavaScript Content Files 1 Active

@Rajesh2312

Were you able to build the project successfully? These files will be downloaded on successful build/run.

Yes I got all the JS and CSS file but while running alication its showing 404 error for all the JS and CSS file.
image.png (44.2 KB)

Above issue regarding JS and CSS file issue got solved.

I have one last doubt why its running in 8080 port always, Every time I have to run the source then in browser I am having this url: http://localhost:50879/Viewer.aspx with site cannot be reached message

Then in new browser I have to open http://localhost:8080/viewer.

What I want is it should open the viewer in http://localhost:50879/Viewer.aspx only

plz provide the the solution…

@Rajesh2312

Please set default port in configuration.yml file.

Hi, Atirtahir,

I gone through this source: GitHub - groupdocs-viewer/GroupDocs.Viewer-for-.NET-WebForms at latest_jquery

Its working fine.

But instead of using controller I had written the code in aspx.cs page as a webmethod and I have added default document in .yml file. So,Now its hitting function loadDocument(callback{ through ajax call in viewer.js file and

But I facing issue in hitting webmethod, Its throughing some error image.png (28.3 KB)
because web method is using static keyword(It need to have all the function definition inside the scope of web method).

Can u give the edited source where LoadDocument(postedData, globalConfiguration.Viewer.GetPreloadPageCount() == 0); should have all the defination and initialization of all the function .

Then only I can able to call the webmethod.

Can u pls revert back as soon as possible.

Thanks & Regards
Rajesh Choudhary

@Rajesh2312

This project is to give you an idea how JS is used. But we have discontinued it’s support. As mentioned earlier, API is UI-Agnostic. Hence, you can develop your own document viewer application. Once source document is rendered, it’s up to you how you display the resultant files in browser.

Ok, thanks for the help, I am fine with Morder UI code.

I need one more help I am going through groupdocs annotation for MVC code, I want to load the document at the page load without choosing manual. I have configure default document in .yml file but still not able to load, can u share zip source which is loading document without manual…

ls revert as soon as possible.

Thanks & Regards
Rajesh Choudhary.

@Rajesh2312

Please share the updated .yml file. You can also point out the changes that you committed in the .yml file.

Below is my .yml file , you can see i have mention (defaultDocument: ‘AB.docx’).
This AB.docx is present in DocumentSamples/Annotation folder.

I have one more doubt if my document reside in share folder then where I have to mention that and what will be the sysntax for that, My share folder location is \172.16.3.130\fs\App_Data

################################################

Server configurations

################################################
server:
type: simple
applicationContextPath: /
adminContextPath: /admin
connector:
type: http
port: 8081

################################################

Application (global) configurations

################################################
application:
# License path
# Absolute path to GroupDocs license file
licensePath: ‘Licenses/GroupDocs.Annotation.NET.lic’

################################################

Common configurations

################################################
common:

File rewriting on document uploading

Set false to keep both files

Set true to replace files with same name

rewrite: true

Page navigation

Set false to disable document navigation (go to next, previous, last and first page)

pageSelector: true

Document download

Set false to disable document download

download: true

Document upload

Set false to disable document upload

upload: true

Document print

Set false to disable document print

print: true

File browser

Set false to disable document browse

browse: true

Set false to disable right mouse click

enableRightClick: true

################################################

GroupDocs.Viewer configurations

################################################
viewer:

Files directory path

Absolute path to files directory

filesDirectory: ‘DocumentSamples/Annotation’

Fonts path

Absolute path to custom fonts directory

fontsDirectory: ‘’

Default document

Absolute path to default document

defaultDocument: ‘AB.docx’

Pages preload

How many pages from a document should be loaded, remaining pages will be loaded on page scrolling

Set 0 to load all pages at once

preloadPageCount: 1

HTML rendering mode

Set false for image mode

Set true for HTML mode

htmlMode: true

Document zoom

Set false to disable document zooming

zoom: true

Document search

Set false to disable document text search

search: true

Thumbnails

Set false to disable thumbnails

thumbnails: true

Page rotation

Set false to disable pages rotation

rotate: true

Using cache

Set true to enable cache

cache: true

Set true to enable page rotation saving

saveRotateState: true

Enter text which will be used as a watermark

watermarkText: “”

Print secured documents mode

Set false to ignore document print security

Set true to check document print security

printAllowed: true

################################################

GroupDocs.Signature configurations

################################################
signature:

Files directory path

Absolute path to files directory

filesDirectory: ‘DocumentSamples/Signature’

Default document

Absolute or relative path to default document

defaultDocument: ‘’

Pages preload

How many pages from a document should be loaded, remaining pages will be loaded on page scrolling

Set 0 to load all pages at once

preloadPageCount: 0

Data directory path

Absolute path to signature cache files directory

dataDirectory: ‘’

Enable/disable text signature

textSignature: true

Enable/disable image signature

imageSignature: true

Enable/disable digital signature

digitalSignature: true

Enable/disable QR-Code signature

qrCodeSignature: true

Enable/disable Barcode signature

barCodeSignature: true

Enable/disable Stamp signature

stampSignature: true

Enable/disable Hand signature

handSignature: true

Enable/disable original document downloading

downloadOriginal: true

Enable/disable signed document downloading

downloadSigned: true

################################################

GroupDocs.Annotation configurations

################################################
annotation:

Files directory path

Absolute or relative path to files directory

filesDirectory: ‘DocumentSamples/Annotation’

Default document

Absolute or relative path to default document

defaultDocument: ‘’

Pages preload

How many pages from a document should be loaded, remaining pages will be loaded on page scrolling

Set 0 to load all pages at once

preloadPageCount: 0

Output directory path

Absolute path to annotated files directory

outputDirectory: ‘’

Fonts path

Absolute path to custom fonts directory

fontsDirectory: ‘’

Enable/disable Text annotation

textAnnotation: true

Enable/disable Area annotation

areaAnnotation: true

Enable/disable Point annotation

pointAnnotation: true

Enable/disable TextStrikeout annotation

textStrikeoutAnnotation: true

Enable/disable Polyline annotation

polylineAnnotation: true

Enable/disable TextField annotation

textFieldAnnotation: true

Enable/disable Watermark annotation

watermarkAnnotation: true

Enable/disable TextReplacement annotation

textReplacementAnnotation: true

Enable/disable Arrow annotation

arrowAnnotation: true

Enable/disable TextRedaction annotation

textRedactionAnnotation: true

Enable/disable ResourcesRedaction annotation

resourcesRedactionAnnotation: true

Enable/disable TextUnderline annotation

textUnderlineAnnotation: true

Enable/disable Distance annotation

distanceAnnotation: true

Enable/disable original document downloading

downloadOriginal: true

Enable/disable signed document downloading

downloadAnnotated: true

Enable/disable zoom

zoom: true

Enable/disable fit width

set true to zoom document pages fit width

fitWidth: true

################################################

GroupDocs.Comparison configurations

################################################
comparison:

Files directory path

Absolute path to files directory

filesDirectory: ‘DocumentSamples/Comparison’

FResult files directory path

Absolute path to result files directory

resultDirectory: ‘’

Result pages preload

How many pages from a result document should be loaded, remaining pages will be loaded on page scrolling

Set 0 to load all pages at once

preloadResultPageCount: 2

Enable/disable multi comparing feature

multiComparing: true

@Rajesh2312

This issue is resolved at our end. You’ll be notified once we release the fix.

OK, thanks for replying, want to know where I will be getting the notification for this fix Via mail or notification in this loop message.

@Rajesh2312

We’ll notify you here in the same thread.

Ok thanks will be waiting

I have a new requirement, I am looking for source for adding formfield through UI and after creating form user can download as a pdf.

I already gone through Asopose pdf source available in the github but its not having any UI (No able to achieve the requirement that the user can add form field while clicking in the UI).
Its having only C# code

Thanks & Regards
Rajesh

@Rajesh2312

This issue is now fixed. Please pull latest release.

Please note that Aspose.PDF is a back-end, UI-Agnostic API that you can implement in any of your .NET project. In case of any Aspose related queries, please post here.