Aspose::Pdf::Facades::PdfContentEditor Class Referencefinal

Represents a class to edit PDF file's content. More...

Inherits Aspose::Pdf::Facades::SaveableFacade.

Public Member Functions

System::SharedPtr< Aspose::Pdf::Text::TextSearchOptionsget_TextSearchOptions ()
 Gets text search options. More...
 
void set_TextSearchOptions (System::SharedPtr< Aspose::Pdf::Text::TextSearchOptions > value)
 Sets text search options. More...
 
System::SharedPtr< Aspose::Pdf::Text::TextEditOptionsget_TextEditOptions ()
 Gets text edit options. More...
 
void set_TextEditOptions (System::SharedPtr< Aspose::Pdf::Text::TextEditOptions > value)
 Sets text edit options. More...
 
System::SharedPtr< Aspose::Pdf::Text::TextReplaceOptionsget_TextReplaceOptions ()
 Gets text replace options. More...
 
void set_TextReplaceOptions (System::SharedPtr< Aspose::Pdf::Text::TextReplaceOptions > value)
 Sets text replace options. More...
 
System::SharedPtr< Aspose::Pdf::Facades::ReplaceTextStrategyget_ReplaceTextStrategy ()
 A set of parameters for replace text operation More...
 
void set_ReplaceTextStrategy (System::SharedPtr< Aspose::Pdf::Facades::ReplaceTextStrategy > value)
 A set of parameters for replace text operation More...
 
virtual void BindPdf (System::String inputFile)
 Binds a PDF file for editing. More...
 
virtual void BindPdf (System::SharedPtr< System::IO::Stream > inputStream)
 Binds a PDF stream for editing. More...
 
System::SharedPtr< System::Collections::Generic::IList< System::SharedPtr< Aspose::Pdf::Annotations::Annotation > > > ExtractLink ()
 Extracts the collection of Link instances contained in PDF document. More...
 
void CreateWebLink (System::Drawing::Rectangle rect, System::String url, int32_t originalPage, System::Drawing::Color clr, System::ArrayPtr< System::SharedPtr< System::BoxedValueBase >> actionName)
 Creates a web link in PDF document. More...
 
void CreateWebLink (System::Drawing::Rectangle rect, System::String url, int32_t originalPage, System::Drawing::Color clr)
 Creates a web link in PDF document. More...
 
void CreateWebLink (System::Drawing::Rectangle rect, System::String url, int32_t originalPage)
 Creates a web link in PDF document. More...
 
void CreateLocalLink (System::Drawing::Rectangle rect, int32_t desPage, int32_t originalPage, System::Drawing::Color clr, System::ArrayPtr< System::SharedPtr< System::BoxedValueBase >> actionName)
 Creates a local link in PDF document. More...
 
void CreateLocalLink (System::Drawing::Rectangle rect, int32_t desPage, int32_t originalPage, System::Drawing::Color clr)
 Creates a local link in PDF document. More...
 
void CreatePdfDocumentLink (System::Drawing::Rectangle rect, System::String remotePdf, int32_t originalPage, int32_t destinationPage, System::Drawing::Color clr, System::ArrayPtr< System::SharedPtr< System::BoxedValueBase >> actionName)
 Creates a link to another PDF document page. More...
 
void CreatePdfDocumentLink (System::Drawing::Rectangle rect, System::String remotePdf, int32_t originalPage, int32_t destinationPage, System::Drawing::Color clr)
 Creates a link to another PDF document page. More...
 
void CreatePdfDocumentLink (System::Drawing::Rectangle rect, System::String remotePdf, int32_t originalPage, int32_t destinationPage)
 Creates a link to another PDF document page. More...
 
void CreateCustomActionLink (System::Drawing::Rectangle rect, int32_t originalPage, System::Drawing::Color color, System::ArrayPtr< System::SharedPtr< System::BoxedValueBase >> actionName)
 Creates a link to custom actions in PDF document. More...
 
void CreateApplicationLink (System::Drawing::Rectangle rect, System::String application, int32_t page, System::Drawing::Color clr, System::ArrayPtr< System::SharedPtr< System::BoxedValueBase >> actionName)
 Creates a link to launch an application in PDF document. More...
 
void CreateApplicationLink (System::Drawing::Rectangle rect, System::String application, int32_t page, System::Drawing::Color clr)
 Creates a link to launch an application in PDF document. More...
 
void CreateApplicationLink (System::Drawing::Rectangle rect, System::String application, int32_t page)
 Creates a link to launch an application in PDF document. More...
 
void CreateJavaScriptLink (System::String code, System::Drawing::Rectangle rect, int32_t originalPage, System::Drawing::Color color)
 Creates a link to JavaScript in PDF document. More...
 
void CreateText (System::Drawing::Rectangle rect, System::String title, System::String contents, bool open, System::String icon, int32_t page)
 Creates text annotation in PDF document More...
 
void CreateFreeText (System::Drawing::Rectangle rect, System::String contents, int32_t page)
 Creates free text annotation in PDF document More...
 
void CreateMarkup (System::Drawing::Rectangle rect, System::String contents, int32_t type, int32_t page, System::Drawing::Color clr)
 Creates markup annotation it PDF document. More...
 
void CreatePopup (System::Drawing::Rectangle rect, System::String contents, bool open, int32_t page)
 Creates popup annotation in PDF document. More...
 
void CreateFileAttachment (System::Drawing::Rectangle rect, System::String contents, System::String filePath, int32_t page, System::String name)
 Creates file attachment annotation. More...
 
void CreateFileAttachment (System::Drawing::Rectangle rect, System::String contents, System::String filePath, int32_t page, System::String name, double opacity)
 Creates file attachment annotation. More...
 
void CreateFileAttachment (System::Drawing::Rectangle rect, System::String contents, System::SharedPtr< System::IO::Stream > attachmentStream, System::String attachmentName, int32_t page, System::String name)
 Creates file attachment annotation. More...
 
void CreateFileAttachment (System::Drawing::Rectangle rect, System::String contents, System::SharedPtr< System::IO::Stream > attachmentStream, System::String attachmentName, int32_t page, System::String name, double opacity)
 Creates file attachment annotation. More...
 
void AddDocumentAttachment (System::String fileAttachmentPath, System::String description)
 Adds document attachment with no annotation. More...
 
void AddDocumentAttachment (System::SharedPtr< System::IO::Stream > fileAttachmentStream, System::String fileAttachmentName, System::String description)
 Adds document attachment with no annotation. More...
 
void DeleteAttachments ()
 Deletes all attachments in PDF document. More...
 
void CreateLine (System::Drawing::Rectangle rect, System::String contents, float x1, float y1, float x2, float y2, int32_t page, int32_t border, System::Drawing::Color clr, System::String borderStyle, System::ArrayPtr< int32_t > dashArray, System::ArrayPtr< System::String > LEArray)
 Creates line annotation. More...
 
void CreateSquareCircle (System::Drawing::Rectangle rect, System::String contents, System::Drawing::Color clr, bool square, int32_t page, int32_t borderWidth)
 Creates square-circle annotation. More...
 
void DrawCurve (System::SharedPtr< LineInfo > lineInfo, int32_t page, System::Drawing::Rectangle annotRect, System::String annotContents)
 Creates curve annotation. More...
 
void CreatePolygon (System::SharedPtr< LineInfo > lineInfo, int32_t page, System::Drawing::Rectangle annotRect, System::String annotContents)
 Creates polygon annotation. More...
 
void CreatePolyLine (System::SharedPtr< LineInfo > lineInfo, int32_t page, System::Drawing::Rectangle annotRect, System::String annotContents)
 Creates polyline annotation. More...
 
