Using ASP.NET MVC PDF Viewer/Reader
C#: how to customize comments, markup settings in asp.net pdf viewer


Online Guide for customizing ASP.NET PDF Viewer & Editor using C#, html, javascript















1. Set annotation default properties cookie live time


In RasterEdge_WebApp.js, initWebApplication(), you can set your preferred cookie expiring dates.

setCookieExpires(7);//day







2. Enable continuous annotations


To enable continuous annotation adding, please do the following change:

  1. Open /RasterEdge_Resource_Files/Javascript/RasterEdge_WebApp_Customize.js
  2. In JS function “initCustomize”, change supportContinuousAnnotationAdding(false); to true;







3. Enable continuous text redact & area redact


To enable continuous adding text redactions and area redactions, please do the following change:

  1. Open /RasterEdge_Resource_Files/Javascript/RasterEdge_WebApp_Customize.js
  2. In JS function “initCustomize”, change supportContinuousRedactAdding(false);; to true;







4. Create a new stamp annotation


To create a new dynamic stamp annotation

1. Define a new stamp annotation icon in "Comment" toolbar using css. You may need change stamp toolbar icon location

.stampVOID {background-size:100% 100%;background-image:url('../images/stamp/VOID.png') ;background-repeat: no-repeat;}


2. Insert new stamp annotation to the toolbar using JS. In JS file /RasterEdge_Resource_Files/Javascript/RasterEdge_WebApp_Customize.js, in function "function initCustomizedStampCommands()", add the following code:

{ name: 'VOID', width: 120, height: 64, color: "#c00000", cssClass: "VOID" },


3. Run the web program, you will find a new dynamic stamp annotation "VOID" added to the stamp annotations panel.



To create a new image stamp annotation

1. Define a new stamp annotation icon in "Comment" toolbar using css. You may need change stamp toolbar icon file location

.stampCustomStamp {
      background-size:100% 100%;
      background-image:url('../images/stamp/CustomStamp.png');
      background-repeat: no-repeat;
}


2. Insert new stamp annotation to the toolbar using JS. In JS file /RasterEdge_Resource_Files/Javascript/RasterEdge_WebApp_Customize.js, in function "function initCustomizedStampCommands()", add the following code:

{ name: 'CustomStamp', width: 120, height: 64, cssClass: "CustomStamp", CustomStampName: "CustomStamp.png" },


3. In Web.Config file <appSettings>, Define all of your image stamp annotation image files server side location

<add key="reCustomStampFolder" value="RasterEdge_Resource_Files/images/stamp"/>


4. Run the web program, you will find a new image stamp annotation added to the stamp annotations panel.







5. Get user mouse click coordinates


To get the user mouse last click coordinates, please use the following sample JavaScript codes in file
/RasterEdge_Resource_Files/Javascript/RasterEdge_WebApp_Customize.js

-------RasterEdge_WebApp_Customize.js-------------

function getLastCoordinates() {
    // get the cooradinates of the last time under Select mode
    var location = getCoordinatesInDocPage();
    if (location != null)
        console.log("x,y:(" + location.x + "," + location.y + "),pageindex:" + location.pageIndex);
}
var getCoordinates = function (location) {
    // get the cooradinates under Select mode,call by system after mouse down
    //if (location != null)
    //    console.log("x,y:(" + location.x + "," + location.y + "),pageindex:" + location.pageIndex);
}
--------------------