After you have setup a new ASP.NET project with EdgePDF integrated, you may need disable the following functions to protect your PDF documents in the web browser
Save modified PDF file
Convert PDF documents to other file formats
Print PDF file
How to view PDF and disable document save and export function in web browser
5. Copy the folder "/DemoProjects/EdgePDF Demo Project/RasterEdge_Resource_Files" and all its contents to the sample project.
6. Add new entries to the Web.config file.
Insert the following contents to tag <appSettings>:
<!-- the cache folder --><addkey="reCacheFolder"value="RasterEdge_Cache"/><addkey="reCustomStampFolder"value="RasterEdge_Resource_Files/images/stamp"/><!-- set the server folder if you want to open the file on server--><addkey="reDefaultFolder"value="RasterEdge_Demo_Docs"/><!-- set the default file when open the web first time,if set "" ,this function is disabled. (reDefaultFolder needed) --><addkey="reDefaultFilePath"value=""/><!-- image quality in PDF document --><addkey="rePageImageZoom"value="2"/><addkey="reImageZoom"value="2"/><!-- image annotation in PDF document --><addkey="reAnnotationImageZoom"value="2"/><!-- write log --><addkey="reOutputLogData"value="true"/><!-- if true, SDK will automatically convert many shape and path inside PDF page into image--><!-- default is false --><!-- DEBUG ,INFO ,WARNING,ERROR --><addkey="reLogLevel"value="DEBUG"/><addkey="reWDPFileCacheMaxLimit"value="0"/><addkey="reIntelliDrawShapesToImage"value="true"/><!-- if reIntelliDrawShapesToImage is true, --><!-- valid values are: "all", "firefox", "chrome", "ie", "edge", "salari", "others" if "all" included, ignore the rest; default is "all" --><addkey="reIntelliDrawShapesToImageSupportBrowsers"value="all"/><!-- set the type of the show page. Valid values: svg, png,html Default: svg --><addkey="reDocRenderEngine"value="svg"/><addkey="reRestfulFolder"value="c:/RasterEdge_Restful"/><addkey="reI18NFolder"value="/RasterEdge_Resource_Files/i18n/"/><addkey="reServerURL"value=""/><!-- set the domain for remote client--><!-- If true, SDK will automatically call ... after file has been uploaded. Deafult: false. --><addkey="autoProcessWholeDocument"value="false"/><!-- If true, SDK will automatically call ... after file has been uploaded. Default: false. --><addkey="autoIndexTextSearchWholeDocument"value="false"/>
Insert the following contents to tag <system.webServer>:
8. Disable 'Save', 'Save As', 'Print' buttons in the File toolbar.
Navigate to the JavaScript file {Project Root}/RasterEdge_Resource_Files/Javascript/
RasterEdge_WebApp.js
Replace function 'initFileToolbar' by following codes. It uncomments 6 code lines related to those buttons to disable.
function initFileToolbar() {
var tabFile =new CToolbar({ id:"files", name: i18n['tabtitle']['File'], reqDoc:false });
// File uploadvar fileUpIconGroup =new CToolbarIconGroup({ name: i18n['tabgroup']['FileUpload'] });
var uploadFile =new CToolbarIcon({ id:"re_func_upload", title: i18n['tabicon']['UploadPDF'], event:'showInitFileDialog("uploadPDF");', cssClass:"" });
fileUpIconGroup.addIcon(uploadFile);
var onlineFile =new CToolbarIcon({ id:"re_func_online", title: i18n['tabicon']['OpenPDF'], event:'showInitFileDialog("onlinefile");', cssClass:"" });
fileUpIconGroup.addIcon(onlineFile);
var otherFile =new CToolbarIcon({ id:"re_func_files", title: i18n['tabicon']['CreatePDFFromOther'], event:'showInitFileDialog("uploadOthers");', cssClass:"" });
fileUpIconGroup.addIcon(otherFile);
tabFile.addIconGroup(fileUpIconGroup);
// Save Filevar saveIconGroup =new CToolbarIconGroup({ name: i18n['tabgroup']['Save'] });
var saveFile =new CToolbarIcon({ id:"re_func_save", title: i18n['tabicon']['SavePDF'], event:'ShowDialog("save");', cssClass:"toolSaveIconDis" });
// Uncomment next 2 lines to disable Save File button.//saveIconGroup.addIcon(saveFile);//tabFile.addIconGroup(saveIconGroup);// Save Asvar saveAsIconGroup =new CToolbarIconGroup({ name: i18n['tabgroup']['SaveAs'] });
var exportFile =new CToolbarIcon({ id:"re_func_export", title: i18n['tabicon']['SaveAs'], event:'', cssClass:"toolExportIconDis" });
// Uncomment next 2 lines to disable Save As button.//saveAsIconGroup.addIcon(exportFile);//tabFile.addIconGroup(saveAsIconGroup);// Print var printIconGroup =new CToolbarIconGroup({ name: i18n['tabgroup']['Print'] });
var printFile =new CToolbarIcon({ id:"re_func_print", title: i18n['tabicon']['Print'], event:'', cssClass:"toolPrintIconDis" });
// Uncomment next 2 lines to disable Print File button.//printIconGroup.addIcon(printFile);//tabFile.addIconGroup(printIconGroup);// propertiesvar propertiesIconGroup =new CToolbarIconGroup({ name: i18n['tabgroup']['Prop'] });
var properties =new CToolbarIcon({ id:"re_func_properties", title: i18n['tabicon']['Prop'], event:'ShowProperties();', cssClass:"toolPropertiesIconDis" });
propertiesIconGroup.addIcon(properties);
tabFile.addIconGroup(propertiesIconGroup);
// settingvar settingsIconGroup =new CToolbarIconGroup({ name: i18n['tabgroup']['Setting'] });
var settings =new CToolbarIcon({ id:"re_func_settings", title: i18n['tabicon']['Setting'], event:'ShowSettings();', cssClass:"" });
settingsIconGroup.addIcon(settings);
tabFile.addIconGroup(settingsIconGroup);
addToolbarTab(tabFile);
}
Disable 'Customize' and 'RestFul API' toobar.
Navigate to the JavaScript file '{Project Root}/RasterEdge_Resource_Files/Javascript/
RasterEdge_WebApp_Customize.js'.
Uncomment 'addDemo();' and 'addRestfulAPI();' in the function 'initCustomize'.
9. Change the project target platform to "x86"
10. It is done. Now run the project.
Web browser navigate to 'http://localhost:[port]/', you can get the port number in the project properties page.
Next Steps
Download and try EdgePDF - ASP.NET PDF Editor Control with online support.
See the EdgePDF - ASP.NET PDF Editor Control SDK in action and check how much they can do for you.
Check out the prices. Purchase various licenses for your needs.