void CreateCaret (int32_t page, System::Drawing::Rectangle annotRect, System::Drawing::Rectangle caretRect, System::String symbol, System::String annotContents, System::Drawing::Color color)
 Creates caret annotation. More...
 
void CreateRubberStamp (int32_t page, System::Drawing::Rectangle annotRect, System::String icon, System::String annotContents, System::Drawing::Color color)
 Creates a rubber stamp annotation. More...
 
void CreateRubberStamp (int32_t page, System::Drawing::Rectangle annotRect, System::String annotContents, System::Drawing::Color color, System::String appearanceFile)
 Creates a rubber stamp annotation. More...
 
void CreateRubberStamp (int32_t page, System::Drawing::Rectangle annotRect, System::String annotContents, System::Drawing::Color color, System::SharedPtr< System::IO::Stream > appearanceStream)
 Creates a rubber stamp annotation. More...
 
*editor Save ("example_out.pdf")
 Creates a bookmark with the specified action. More...
 
*</code > *</example > *void CreateBookmarksAction (System::String title, System::Drawing::Color color, bool boldFlag, bool italicFlag, System::String file, System::String actionType, System::String destination)
 
void AddDocumentAdditionalAction (System::String eventType, System::String code)
 Adds additional action for document event. More...
 
void RemoveDocumentOpenAction ()
 Removes open action from the document. This operation is useful when concatenating multiple documents that use explicit 'GoTo' action on startup. More...
 
void ChangeViewerPreference (int32_t viewerAttribution)
 Changes the view preference. More...
 
int32_t GetViewerPreference ()
 Returns the view preference. More...
 
void ReplaceImage (int32_t pageNumber, int32_t index, System::String imageFile)
 Replaces the specified image on the specified page of PDF document with another image. More...
 
void DeleteImage (int32_t pageNumber, System::ArrayPtr< int32_t > index)
 Deletes the specified images on the specified page. More...
 
void DeleteImage ()
 Deletes all images from PDF document. More...
 
bool ReplaceText (System::String srcString, int32_t thePage, System::String destString, System::SharedPtr< Aspose::Pdf::Text::TextState > textState)
 Replaces text in the PDF file on the specified page. TextState object (font family, color) can be specified to replaced text. More...
 
bool ReplaceText (System::String srcString, System::String destString)
 Replaces text in the PDF file. More...
 
bool ReplaceText (System::String srcString, int32_t thePage, System::String destString)
 Replaces text in the PDF file on the specified page. More...
 
bool ReplaceText (System::String srcString, System::String destString, System::SharedPtr< Aspose::Pdf::Text::TextState > textState)
 Replaces text in the PDF file using specified TextState object. More...
 
void CreateMovie (System::Drawing::Rectangle rect, System::String filePath, int32_t page)
 Creates Movie Annotations. More...
 
void CreateSound (System::Drawing::Rectangle rect, System::String filePath, System::String name, int32_t page, System::String rate)
 Creates Sound Annotations. More...
 
void DeleteStamp (int32_t pageNumber, System::ArrayPtr< int32_t > index)
 Deletes multiple stamps on the specified page by stamp indexes. More...
 
void DeleteStampByIds (System::ArrayPtr< int32_t > stampIds)
 Deletes stamps with specified IDs from all pages of the document. More...
 
void DeleteStampByIds (int32_t pageNumber, System::ArrayPtr< int32_t > stampIds)
 Deletes stamps on the specified page by multiple stamp IDs. More...
 
void DeleteStampById (int32_t pageNumber, int32_t stampId)
 Deletes stamp on the specified page by stamp ID. More...
 
void HideStampById (int32_t pageNumber, int32_t stampId)
 Hides the stamp. After hiding, stamp visibility may be restored with ShowStampById method. More...
 
void ShowStampById (int32_t pageNumber, int32_t stampId)
 Shows stamp which was hidden by HiddenStampById. More...
 
void MoveStampById (int32_t pageNumber, int32_t stampId, double x, double y)
 Changes position of the stamp on page. More...
 
void MoveStamp (int32_t pageNumber, int32_t stampIndex, double x, double y)
 Changes position of the stamp on page. More...
 
void DeleteStampById (int32_t stampId)
 Delete stamp by ID from all pages of the document. More...
 
 PdfContentEditor ()
 The constructor of the PdfContentEditor object. More...
 
 PdfContentEditor (System::SharedPtr< Aspose::Pdf::Document > document)
 Initializes new PdfContentEditor object on base of the document . More...
 
void CreateLocalLink (System::Drawing::Rectangle rect, int32_t desPage, int32_t originalPage)
 Creates a local link in PDF document. More...
 
bool ReplaceText (System::String srcString, System::String destString, int32_t fontSize)
 Replaces text in the PDF file and sets font size. More...
 
System::ArrayPtr< System::SharedPtr< StampInfo > > GetStamps (int32_t pageNumber)
 Returns array of stamps on the page. More...
 
virtual void Close ()
 Closes opened document. More...
 
- Public Member Functions inherited from Aspose::Pdf::Facades::SaveableFacade
virtual void Save (System::String destFile)
 Saves the PDF document to the specified file. More...
 
virtual void Save (System::SharedPtr< System::IO::Stream > destStream)
 Saves the PDF document to the specified stream. More...
 
- Public Member Functions inherited from Aspose::Pdf::Facades::Facade
System::SharedPtr< Aspose::Pdf::Documentget_Document () const
 Gets the document facade is working on. More...
 
virtual void BindPdf (System::SharedPtr< Aspose::Pdf::Document > srcDoc)
 Initializes the facade. More...
 
void Dispose ()
 Disposes the facade. More...
 
