Toolkit Standard 2011

Alphabetical List
AddBookmarks
AddExternalLinkBookmark
AddInternalLinkBookmark
AddLaunchBookmark
AddRelatedQuery
AddTextBookmark
AddURLBookmark
Author
BBHeight
BBLeft
BBTop
BBWidth
ClearHeaderInfo
ClearQueries
CloseOutputFile
CopyForm
CreateDate
Creator
DBToForm
DoFormFormatting
DrawTo
EncryptFile
EncryptFile128
EncryptFileAES
FieldInfo
FlattenRemainingFormFields
ForceColorReset
ForceHeaderColorReset
FormNumbering
GetBoundingBox
GetHeaderTextWidth
GetInputPageRotation
GetPDFInfo
GetTextWidth
GetUniqueFileName
GotoNextBookmarkLevel
GotoPreviousBookmarkLevel
GreyBar
ImageRotation
InputByteArray
InputByteStream
IsFileLinearized
JPEGToPDF
Keywords
LinearizeFile
LineWidth
LoadDBMapFile
MergeFile
ModDate
MoveTo
NewPage
NumPages
OpenInputFile
OpenOutputFile
OutputByteStream
OutputPageHeight
OutputPageWidth
PrintImage
PrintJPEG
PrintMultilineText
PrintText
PrintTIFF
Producer
ReadOnlyOnMerge
RelatedQuerySeparator
ResetFormFields
ResetHeaderTextColor
ResetHeaderTextTransparency
ResetTextColor
ResetTextTransparency
SaveMemoryToDisk
SetDBInputTemplate
SetDBMultiRowSeparator
SetDefaultDBMergeFlag
SetFont
SetFormFieldData
SetHeaderFont
SetHeaderGreyBar
SetHeaderHLine
SetHeaderImage
SetHeaderJPEG
SetHeaderMultilineText
SetHeaderRotation
SetHeaderText
SetHeaderTextBackground
SetHeaderTextColor
SetHeaderTextColorCMYK
SetHeaderTextFillMode
SetHeaderTextStrokeColor
SetHeaderTextStrokeColorCMYK
SetHeaderTextTransparency
SetHeaderTIFF
SetHeaderVLine
SetHeaderWPgNbr
SetInfo
SetInputBookmark
SetMasterQuery
SetOutputSecurity
SetOutputSecurity128
SetOutputSecurityAES
SetTextColor
SetTextColorCMYK
SetTextFillMode
SetTextRotation
SetTextStrokeColor
SetTextStrokeColorCMYK
SetTextTransparency
SetViewerPreferences
Subject
TIFFToPDF
Title
ToolkitVersion
XMLSetFormFieldData
Bookmarks
AddBookmarks
AddExternalLinkBookmark
AddInternalLinkBookmark
AddLaunchBookmark
AddTextBookmark
AddURLBookmark
GotoNextBookmarkLevel
GotoPreviousBookmarkLevel
SetInputBookmark
Convert to PDF
JPEGToPDF
TIFFToPDF
Database
AddRelatedQuery
ClearQueries
LoadDBMapFile
RelatedQuerySeparator
SetDBInputTemplate
SetDBMultiRowSeparator
SetDefaultDBMergeFlag
SetMasterQuery
Debug
ToolkitVersion
Drawing
DrawTo
GreyBar
LineWidth
MoveTo
SetHeaderGreyBar
SetHeaderHLine
SetHeaderVLine
Fields
DBToForm
DoFormFormatting
FieldInfo
FlattenRemainingFormFields
FormNumbering
ResetFormFields
SetFormFieldData
XMLSetFormFieldData
File Input
OpenInputFile
File Output
CloseOutputFile
GetUniqueFileName
OpenOutputFile
Memory
InputByteArray
InputByteStream
OutputByteStream
SaveMemoryToDisk
Merging
MergeFile
ReadOnlyOnMerge
Metadata
Author
CreateDate
Creator
GetPDFInfo
Keywords
ModDate
Producer
SetInfo
Subject
Title
PDF Information
BBHeight
BBLeft
BBTop
BBWidth
GetBoundingBox
GetInputPageRotation
NumPages
Page Control
OutputPageHeight
OutputPageWidth
Pages
CopyForm
NewPage
Security (PDF)
EncryptFile
EncryptFile128
EncryptFileAES
SetOutputSecurity
SetOutputSecurity128
SetOutputSecurityAES
Stamping
ClearHeaderInfo
ForceColorReset
ForceHeaderColorReset
GetHeaderTextWidth
GetTextWidth
ImageRotation
PrintImage
PrintJPEG
PrintMultilineText
PrintText
PrintTIFF
ResetHeaderTextColor
ResetHeaderTextTransparency
ResetTextColor
ResetTextTransparency
SetFont
SetHeaderFont
SetHeaderImage
SetHeaderJPEG
SetHeaderMultilineText
SetHeaderRotation
SetHeaderText
SetHeaderTextBackground
SetHeaderTextColor
SetHeaderTextColorCMYK
SetHeaderTextFillMode
SetHeaderTextStrokeColor
SetHeaderTextStrokeColorCMYK
SetHeaderTextTransparency
SetHeaderTIFF
SetHeaderWPgNbr
SetTextColor
SetTextColorCMYK
SetTextFillMode
SetTextRotation
SetTextStrokeColor
SetTextStrokeColorCMYK
SetTextTransparency
View
SetViewerPreferences
Web View
IsFileLinearized
LinearizeFile

