WebGrabber 2016

Alphabetical List
AddEMail
AddEMailAttachment
AddFTPAttachment
AddFTPRequest
AddHTTPPostData
AddStampCollection
AddStampImage
AddStampText
AddToBcc
AddToCC
ASCIIEncode
AuthenticName
AuthenticPassword
AutoRotate
BookmarkElementSelectors
ClearEmailAttachments
ClearEMails
ClearFooterHTML
ClearFTPAttachments
ClearFTPs
ClearHeaderHTML
ClearHTTPPostData
ClearStampCollections
ColorImageDownsampleThreshold
ColorImageDownsampleType
ColorImageFilter
ColorImageResolution
ConvertCMYKToRGB
ConvertToPDF
CreateFromHTMLText
Debug
EMailAttachOutput
EMailReadReceipt
EMailSubject
EmbedAllFonts
EmbedBase14Fonts
EmbedFlash
EngineToUse
FooterHeight
FooterHTML
FTPAttachOutput
GenerateBookmarks
GenerateLinks
GrayImageDownsampleThreshold
GrayImageDownsampleType
GrayImageFilter
GrayImageResolution
HeaderHeight
HeaderHTML
HTMLTextToFile
InvisiblySignFile
LinearizePDF
MonoImageDownsampleThreshold
MonoImageDownsampleType
MonoImageFilter
MonoImageResolution
NewDocumentName
Orientation
OutputDirectory
OverwriteMethod
PDFLength
PDFWidth
PreserveButtons
PreserveCheckboxes
PreserveDropdowns
PreserveRadioButtons
PreserveTextboxes
PrintBackground
ProxyPortHTTP
ProxyServerHTTP
ProxyServerPassword
ProxyServerUserName
RemoveEMail
RemoveFTP
RemoveStampCollection
Resolution
SavePostScript
SetEMailBody
SetFTPCredentials
SetMargins
SetMetadata
SetPageNbrParams
SetPDFSecurity
SetPDFSecurity128
SetPDFSecurityAES
SetRecipientInfo
SetReplyToInfo
SetSenderInfo
SetSMTPCredentials
SetSMTPInfo
SetStampColor
SetStampStrokeColor
StampBackground
StampColorNET
StampFillMode
StampFont
StampFontSize
StampFontTransparency
StampRotation
StampStrokeColorNET
SubsetFonts
Timeout
TimeoutSpan
URL
Bookmarks
BookmarkElementSelectors
GenerateBookmarks
Color
ConvertCMYKToRGB
Convert to PDF
ConvertToPDF
Debug
Debug
SavePostScript
Digital Certificates
InvisiblySignFile
Email
AddEMail
AddEMailAttachment
AddToBcc
AddToCC
ClearEmailAttachments
ClearEMails
EMailAttachOutput
EMailReadReceipt
EMailSubject
RemoveEMail
SetEMailBody
SetRecipientInfo
SetReplyToInfo
SetSenderInfo
SetSMTPCredentials
SetSMTPInfo
FTP
AddFTPAttachment
AddFTPRequest
ClearFTPAttachments
ClearFTPs
FTPAttachOutput
RemoveFTP
SetFTPCredentials
File Output
NewDocumentName
OutputDirectory
OverwriteMethod
Flash
EmbedFlash
Fonts
EmbedAllFonts
EmbedBase14Fonts
SubsetFonts
HTML Engine
EngineToUse
HTML Input
AddHTTPPostData
ClearHTTPPostData
CreateFromHTMLText
HTMLTextToFile
URL
Headers & Footers
ClearFooterHTML
ClearHeaderHTML
FooterHeight
FooterHTML
HeaderHeight
HeaderHTML
SetPageNbrParams
Image Quality
ColorImageDownsampleThreshold
ColorImageDownsampleType
ColorImageFilter
ColorImageResolution
GrayImageDownsampleThreshold
GrayImageDownsampleType
GrayImageFilter
GrayImageResolution
MonoImageDownsampleThreshold
MonoImageDownsampleType
MonoImageFilter
MonoImageResolution
Intelligent PDF Conversion
PreserveButtons
PreserveCheckboxes
PreserveDropdowns
PreserveRadioButtons
PreserveTextboxes
Links
GenerateLinks
Metadata
SetMetadata
Other Output Options
ASCIIEncode
PrintBackground
PDF Quality
Resolution
Page Control
AutoRotate
Orientation
PDFLength
PDFWidth
SetMargins
Proxy
ProxyPortHTTP
ProxyServerHTTP
ProxyServerPassword
ProxyServerUserName
Security (PDF)
SetPDFSecurity
SetPDFSecurity128
SetPDFSecurityAES
Security (Web)
AuthenticName
AuthenticPassword
Stamping
AddStampCollection
AddStampImage
AddStampText
ClearStampCollections
RemoveStampCollection
SetStampColor
SetStampStrokeColor
StampBackground
StampColorNET
StampFillMode
StampFont
StampFontSize
StampFontTransparency
StampRotation
StampStrokeColorNET
Timeout
Timeout
TimeoutSpan
Web View
LinearizePDF