- Public Member Functions inherited from Aspose::Pdf::Facades::IFacade
virtual void BindPdf (System::SharedPtr< Document > srcDoc)=0
 Binds PDF document for editing. More...
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared refernce counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API int GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API String ToString () ASPOSE_CONST
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (unsigned int argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Static Public Attributes

static const System::String DocumentOpen
 
static const System::String DocumentClose
 
static const System::String DocumentWillSave
 
static const System::String DocumentSaved
 
static const System::String DocumentWillPrint
 
static const System::String DocumentPrinted
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
typedef System::Details::SharedMembersType shared_members_type
 structure to keep list of shared pointers contained in object. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Impleemnts C# typeof(System.Object) construct. More...
 
- Protected Member Functions inherited from Aspose::Pdf::Facades::SaveableFacade
 SaveableFacade ()
 The constructor. More...
 
 SaveableFacade (System::SharedPtr< Aspose::Pdf::Document > srcDoc)
 The constructor. More...
 
- Protected Member Functions inherited from Aspose::Pdf::Facades::Facade
 Facade ()
 The constructor. More...
 
 Facade (System::SharedPtr< Aspose::Pdf::Document > srcDoc)
 The constructor. More...
 
virtual void BindPdf (System::String srcFile, System::String password)
 Initializes the facade. More...
 
virtual void BindPdf (System::SharedPtr< System::IO::Stream > srcStream, System::String password)
 Initializes the facade. More...
 
virtual void AssertDocument () const
 Asserts if the facade is initialized. More...
 

Detailed Description

Represents a class to edit PDF file's content.

Constructor & Destructor Documentation

◆ PdfContentEditor() [1/2]

Aspose::Pdf::Facades::PdfContentEditor::PdfContentEditor ( )

The constructor of the PdfContentEditor object.

◆ PdfContentEditor() [2/2]

Aspose::Pdf::Facades::PdfContentEditor::PdfContentEditor ( System::SharedPtr< Aspose::Pdf::Document document)

Initializes new PdfContentEditor object on base of the document .

Parameters
documentPdf document.

Member Function Documentation

◆ AddDocumentAdditionalAction()

void Aspose::Pdf::Facades::PdfContentEditor::AddDocumentAdditionalAction ( System::String  eventType,
System::String  code 
)

Adds additional action for document event.

Parameters
eventTypeThe document event types.
codeThe code of JavaScript.
editor.BindPdf("example.pdf");
editor.AddDocumentAdditionalAction(PdfContentEditor.DocumentClose, "app.alert('Good-bye!');");
editor.Save("example_out.pdf");

◆ AddDocumentAttachment() [1/2]

void Aspose::Pdf::Facades::PdfContentEditor::AddDocumentAttachment ( System::String  fileAttachmentPath,
System::String  description 
)

Adds document attachment with no annotation.

Parameters
fileAttachmentPathThe path of the file will be attached.
descriptionThe description information.
editor.BindPdf("example.pdf");
editor.AddDocumentAttachment("attachment_file.pdf", "description of attachment_file");
editor.Save("example_out.pdf");

◆ AddDocumentAttachment() [2/2]

void Aspose::Pdf::Facades::PdfContentEditor::AddDocumentAttachment ( System::SharedPtr< System::IO::Stream fileAttachmentStream,
System::String  fileAttachmentName,
System::String  description 
)

Adds document attachment with no annotation.

Parameters
fileAttachmentStreamThe stream of the file will be attached.
fileAttachmentNameThe attachment name.
descriptionThe description information.
editor.BindPdf("example.pdf");
using(System.IO.FileStream attStream = System.IO.File.OpenRead("attachment_file.pdf"))
{
editor.AddDocumentAttachment(attStream, "attachment_file.pdf", "description of attachment_file");
editor.Save("example_out.pdf");
}

◆ BindPdf() [1/2]

virtual void Aspose::Pdf::Facades::PdfContentEditor::BindPdf ( System::String  inputFile)
virtual

Binds a PDF file for editing.

Parameters
inputFileA PDF file to be edited.

Reimplemented from Aspose::Pdf::Facades::Facade.

◆ BindPdf() [2/2]

virtual void Aspose::Pdf::Facades::PdfContentEditor::BindPdf ( System::SharedPtr< System::IO::Stream inputStream)
virtual

Binds a PDF stream for editing.

Parameters
inputStreamA PDF stream to be edited.

Reimplemented from Aspose::Pdf::Facades::Facade.

◆ ChangeViewerPreference()

void Aspose::Pdf::Facades::PdfContentEditor::ChangeViewerPreference ( int32_t  viewerAttribution)

Changes the view preference.

Parameters
viewerAttributionThe view attribution defined in the ViewerPreference class.
editor.BindPdf("example.pdf");
editor.ChangeViewerPreference(ViewerPreference.HideMenubar);
editor.ChangeViewerPreference(ViewerPreference.PageModeUseNone);
editor.Save("example_out.pdf");

◆ Close()

virtual void Aspose::Pdf::Facades::PdfContentEditor::Close ( )
virtual

Closes opened document.

Reimplemented from Aspose::Pdf::Facades::Facade.

◆ CreateApplicationLink() [1/3]

void Aspose::Pdf::Facades::PdfContentEditor::CreateApplicationLink ( System::Drawing::Rectangle  rect,
System::String  application,
int32_t  page,
System::Drawing::Color  clr,
System::ArrayPtr< System::SharedPtr< System::BoxedValueBase >>  actionName 
)

Creates a link to launch an application in PDF document.

Parameters
rectThe rectangle for active click.
applicationThe path of application to be launched.
pageThe number of original page where rectangle bound with link will be created.
clrThe colour of rectangle for active click.
actionNameThe array of actions (members of PredefinedAction enum) corresponding to executing menu items in Acrobat viewer.

///

editor.BindPdf("example.pdf");
editor.CreateApplicationLink(new System.Drawing.Rectangle(0, 0, 100, 100),
"explorer", 1, System.Drawing.Color.Red,
new Enum[] { PredefinedAction.FirstPage, PredefinedAction.PrintDialog });
editor.Save("example_out.pdf");

◆ CreateApplicationLink() [2/3]

void Aspose::Pdf::Facades::PdfContentEditor::CreateApplicationLink ( System::Drawing::Rectangle  rect,
System::String  application,
int32_t  page,
System::Drawing::Color  clr 
)

Creates a link to launch an application in PDF document.

Parameters
rectThe rectangle for active click.
applicationThe path of application to be launched.
pageThe number of original page where rectangle bound with link will be created.
clrThe colour of rectangle for active click.
editor.BindPdf("example.pdf");
editor.CreateApplicationLink(new System.Drawing.Rectangle(0, 0, 100, 100),
"explorer", 1, System.Drawing.Color.Red });
editor.Save("example_out.pdf");

◆ CreateApplicationLink() [3/3]

void Aspose::Pdf::Facades::PdfContentEditor::CreateApplicationLink ( System::Drawing::Rectangle  rect,
System::String  application,
int32_t  page 
)

Creates a link to launch an application in PDF document.

Parameters
rectThe rectangle for active click.
applicationThe path of application to be launched.
pageThe number of original page where rectangle bound with link will be created.
editor.BindPdf("example.pdf");
editor.CreateApplicationLink(new System.Drawing.Rectangle(0, 0, 100, 100), "explorer", 1 });
editor.Save("example_out.pdf");

◆ CreateBookmarksAction()

*</code> *</example> * void Aspose::Pdf::Facades::PdfContentEditor::CreateBookmarksAction ( System::String  title,
System::Drawing::Color  color,
bool  boldFlag,
bool  italicFlag,
System::String  file,
System::String  actionType,
System::String  destination 
)

◆ CreateCaret()

void Aspose::Pdf::Facades::PdfContentEditor::CreateCaret ( int32_t  page,
System::Drawing::Rectangle  annotRect,
System::Drawing::Rectangle  caretRect,
System::String  symbol,
System::String  annotContents,
System::Drawing::Color  color 
)

Creates caret annotation.

Parameters
pageThe number of original page where the annotation will be created.
annotRectThe annotation rectangle defining the location of the annotation on the page.
caretRectThe actual boundaries of the underlying caret.
symbolA symbol will be associated with the caret. Value can be: "P" (Paragraph), "None".
annotContentsThe contents of the annotation.
colorThe colour of the annotation.
editor.BindPdf("example.pdf");
editor.CreateCaret(1,
new System.Drawing.Rectangle(50, 50, 100, 100),
new System.Drawing.Rectangle(60, 60, 70, 70),
"None", "Welcome to Aspose", System.Drawing.Color.Red);
editor.Save("example_out.pdf");

◆ CreateCustomActionLink()

void Aspose::Pdf::Facades::PdfContentEditor::CreateCustomActionLink ( System::Drawing::Rectangle  rect,
int32_t  originalPage,
System::Drawing::Color  color,
System::ArrayPtr< System::SharedPtr< System::BoxedValueBase >>  actionName 
)

Creates a link to custom actions in PDF document.

Parameters
rectThe rectangle for active click.
originalPageThe number of original page where rectangle bound with link will be created.
colorThe colour of rectangle for active click.
actionNameThe array of actions (members of PredefinedAction enum) corresponding to executing menu items in Acrobat viewer.

///

editor.BindPdf("example.pdf");
editor.CreateCustomActionLink(new System.Drawing.Rectangle(0, 0, 100, 100),
new Enum[] { PredefinedAction.FirstPage, PredefinedAction.PrintDialog });
editor.Save("example_out.pdf");

◆ CreateFileAttachment() [1/4]

void Aspose::Pdf::Facades::PdfContentEditor::CreateFileAttachment ( System::Drawing::Rectangle  rect,
System::String  contents,
System::String  filePath,
int32_t  page,
System::String  name 
)

Creates file attachment annotation.