ForceHeaderColorReset

Example code is for an older version of Toolkit, newer code is available.
// Copyright (c) 2019 ActivePDF, Inc.
// ActivePDF Toolkit Standard 2011
// Example generated 10/17/19 

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;
    int intOpenOutputFile;
    int intOpenInputFile;
    string strTitle;
    float textWidth;
    int intCopyForm;
    
    strPath = System.AppDomain.CurrentDomain.BaseDirectory;

    // Instantiate Object
    APToolkitNET.Toolkit oTK = new APToolkitNET.Toolkit();
    
    // Create the new PDF file
    intOpenOutputFile = oTK.OpenOutputFile(strPath + "new.pdf");
    if (intOpenOutputFile != 0)
    {
      ErrorHandler("OpenOutputFile", intOpenOutputFile);
    }
    
    // Open the template PDF
    intOpenInputFile = oTK.OpenInputFile(strPath + "PDF.pdf");
    if (intOpenInputFile != 0)
    {
      ErrorHandler("OpenInputFile", intOpenInputFile);
    }
    
    // Add a 'Confidential' watermark by setting text transparency
    // Rotation and color of the text along with the fill mode are set
    oTK.SetHeaderFont("Helvetica", 90);
    oTK.SetHeaderTextTransparency(0.6f, 0.6f);
    oTK.SetHeaderRotation(45);
    oTK.SetHeaderTextStrokeColor(255, 0, 0, 0);
    oTK.SetHeaderTextFillMode(1);
    oTK.SetHeaderText(154, 184, "Confidential");
    oTK.ResetHeaderTextTransparency();
    oTK.SetHeaderTextFillMode(0);
    
    // Add a 'Top Secret' watermark by placing text in the foreground
    oTK.SetHeaderFont("Helvetica", 72);
    oTK.SetHeaderTextBackground(1);
    oTK.SetHeaderTextColor(200, 200, 200, 0);
    oTK.SetHeaderText(154, 300, "Top Secret");
    oTK.ResetHeaderTextColor();
    oTK.SetHeaderRotation(0);
    
    // Add the document title to the bottom center of the page
    oTK.SetHeaderFont("Helvetica", 12);
    strTitle = "Lorem Ipsum";
    textWidth = oTK.GetHeaderTextWidth(strTitle);
    oTK.SetHeaderText((612 - textWidth) / 2, 32, strTitle);
    
    // Add page numbers to the bottom left of the page
    oTK.SetHeaderFont("Helvetica", 12);
    oTK.SetHeaderWPgNbr(72, 32, "Page %p", 1);
    
    // Add a mulitline print box for an 'approved' message in header
    oTK.SetHeaderTextFillMode(2);
    oTK.SetHeaderTextColorCMYK(0, 0, 0, 20);
    oTK.SetHeaderTextStrokeColorCMYK(0, 0, 0, 80);
    oTK.SetHeaderMultilineText("Helvetica", 22, 344, 766, 190, 86, "Approved on January 17th, 2021", 2);
    oTK.ForceHeaderColorReset();
    
    // Add some lines to the footer and top right corner of the page
    oTK.SetHeaderGreyBar(72, 52, 468, 1, 0.8f);
    oTK.SetHeaderHLine(340, 544, 724, 1);
    oTK.SetHeaderVLine(724, 648, 544, 1);
    
    // Use the Header Image properties to add some images to the footer
    oTK.SetHeaderImage(strPath + "BMP.bmp", 375.0f, 13.0f, 0.0f, 0.0f, true);
    oTK.SetHeaderJPEG(strPath + "JPEG.jpg", 436.0f, 9.0f, 0.0f, 0.0f, true);
    oTK.SetHeaderTIFF(strPath + "TIFF.tif", 500.0f, 15.0f, 0.0f, 0.0f, true);
    
    // Copy the template (with the stamping changes) to the new file
    // Start page and end page, 0 = all pages
    intCopyForm = oTK.CopyForm(0, 0);
    if (intCopyForm != 1)
    {
      ErrorHandler("CopyForm", intCopyForm);
    }
    
    // Close the new file to complete PDF creation
    oTK.CloseOutputFile();
    
    // Release Object
    oTK.Dispose();
    
    // Process Complete
    WriteResults("Done!");
  }
  
  // Error Handling
  public static void ErrorHandler(string strMethod, object rtnCode)
  {
    WriteResults(strMethod + " error:  " + rtnCode.ToString());
  }
  
  // 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 © 2019 ActivePDF, Inc