SetPDFSecurityAES

// Copyright (c) 2017 ActivePDF, Inc.
// ActivePDF WebGrabber 2016
// Example generated 10/18/17 

using System;

// Make sure to add the ActivePDF product .NET DLL(s) to your application.
// .NET DLL(s) are typically found in the products 'bin' folder.

class Examples
{
  public static void Example()
  {
    string strPath;
    WebGrabberDK.Results.WebGrabberResult results;
    
    strPath = System.AppDomain.CurrentDomain.BaseDirectory;

    // Instantiate Object
    APWebGrabber.WebGrabber oWG = new APWebGrabber.WebGrabber();
    
    // Set AES encryption on PDF output
    // AES 128 bit encryption supported in Acrobat 7+
    // A blank user password will allow the PDF to open without a password
    oWG.SetPDFSecurityAES("userpass", "ownerpass", true, true, true, true, true, true, true, true);
    
    // Enable extra logging (logging should only be used while troubleshooting)
    // C:\ProgramData\activePDF\Logs\
    oWG.Debug = true;
    
    // Fast web view
    oWG.LinearizePDF = true;
    
    // Time to wait for conversion to complete (in seconds)
    // Set the amount of time before a request will time out
    oWG.TimeoutSpan = new TimeSpan(0, 0, 40);
    
    // Margins (Top, Bottom, Left, Right) 1.0 = 1"
    oWG.SetMargins(0.75f, 0.75f, 0.75f, 0.75f);
    
    // 0 = Portrait, 1 = Landscape
    oWG.Orientation = 0;
    
    // Rendering engine used for the HTML
    // 0 = Native, 1 = IE
    oWG.EngineToUse = APWebGrabberInterface.ConversionEngine.Native;
    
    // Convert HTML fields to PDF fields
    oWG.PreserveButtons = false;
    oWG.PreserveCheckBoxes = false;
    oWG.PreserveDropDowns = false;
    oWG.PreserveRadioButtons = false;
    oWG.PreserveTextBoxes = false;
    
    // Convert links
    oWG.GenerateLinks = APWebGrabberInterface.LinkStyle.Both;
    
    // Convert h tags into bookmarks
    oWG.GenerateBookmarks = true;
    
    // Enable flash conversion
    oWG.EmbedFlash = 1;
    
    // PDF output location and filename
    oWG.OutputDirectory = strPath;
    oWG.NewDocumentName = "secureAES.pdf";
    
    // HTML to convert
    // Examples:
    // http://domain.com/path/file.aspx
    // c:\folder\file.html
    oWG.URL = "http://examples.activepdf.com/samples/doc";
    
    // Perform the HTML to PDF conversion
    results = oWG.ConvertToPDF();
    if (results.WebGrabberStatus != WebGrabberDK.Results.WebGrabberStatus.Success)
    {
      ErrorHandler("ConvertToPDF", results, results.WebGrabberStatus.ToString());
    }
    
    // Release Object
    oWG = null;
    
    // Process Complete
    WriteResults("Done!");
  }
  
  // Error Handling
  public static void ErrorHandler(string strMethod, ADK.Results.Result results, string errorStatus)
  {
    WriteResults("Error with " + strMethod);
    WriteResults(errorStatus);
    WriteResults(results.Details);
    if (results.Origin.Function != strMethod)
    {
      WriteResults(results.Origin.Class + "." + results.Origin.Function);
    }
    if (results.ResultException != null)
    {
      // To view the stack trace on an exception uncomment the line below
      //WriteResults(results.ResultException.StackTrace);
    }
    Environment.Exit(1);
  }
  
  // Write output data
  public static void WriteResults(string content)
  {
    // Choose where to write out results
  
    // Debug output
    //System.Diagnostics.Debug.WriteLine("ActivePDF: * " + content);
  
    // Console
    Console.WriteLine(content);
  
    // Log file
    //using (System.IO.TextWriter writer = new System.IO.StreamWriter(System.AppDomain.CurrentDomain.BaseDirectory + "application.log", true))
    //{
    //    writer.WriteLine("[" + DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss") + "]: => " + content);
    //}
  }
}

Copyright © 2017 ActivePDF, Inc