Parameters
rectThe annotation rectangle defining the location of the annotation on the page.
contentsThe contents of the annotation.
filePathThe path of the file will be attached.
pageThe number of original page where the annotation will be created.
nameThe name of an icon will be used in displaying the annotation. This value can be: "Graph", "PushPin", "Paperclip", "Tag".
editor.BindPdf("example.pdf");
editor.CreateFileAttachment(new System.Drawing.Rectangle(0, 0, 100, 100),
"Welcome to Aspose", "attachment_file.pdf", 1, "Graph");
editor.Save("example_out.pdf");

◆ CreateFileAttachment() [2/4]

void Aspose::Pdf::Facades::PdfContentEditor::CreateFileAttachment ( System::Drawing::Rectangle  rect,
System::String  contents,
System::String  filePath,
int32_t  page,
System::String  name,
double  opacity 
)

Creates file attachment annotation.

Parameters
rectThe annotation rectangle defining the location of the annotation on the page.
contentsThe contents of the annotation.
filePathThe path of the file will be attached.
pageThe number of original page where the annotation will be created.
nameThe name of an icon will be used in displaying the annotation. This value can be: "Graph", "PushPin", "Paperclip", "Tag".
opacityIcon's opacity from 0 to 1: 0 - completely transparant, 1 - completely opaque.
editor.BindPdf("example.pdf");
editor.CreateFileAttachment(new System.Drawing.Rectangle(0, 0, 100, 100),
"Welcome to Aspose", "attachment_file.pdf", 1, "Graph", 0.5);
editor.Save("example_out.pdf");

◆ CreateFileAttachment() [3/4]

void Aspose::Pdf::Facades::PdfContentEditor::CreateFileAttachment ( System::Drawing::Rectangle  rect,
System::String  contents,
System::SharedPtr< System::IO::Stream attachmentStream,
System::String  attachmentName,
int32_t  page,
System::String  name 
)

Creates file attachment annotation.

Parameters
rectThe annotation rectangle defining the location of the annotation on the page.
contentsThe contents of the annotation.
attachmentStreamThe attachment file stream.
attachmentNameThe attachment name.
pageThe number of original page where the annotation will be created.
nameThe name of an icon will be used in displaying the annotation. This value can be: "Graph", "PushPin", "Paperclip", "Tag".
editor.BindPdf("example.pdf");
using(System.IO.FileStream attStream = System.IO.File.OpenRead("attachment_file.pdf"))
{
editor.CreateFileAttachment(new System.Drawing.Rectangle(0, 0, 100, 100),
"Welcome to Aspose", attStream, "attachment_file.pdf", 1, "Graph");
editor.Save("example_out.pdf");
}

◆ CreateFileAttachment() [4/4]

void Aspose::Pdf::Facades::PdfContentEditor::CreateFileAttachment ( System::Drawing::Rectangle  rect,
System::String  contents,
System::SharedPtr< System::IO::Stream attachmentStream,
System::String  attachmentName,
int32_t  page,
System::String  name,
double  opacity 
)

Creates file attachment annotation.

Parameters
rectThe annotation rectangle defining the location of the annotation on the page.
contentsThe contents of the annotation.
attachmentStreamThe attachment file stream.
attachmentNameThe attachment name.
pageThe number of original page where the annotation will be created.
nameThe name of an icon will be used in displaying the annotation. This value can be: "Graph", "PushPin", "Paperclip", "Tag".
opacityIcon's opacity from 0 to 1: 0 - completely transparant, 1 - completely opaque.
editor.BindPdf("example.pdf");
using(System.IO.FileStream attStream = System.IO.File.OpenRead("attachment_file.pdf"))
{
editor.CreateFileAttachment(new System.Drawing.Rectangle(0, 0, 100, 100),
"Welcome to Aspose", attStream, "attachment_file.pdf", 1, "Graph", 0.5);
editor.Save("example_out.pdf");
}

◆ CreateFreeText()

void Aspose::Pdf::Facades::PdfContentEditor::CreateFreeText ( System::Drawing::Rectangle  rect,
System::String  contents,
int32_t  page 
)

Creates free text annotation in PDF document

Parameters
rectThe annotation rectangle defining the location of the annotation on the page.
contentsThe contents of the annotation.
pageThe number of original page where the text annotation will be created.
editor.BindPdf("example.pdf");
editor.CreateFreeText(new System.Drawing.Rectangle(0, 0, 100, 100), "Welcome to Aspose", 1);
editor.Save("example_out.pdf");

◆ CreateJavaScriptLink()

void Aspose::Pdf::Facades::PdfContentEditor::CreateJavaScriptLink ( System::String  code,
System::Drawing::Rectangle  rect,
int32_t  originalPage,
System::Drawing::Color  color 
)

Creates a link to JavaScript in PDF document.

Parameters
codeThe JavaScript code.
rectThe rectangle for active click.
originalPageThe number of original page where rectangle bound with link will be created.
colorThe colour of rectangle for active click.
editor.BindPdf("example.pdf");
editor.CreateJavaScriptLink("app.alert('welcome to aspose!');",
new System.Drawing.Rectangle(0, 0, 100, 100), 1, System.Drawing.Color.Red });
editor.Save("example_out.pdf");

◆ CreateLine()

void Aspose::Pdf::Facades::PdfContentEditor::CreateLine ( System::Drawing::Rectangle  rect,
System::String  contents,
float  x1,
float  y1,
float  x2,
float  y2,
int32_t  page,
int32_t  border,
System::Drawing::Color  clr,
System::String  borderStyle,
System::ArrayPtr< int32_t >  dashArray,
System::ArrayPtr< System::String LEArray 
)

Creates line annotation.

Parameters
rectThe annotation rectangle defining the location of the annotation on the page.
contentsThe contents of the annotation.
x1The starting horizontal coordinate of the line.
y1The starting vertical coordinate of the line.
x2The ending horizontal coordinate of the line.
y2The ending vertical coordinate of the line.
pageThe number of original page where the annotation will be created.
borderThe border width in points. If this value is 0 no border is drawn. Default value is 1.
clrThe color of line.
borderStyleThe border style specifying the width and dash pattern to be used in drawing the line. This value can be: "S" (Solid), "D" (Dashed), "B" (Beveled), "I" (Inset), "U" (Underline).
dashArrayA dash array defining a pattern of dashes and gaps to be used in drawing a dashed border. If it is used, borderSyle must be accordingly set to "D".
LEArrayAn array of two values respectively specifying the beginning and ending style of the drawing line. The values can be: "Square", "Circle", "Diamond", "OpenArrow", "ClosedArrow", "None", "Butt", "ROpenArrow", "RClosedArrow", "Slash".
editor.BindPdf("example.pdf");
editor.CreateLine(new System.Drawing.Rectangle(0, 0, 100, 100), "Welcome to Aspose", 0, 0, 100, 100,
1, 1, System.Drawing.Color.Red, "D", new int[] {2, 3}, new string[] {"OpenArrow", "ClosedArrow"});
editor.Save("example_out.pdf");

◆ CreateLocalLink() [1/3]

void Aspose::Pdf::Facades::PdfContentEditor::CreateLocalLink ( System::Drawing::Rectangle  rect,
int32_t  desPage,
int32_t  originalPage,
System::Drawing::Color  clr,
System::ArrayPtr< System::SharedPtr< System::BoxedValueBase >>  actionName 
)

Creates a local link in PDF document.

Parameters
rectThe rectangle for active click.
desPageThe destination page.
originalPageThe number of original page where rectangle bound with local link will be created.
clrThe colour of rectangle for active click.
actionNameThe array of actions (members of PredefinedAction enum) corresponding to executing menu items in Acrobat viewer.
editor.BindPdf("example.pdf");
editor.CreateLocalLink(new System.Drawing.Rectangle(0, 0, 100, 100),
2, 1, System.Drawing.Color.Red,
new Enum[] { PredefinedAction.FirstPage, PredefinedAction.PrintDialog });
editor.Save("example_out.pdf");

◆ CreateLocalLink() [2/3]

void Aspose::Pdf::Facades::PdfContentEditor::CreateLocalLink ( System::Drawing::Rectangle  rect,
int32_t  desPage,
int32_t  originalPage,
System::Drawing::Color  clr 
)

Creates a local link in PDF document.

Parameters
rectThe rectangle for active click.
desPageThe destination page.
originalPageThe number of original page where rectangle bound with local link will be created.
clrThe colour of rectangle for active click.
editor.BindPdf("example.pdf");
editor.CreateLocalLink(new System.Drawing.Rectangle(0, 0, 100, 100),
2, 1, System.Drawing.Color.Red });
editor.Save("example_out.pdf");

◆ CreateLocalLink() [3/3]

void Aspose::Pdf::Facades::PdfContentEditor::CreateLocalLink ( System::Drawing::Rectangle  rect,
int32_t  desPage,
int32_t  originalPage 
)

Creates a local link in PDF document.

Parameters
rectThe rectangle for active click.
desPageThe destination page.
originalPageThe number of original page where rectangle bound with local link will be created.
editor.BindPdf("example.pdf");
editor.CreateLocalLink(new System.Drawing.Rectangle(0, 0, 100, 100), 2, 1});
editor.Save("example_out.pdf");

◆ CreateMarkup()

void Aspose::Pdf::Facades::PdfContentEditor::CreateMarkup ( System::Drawing::Rectangle  rect,
System::String  contents,
int32_t  type,
int32_t  page,
System::Drawing::Color  clr 
)

Creates markup annotation it PDF document.

Parameters
rectThe rectangle defining the location of the annotation on the page.
contentsThe contents of the annotation.
typeThe type of markup annotation. Can be 0 (Highlight), 1 (Underline), 2 (StrikeOut), 3 (Squiggly).
pageThe number of original page where the annotation will be created.
clrThe color of markup.
editor.BindPdf("example.pdf");
editor.CreateMarkup(new System.Drawing.Rectangle(0, 0, 100, 100),
"Welcome to Aspose", 0, 1, System.Drawing.Color.Red);
editor.Save("example_out.pdf");

◆ CreateMovie()

void Aspose::Pdf::Facades::PdfContentEditor::CreateMovie ( System::Drawing::Rectangle  rect,
System::String  filePath,
int32_t  page 
)

Creates Movie Annotations.

Parameters
rectThe annotation rectangle defining the location of the annotation on the page.
filePathThe path of movie file to be played.
pageThe page in which the Line annotation is created.

◆ CreatePdfDocumentLink() [1/3]

void Aspose::Pdf::Facades::PdfContentEditor::CreatePdfDocumentLink ( System::Drawing::Rectangle  rect,
System::String  remotePdf,
int32_t  originalPage,
int32_t  destinationPage,
System::Drawing::Color  clr,
System::ArrayPtr< System::SharedPtr< System::BoxedValueBase >>  actionName 
)

Creates a link to another PDF document page.

Parameters
rectThe rectangle for active click.
remotePdfThe PDF document which page will be opened.
originalPageThe number of original page where rectangle bound with link will be created.
destinationPageThe destination page.
clrThe colour of rectangle for active click.
actionNameThe array of actions (members of PredefinedAction enum) corresponding to executing menu items in Acrobat viewer.
editor.BindPdf("example.pdf");
editor.CreatePdfDocumentLink(new System.Drawing.Rectangle(0, 0, 100, 100),
"another_example.pdf", 1, 1, System.Drawing.Color.Red,
new Enum[] { PredefinedAction.FirstPage, PredefinedAction.PrintDialog });
editor.Save("example_out.pdf");

◆ CreatePdfDocumentLink() [2/3]

void Aspose::Pdf::Facades::PdfContentEditor::CreatePdfDocumentLink ( System::Drawing::Rectangle  rect,
System::String  remotePdf,
int32_t  originalPage,
int32_t  destinationPage,
System::Drawing::Color  clr 
)

Creates a link to another PDF document page.

Parameters
rectThe rectangle for active click.
remotePdfThe PDF document which page will be opened.
originalPageThe number of original page where rectangle bound with link will be created.
destinationPageThe destination page.
clrThe colour of rectangle for active click.
editor.BindPdf("example.pdf");
editor.CreatePdfDocumentLink(new System.Drawing.Rectangle(0, 0, 100, 100),
"another_example.pdf", 1, 1, System.Drawing.Color.Red });
editor.Save("example_out.pdf");

◆ CreatePdfDocumentLink() [3/3]

void Aspose::Pdf::Facades::PdfContentEditor::CreatePdfDocumentLink ( System::Drawing::Rectangle  rect,
System::String  remotePdf,
int32_t  originalPage,
int32_t  destinationPage 
)

Creates a link to another PDF document page.

Parameters
rectThe rectangle for active click.
remotePdfThe PDF document which page will be opened.
originalPageThe number of original page where rectangle bound with link will be created.
destinationPageThe destination page.
editor.BindPdf("example.pdf");
editor.CreatePdfDocumentLink(new System.Drawing.Rectangle(0, 0, 100, 100), "another_example.pdf", 1, 1 });
editor.Save("example_out.pdf");

◆ CreatePolygon()

void Aspose::Pdf::Facades::PdfContentEditor::CreatePolygon ( System::SharedPtr< LineInfo lineInfo,
int32_t  page,
System::Drawing::Rectangle  annotRect,
System::String  annotContents 
)

Creates polygon annotation.

Parameters
lineInfoThe instance of LineInfo class.
pageThe number of original page where the annotation will be created.
annotRectThe annotation rectangle defining the location of the annotation on the page.
annotContentsThe contents of the annotation.
editor.BindPdf("example.pdf");
LineInfo lineInfo = new LineInfo();
lineInfo.VerticeCoordinate = new float[] { 0, 0, 100, 100, 100, 50 };
lineInfo.Visibility = true;
editor.CreatePolygon(lineInfo, 1 , new System.Drawing.Rectangle(0, 0, 0, 0), "Welcome to Aspose");
editor.Save("example_out.pdf");

◆ CreatePolyLine()

void Aspose::Pdf::Facades::PdfContentEditor::CreatePolyLine ( System::SharedPtr< LineInfo lineInfo,
int32_t  page,
System::Drawing::Rectangle  annotRect,
System::String  annotContents 
)

Creates polyline annotation.

Parameters
lineInfoThe instance of LineInfo class.
pageThe number of original page where the annotation will be created.
annotRectThe annotation rectangle defining the location of the annotation on the page.
annotContentsThe contents of the annotation.
editor.BindPdf("example.pdf");
LineInfo lineInfo = new LineInfo();
lineInfo.VerticeCoordinate = new float[] { 0, 0, 100, 100, 100, 50 };
lineInfo.Visibility = true;
editor.CreatePolyLine(lineInfo, 1 , new System.Drawing.Rectangle(0, 0, 0, 0), "Welcome to Aspose");
editor.Save("example_out.pdf");

◆ CreatePopup()

void Aspose::Pdf::Facades::PdfContentEditor::CreatePopup ( System::Drawing::Rectangle  rect,
System::String  contents,
bool  open,
int32_t  page 
)

Creates popup annotation in PDF document.

Parameters
rectThe annotation rectangle defining the location of the annotation on the page.
contentsThe contents of the annotation.
openA flag specifying whether the pop-up annotation should initially be displayed open.
pageThe number of original page where the annotation will be created.
editor.BindPdf("example.pdf");
editor.CreatePopup(new System.Drawing.Rectangle(0, 0, 100, 100), "Welcome to Aspose", true, 1);
editor.Save("example_out.pdf");

◆ CreateRubberStamp() [1/3]

void Aspose::Pdf::Facades::PdfContentEditor::CreateRubberStamp ( int32_t  page,
System::Drawing::Rectangle  annotRect,
System::String  icon,
System::String  annotContents,
System::Drawing::Color  color 
)

Creates a rubber stamp annotation.

Parameters
pageThe number of original page where the annotation will be created.
annotRectThe annotation rectangle defining the location of the annotation on the page.
iconAn icon is to be used in displaying the annotation. Default value: 'Draft'."</param> <param name="annotContents">The contents of the annotation.</param> <param name="color">The colour of the annotation.
editor.BindPdf("example.pdf");
editor.CreateRubberStamp(1, System.Drawing.Rectangle(0, 0, 100, 100),
"Welcome to Aspose", System.Drawing.Color.Red);
editor.Save("example_out.pdf");

◆ CreateRubberStamp() [2/3]

void Aspose::Pdf::Facades::PdfContentEditor::CreateRubberStamp ( int32_t  page,
System::Drawing::Rectangle  annotRect,
System::String  annotContents,
System::Drawing::Color  color,
System::String  appearanceFile 
)

Creates a rubber stamp annotation.

Parameters
pageThe number of original page where the annotation will be created.
annotRectThe annotation rectangle defining the location of the annotation on the page.
annotContentsThe contents of the annotation.
colorThe colour of the annotation.
appearanceFileThe path of appearance file.
editor.BindPdf("example.pdf");
editor.CreateRubberStamp(1, System.Drawing.Rectangle(0, 0, 100, 100),
"Welcome to Aspose", System.Drawing.Color.Red, "appearance_file.pdf");
editor.Save("example_out.pdf");

◆ CreateRubberStamp() [3/3]

void Aspose::Pdf::Facades::PdfContentEditor::CreateRubberStamp ( int32_t  page,
System::Drawing::Rectangle  annotRect,
System::String  annotContents,
System::Drawing::Color  color,
System::SharedPtr< System::IO::Stream appearanceStream 
)

Creates a rubber stamp annotation.

Parameters
pageThe number of original page where the annotation will be created.
annotRectThe annotation rectangle defining the location of the annotation on the page.
annotContentsThe contents of the annotation.
colorThe colour of the annotation.
appearanceStreamThe stream of appearance file.
editor.BindPdf("example.pdf");
using (System.IO.FileStream appStream = File.OpenRead("appearance_file.pdf"))
{
editor.CreateRubberStamp(1, System.Drawing.Rectangle(0, 0, 100, 100),
"Welcome to Aspose", System.Drawing.Color.Red, appStream);
editor.Save("example_out.pdf");
}

◆ CreateSound()

void Aspose::Pdf::Facades::PdfContentEditor::CreateSound ( System::Drawing::Rectangle  rect,
System::String  filePath,
System::String  name,
int32_t  page,
System::String  rate 
)

Creates Sound Annotations.

Parameters
rectThe annotation rectangle defining the location of the annotation on the page.
filePathThe file path of sound file.
nameThe name of an icon to be used in displaying the annotation,include:Speaker and Mic.
pageThe page in which the Sound annotation is created.
rateThe sampling rate, in samples per second.

◆ CreateSquareCircle()

void Aspose::Pdf::Facades::PdfContentEditor::CreateSquareCircle ( System::Drawing::Rectangle  rect,
System::String  contents,
System::Drawing::Color  clr,
bool  square,
int32_t  page,
int32_t  borderWidth 
)

Creates square-circle annotation.

Parameters
rectThe annotation rectangle defining the location of the annotation on the page.
contentsThe contents of the annotation.
clrThe colour of square or circle.
squareTrue (square), false (sircle).
pageThe number of original page where the annotation will be created.
borderWidthThe border width of square or circle.
editor.BindPdf("example.pdf");
editor.CreateSquareCircle(new System.Drawing.Rectangle(0, 0, 100, 100),
"Welcome to Aspose", System.Drawing.Color.Red, false, 1, 5);
editor.Save("example_out.pdf");

◆ CreateText()

void Aspose::Pdf::Facades::PdfContentEditor::CreateText ( System::Drawing::Rectangle  rect,
System::String  title,
System::String  contents,
bool  open,
System::String  icon,
int32_t  page 
)

Creates text annotation in PDF document

Parameters
rectThe annotation rectangle defining the location of the annotation on the page.
titleThe title of the annotation.
contentsThe contents of the annotation.
openA flag specifying whether the annotation should initially be displayed open.
iconThe name of an icon will be used in displaying the annotation. This value can be: "Comment", "Key", "Note", "Help", "NewParagraph", "Paragraph", "Insert"
pageThe number of original page where the text annotation will be created.
editor.BindPdf("example.pdf");
editor.CreateText(new System.Drawing.Rectangle(0, 0, 100, 100),
"Welcome to Aspose", "You are welcome to Aspose!", true, "Key", 1);
editor.Save("example_out.pdf");

◆ CreateWebLink() [1/3]

void Aspose::Pdf::Facades::PdfContentEditor::CreateWebLink ( System::Drawing::Rectangle  rect,
System::String  url,
int32_t  originalPage,
System::Drawing::Color  clr,
System::ArrayPtr< System::SharedPtr< System::BoxedValueBase >>  actionName 
)

Creates a web link in PDF document.

Parameters
rectThe rectangle for active click.
urlThe web link destination.
originalPageThe number of original page on which rectangle bound with web link will be created.
clrThe colour of rectangle for active click.
actionNameThe array of actions (members of PredefinedAction enum) corresponding to executing menu items in Acrobat viewer.
editor.BindPdf("example.pdf");
editor.CreateWebLink(new System.Drawing.Rectangle(0, 0, 100, 100),
"http://www.aspose.com", 1, System.Drawing.Color.Red,
new Enum[] { PredefinedAction.FirstPage, PredefinedAction.PrintDialog });
editor.Save("example_out.pdf");

◆ CreateWebLink() [2/3]

void Aspose::Pdf::Facades::PdfContentEditor::CreateWebLink ( System::Drawing::Rectangle  rect,
System::String  url,
int32_t  originalPage,
System::Drawing::Color  clr 
)

Creates a web link in PDF document.

Parameters
rectThe rectangle for active click.
urlThe web link destination.
originalPageThe number of original page where rectangle bound with web link will be created.
clrThe colour of rectangle for active click.
editor.BindPdf("example.pdf");
editor.CreateWebLink(new System.Drawing.Rectangle(0, 0, 100, 100),
"http://www.aspose.com", 1, System.Drawing.Color.Red });
editor.Save("example_out.pdf");

◆ CreateWebLink() [3/3]

void Aspose::Pdf::Facades::PdfContentEditor::CreateWebLink ( System::Drawing::Rectangle  rect,
System::String  url,
int32_t  originalPage 
)

Creates a web link in PDF document.

Parameters
rectThe rectangle for active click.
urlThe web link destination.
originalPageThe number of original page where rectangle bound with web link will be created.
editor.BindPdf("example.pdf");
editor.CreateWebLink(new System.Drawing.Rectangle(0, 0, 100, 100), "http://www.aspose.com", 1 });
editor.Save("example_out.pdf");

◆ DeleteAttachments()

void Aspose::Pdf::Facades::PdfContentEditor::DeleteAttachments ( )

Deletes all attachments in PDF document.

editor.BindPdf("example.pdf");
editor.DeleteAttachments();
editor.Save("example_out.pdf");

◆ DeleteImage() [1/2]

void Aspose::Pdf::Facades::PdfContentEditor::DeleteImage ( int32_t  pageNumber,
System::ArrayPtr< int32_t >  index 
)

Deletes the specified images on the specified page.

Parameters
pageNumberThe number of page on which images must be deleted.
indexAn array repsents images' indexes.
editor.BindPdf("example.pdf");
editor.DeleteImage(1, new int[] {1, 2});
editor.Save("example_out.pdf");

◆ DeleteImage() [2/2]

void Aspose::Pdf::Facades::PdfContentEditor::DeleteImage ( )

Deletes all images from PDF document.

editor.BindPdf("example.pdf");
editor.DeleteImage();
editor.Save("example_out.pdf");

◆ DeleteStamp()

void Aspose::Pdf::Facades::PdfContentEditor::DeleteStamp ( int32_t  pageNumber,
System::ArrayPtr< int32_t >  index 
)

Deletes multiple stamps on the specified page by stamp indexes.

Parameters
pageNumberPage number where stamp will be deleted.
indexStamp indexes.
PdfContentEditor contentEditor = new PdfContentEditor();
contentEditor.BindPdf("file.pdf");
contentEditor.DeleteStamp(1, new int[] { 2, 3, 5} );
contentEditor.Save("outfile.pdf");

◆ DeleteStampById() [1/2]

void Aspose::Pdf::Facades::PdfContentEditor::DeleteStampById ( int32_t  pageNumber,
int32_t  stampId 
)

Deletes stamp on the specified page by stamp ID.

Parameters
pageNumberPage number where stamp will be deleted.
stampIdIdentifier of stanp which should be deleted.
PdfContentEditor contentEditor = new PdfContentEditor();
contentEditor.BindPdf("file.pdf");
contentEditor.DeleteStampById(1, 100);
contentEditor.Save("outfile.pdf");

◆ DeleteStampById() [2/2]

void Aspose::Pdf::Facades::PdfContentEditor::DeleteStampById ( int32_t  stampId)

Delete stamp by ID from all pages of the document.

Parameters
stampIdIdentifier of stamp which should be deleted.
PdfContentEditor contentEditor = new PdfContentEditor();
contentEditor.BindPdf("file.pdf");
contentEditor.DeleteStampById(100);
contentEditor.Save("outfile.pdf");

◆ DeleteStampByIds() [1/2]

void Aspose::Pdf::Facades::PdfContentEditor::DeleteStampByIds ( System::ArrayPtr< int32_t >  stampIds)

Deletes stamps with specified IDs from all pages of the document.

Parameters
stampIdsArray of stamp IDs.
PdfContentEditor contentEditor = new PdfContentEditor();
contentEditor.BindPdf("file.pdf");
contentEditor.DeleteStampByIds(new int[] { 102, 103 } );
contentEditor.Save("outfile.pdf");

◆ DeleteStampByIds() [2/2]

void Aspose::Pdf::Facades::PdfContentEditor::DeleteStampByIds ( int32_t  pageNumber,
System::ArrayPtr< int32_t >  stampIds 
)

Deletes stamps on the specified page by multiple stamp IDs.

Parameters
pageNumberPage number where stamps will be deleted.
stampIdsArray of stamp IDs.
PdfContentEditor contentEditor = new PdfContentEditor();
contentEditor.BindPdf("file.pdf");
contentEditor.DeleteStampByIds(1, new int[] { 100, 101 } );
contentEditor.Save("outfile.pdf");

◆ DrawCurve()

void Aspose::Pdf::Facades::PdfContentEditor::DrawCurve ( System::SharedPtr< LineInfo lineInfo,
int32_t  page,
System::Drawing::Rectangle  annotRect,
System::String  annotContents 
)

Creates curve annotation.

Parameters
lineInfoThe instance of LineInfo class.
pageThe number of original page where the annotation will be created.
annotRectThe annotation rectangle defining the location of the annotation on the page.
annotContentsThe contents of the annotation.
newApiEditor.BindPdf("example.pdf");
LineInfo lineInfo = new LineInfo();
lineInfo.VerticeCoordinate = new float[] { 0, 0, 100, 100 }; //x1, y1, x2, y2, .. xn, yn
lineInfo.Visibility = true;
editor.DrawCurve(lineInfo, 1, new System.Drawing.Rectangle(0, 0, 0, 0), "Welcome to Aspose");
editor.Save("example_out.pdf");

◆ ExtractLink()

Extracts the collection of Link instances contained in PDF document.

editor.BindPdf("example.pdf");
IList links = editor.ExtractLink();
foreach (object obj in links)
{
Link link = (Link)obj;
// work with Link instance
}
Returns
The collection of Link objects

◆ get_ReplaceTextStrategy()

System::SharedPtr<Aspose::Pdf::Facades::ReplaceTextStrategy> Aspose::Pdf::Facades::PdfContentEditor::get_ReplaceTextStrategy ( )

A set of parameters for replace text operation

◆ get_TextEditOptions()

System::SharedPtr<Aspose::Pdf::Text::TextEditOptions> Aspose::Pdf::Facades::PdfContentEditor::get_TextEditOptions ( )

Gets text edit options.

◆ get_TextReplaceOptions()

System::SharedPtr<Aspose::Pdf::Text::TextReplaceOptions> Aspose::Pdf::Facades::PdfContentEditor::get_TextReplaceOptions ( )

Gets text replace options.

◆ get_TextSearchOptions()

System::SharedPtr<Aspose::Pdf::Text::TextSearchOptions> Aspose::Pdf::Facades::PdfContentEditor::get_TextSearchOptions ( )

Gets text search options.

◆ GetStamps()

System::ArrayPtr<System::SharedPtr<StampInfo> > Aspose::Pdf::Facades::PdfContentEditor::GetStamps ( int32_t  pageNumber)

Returns array of stamps on the page.

Parameters
pageNumberPage number where stamps will be searched.
Returns
Array of stamps.

◆ GetViewerPreference()

int32_t Aspose::Pdf::Facades::PdfContentEditor::GetViewerPreference ( )

Returns the view preference.

Returns
Returns set of ViewerPrefernece flags
editor.BindPdf("example.pdf");
int prefValue = editor.GetViewerPreference();
if ((prefValue &amp; ViewerPreference.PageModeUseOutline) != 0)
{ // ... }

◆ HideStampById()

void Aspose::Pdf::Facades::PdfContentEditor::HideStampById ( int32_t  pageNumber,
int32_t  stampId 
)

Hides the stamp. After hiding, stamp visibility may be restored with ShowStampById method.

Parameters
pageNumberNumber of the page.
stampIdIdentifier of stamp which should be hidden.

◆ MoveStamp()

void Aspose::Pdf::Facades::PdfContentEditor::MoveStamp ( int32_t  pageNumber,
int32_t  stampIndex,
double  x,
double  y 
)

Changes position of the stamp on page.

Parameters
pageNumberNumber of page.
stampIndexIndex of stamp on the page.
xNew stamp horizontal position.
yNew stamp vertical position.

◆ MoveStampById()

void Aspose::Pdf::Facades::PdfContentEditor::MoveStampById ( int32_t  pageNumber,
int32_t  stampId,
double  x,
double  y 
)

Changes position of the stamp on page.

Parameters
pageNumberNumer of page.
stampIdIdentifier of stamp which should be moved.
xNew stamp horizontal pozition on the page.
yNew stamp vertical position on the page.

◆ RemoveDocumentOpenAction()

void Aspose::Pdf::Facades::PdfContentEditor::RemoveDocumentOpenAction ( )

Removes open action from the document. This operation is useful when concatenating multiple documents that use explicit 'GoTo' action on startup.

editor.BindPdf("example.pdf");
editor.RemoveDocumentOpenAction();
editor.Save("example_out.pdf");

◆ ReplaceImage()

void Aspose::Pdf::Facades::PdfContentEditor::ReplaceImage ( int32_t  pageNumber,
int32_t  index,
System::String  imageFile 
)

Replaces the specified image on the specified page of PDF document with another image.

Parameters
pageNumberThe number of page on which the image is replaced.
indexThe index of the image object must be replaced.
imageFileThe image file will be used for replacing.
editor.BindPdf("example.pdf");
editor.ReplaceImage(1, 1, "image.jpg");
editor.Save("example_out.pdf");

◆ ReplaceText() [1/5]

bool Aspose::Pdf::Facades::PdfContentEditor::ReplaceText ( System::String  srcString,
int32_t  thePage,
System::String  destString,
System::SharedPtr< Aspose::Pdf::Text::TextState textState 
)

Replaces text in the PDF file on the specified page. TextState object (font family, color) can be specified to replaced text.

The example demonstrates how to replace text on the first page of the PDF document and set TextState text properties for the new text.

// open document
Document doc = new Document(inFile);
// Create font and mark it to be embedded
Aspose.Pdf.Text.Font font = FontRepository.FindFont("Courier New");
font.IsEmbedded = true;
// create PdfContentEditor object to edit text
editor.BindPdf(doc);
// create textState object
TextState textState = new TextState();
textState.Font = font;
textState.FontSize = 17;
textState.FontStyle = FontStyle.Bold | FontStyle.Italic;
textState.ForegroundColor = Color.Red;
// change text with specified font
editor.ReplaceText("hello world", 1, "hi world", textState);
// save document
doc.Save(outFile);
Parameters
srcStringThe string to be replaced.
thePagePage number (0 means "all pages").
destStringThe replaced string.
textStateText state (Text Color, Font etc).
Returns
Returns true if replacement was made.

◆ ReplaceText() [2/5]

bool Aspose::Pdf::Facades::PdfContentEditor::ReplaceText ( System::String  srcString,
System::String  destString 
)

Replaces text in the PDF file.

The example demonstrates how to replace text in PDF document.

// open document
Document doc = new Document(inFile);
// create PdfContentEditor object to edit text
editor.BindPdf(doc);
// change text
editor.ReplaceText("hello world", "hi world");
// save document
doc.Save(outFile);
Parameters
srcStringThe string to be replaced.
destStringReplacing string.
Returns
Returns true if replacement was made.

◆ ReplaceText() [3/5]

bool Aspose::Pdf::Facades::PdfContentEditor::ReplaceText ( System::String  srcString,
int32_t  thePage,
System::String  destString 
)

Replaces text in the PDF file on the specified page.

The example demonstrates how to replace text in PDF document on the specified page.

// open document
Document doc = new Document(inFile);
// create PdfContentEditor object to edit text
editor.BindPdf(doc);
// change text
editor.ReplaceText("hello world", 1, "hi world");
// save document
doc.Save(outFile);
Parameters
srcStringThe sting to be replaced.
thePagePage number (0 for all pages)
destStringReplacing string.
Returns
Returns true if replacement was made.

◆ ReplaceText() [4/5]

bool Aspose::Pdf::Facades::PdfContentEditor::ReplaceText ( System::String  srcString,
System::String  destString,
System::SharedPtr< Aspose::Pdf::Text::TextState textState 
)

Replaces text in the PDF file using specified TextState object.

The example demonstrates how to replace text and set TextState text properties for the new text.

// open document
Document doc = new Document(inFile);
// Create font and mark it to be embedded
Aspose.Pdf.Text.Font font = FontRepository.FindFont("Courier New");
font.IsEmbedded = true;
// create PdfContentEditor object to edit text
editor.BindPdf(doc);
// create textState object
TextState textState = new TextState();
textState.Font = font;
textState.FontStyle = FontStyle.Bold | FontStyle.Italic;
// change text with specified font
editor.ReplaceText("hello world", "hi world", textState);
// save document
doc.Save(outFile);
Parameters
srcStringString to be replaced
destStringReplacing string
textStateText state (Text Color, Font etc)
Returns
Returns true if replacement was made.

◆ ReplaceText() [5/5]

bool Aspose::Pdf::Facades::PdfContentEditor::ReplaceText ( System::String  srcString,
System::String  destString,
int32_t  fontSize 
)

Replaces text in the PDF file and sets font size.

The example demonstrates how to replace text and set font size for the new text.

// open document
Document doc = new Document(inFile);
// Create font and mark it to be embedded
Aspose.Pdf.Text.Font font = FontRepository.FindFont("Courier New");
font.IsEmbedded = true;
// create PdfContentEditor object to edit text
editor.BindPdf(doc);
// change text with specified font
editor.ReplaceText("hello world", "hi world", 14);
// save document
doc.Save(outFile);
Parameters
srcStringString to be replaced.
destStringReplacing string.
fontSizeFont size.
Returns
Returns true if replacement was made.

◆ Save()

* editor Aspose::Pdf::Facades::PdfContentEditor::Save ( "example_out.pdf"  )

Creates a bookmark with the specified action.

Parameters
titleThe title of the bookmark.
colorThe colour of the bookmark's title.
boldFlagThe flag of bold attribution.
italicFlagThe flag of italic attribution.
fileAnother file or application required when the action type is "GoToR" or "Launch".
actionTypeThe action type. The value can be: "GoToR", "Launch", "GoTo", "URI".
destinationThe local destination or remote destination or URL.
editor.BindPdf("example.pdf");
editor.CreateBookmarksAction("bookmark title",
System.Drawing.Color.Red, true, true, null, "GoTo", 1/*page number

◆ set_ReplaceTextStrategy()

void Aspose::Pdf::Facades::PdfContentEditor::set_ReplaceTextStrategy ( System::SharedPtr< Aspose::Pdf::Facades::ReplaceTextStrategy value)

A set of parameters for replace text operation

◆ set_TextEditOptions()

void Aspose::Pdf::Facades::PdfContentEditor::set_TextEditOptions ( System::SharedPtr< Aspose::Pdf::Text::TextEditOptions value)

Sets text edit options.

◆ set_TextReplaceOptions()

void Aspose::Pdf::Facades::PdfContentEditor::set_TextReplaceOptions ( System::SharedPtr< Aspose::Pdf::Text::TextReplaceOptions value)

Sets text replace options.

◆ set_TextSearchOptions()

void Aspose::Pdf::Facades::PdfContentEditor::set_TextSearchOptions ( System::SharedPtr< Aspose::Pdf::Text::TextSearchOptions value)

Sets text search options.

◆ ShowStampById()

void Aspose::Pdf::Facades::PdfContentEditor::ShowStampById ( int32_t  pageNumber,
int32_t  stampId 
)

Shows stamp which was hidden by HiddenStampById.

Parameters
pageNumberNumber of the page.
stampIdIdentifier of stamp which should be shown.

Member Data Documentation

◆ DocumentClose

const System::String Aspose::Pdf::Facades::PdfContentEditor::DocumentClose
static

◆ DocumentOpen

const System::String Aspose::Pdf::Facades::PdfContentEditor::DocumentOpen
static

◆ DocumentPrinted

const System::String Aspose::Pdf::Facades::PdfContentEditor::DocumentPrinted
static

◆ DocumentSaved

const System::String Aspose::Pdf::Facades::PdfContentEditor::DocumentSaved
static

◆ DocumentWillPrint

const System::String Aspose::Pdf::Facades::PdfContentEditor::DocumentWillPrint
static

◆ DocumentWillSave

const System::String Aspose::Pdf::Facades::PdfContentEditor::DocumentWillSave
static