Aspose::Pdf::Facades Namespace Reference

Classes

class  AutoFiller
 Represents a class to receive data from database or other datasource, fills them into the designed fields of the template pdf and at last generates new pdf file or stream. It has two template file input modes:input as a stream or a pdf file. It has four types of output modes:one merged stream, one merged file, many small streams, many small files. It can recieve literal data contained in a System.Data.DataTable. More...
 
class  Bookmark
 Represents a bookmark. More...
 
class  Bookmarks
 Represents a collection of Bookmark objects. More...
 
class  DocumentPrivilege
 Represents the privileges for accessing Pdf file. Refer toPdfFileSecurity. There are 4 ways using this class: 1.Using predefined privilege directly. 2.Based on a predefined privilege and change some specifical permissions. 3.Based on a predefined privilege and change some specifical Adobe Professional permissions combination. 4.Mixes the way2 and way3. More...
 
class  Facade
 Base facade class. More...
 
class  FontColor
 Class representing color of the text. More...
 
class  Form
 Status of imported field More...
 
class  FormattedText
 Class which represents formatted text. Contains information about text and its color, size, style. More...
 
class  FormEditor
 Class for editing forms (ading/deleting field etc) More...
 
class  FormFieldFacade
 Class for representing field properties. More...
 
class  IFacade
 General facade interface that defines common facades methods. More...
 
class  ISaveableFacade
 Facade interface that defines methods common for all saveable facades. More...
 
class  LineInfo
 Represents the information of line. More...
 
class  NamespaceDoc
 The Aspose.Pdf.Facades namespace provides classes originaly came from Aspose.Pdf.Kit. These classes are used for manipulating documents perfoming operations like concatenating, stamping, signing, annotating etc. but on the high level without access to a document's inner structure. More...
 
class  PdfAnnotationEditor
 Represents a class for work with PDF document annotations (comments). More...
 
class  PdfBookmarkEditor
 Represents a class to work with PDF file's bookmarks including create, modify, export, import and delete. More...
 
class  PdfContentEditor
 Represents a class to edit PDF file's content. More...
 
class  PdfConverter
 Represents a class to convert a pdf file's each page to images, supporting BMP, JPEG, PNG and TIFF now. Supported content in pdfs: pictures, form, comment. More...
 
class  PdfExtractor
 Class for extracting images and text from PDF document. More...
 
class  PdfFileEditor
 Action performed when corrupted file was met in concatenation process. More...
 
class  PdfFileInfo
 Represents a class for accessing meta information of PDF document. More...
 
class  PdfFileMend
 Represents a class for adding texts and images on the pages of existing PDF document. More...
 
class  PdfFileSecurity
 Represents encrypting or decrypting a Pdf file with owner or user password, changing the security setting and password. More...
 
class  PdfFileSignature
 Represents a class to sign a pdf file with a certificate. More...
 
class  PdfFileStamp
 Class for adding stamps (watermark or background) to PDF files. More...
 
class  PdfJavaScriptStripper
 Class for removing all Java Script code. More...
 
class  PdfPageEditor
 Represents a class to edit the PDF file's page, including rotating page, zooming page, moving position and changing page size. More...
 
class  PdfPrintPageInfo
 Represents an object that contains current printing page info. More...
 
class  PdfProducer
 Represents a class to produce PDF from other formats. This sample shows how to produce Pdf file from CGM file. More...
 
class  PdfXmpMetadata
 Class for manipulation with XMP metadata. More...
 
class  ReplaceTextStrategy
 Action to perform if font does not contain required character More...
 
class  SaveableFacade
 Base class for all saveable facades. More...
 
class  Stamp
 Class represeting stamp. More...
 
class  StampInfo
 Class representing stamp information. More...
 
class  TextProperties
 Represents text properties such as: text size, color, style etc. More...
 
class  ViewerPreference
 Describes viewer prefereces (page mode, non full screen page mode, page layout). More...
 

Typedefs

using PdfQueryPageSettingsEventHandler = System::MulticastDelegate< void(System::SharedPtr< System::Object >, System::SharedPtr< System::Drawing::Printing::QueryPageSettingsEventArgs >, System::SharedPtr< PdfPrintPageInfo >)>
 

Enumerations

enum  Algorithm { Algorithm::RC4, Algorithm::AES }
 Represents algorithms which can be used to encrypt pdf document. More...
 
enum  AutoRotateMode { AutoRotateMode::None, AutoRotateMode::ClockWise, AutoRotateMode::AntiClockWise }
 Direction of the rotation when document is printed. More...
 
enum  BlendingColorSpace { BlendingColorSpace::DontChange, BlendingColorSpace::Auto, BlendingColorSpace::DeviceRGB, BlendingColorSpace::DeviceCMYK }
 Class represents blending color space. More...
 
enum  DataType {
  DataType::FDF, DataType::XML, DataType::XFDF, DataType::PDF,
  DataType::OLEDB, DataType::ODBC
}
 Enumerates field types definitions. More...
 
enum  DefaultMetadataProperties {
  DefaultMetadataProperties::Advisory, DefaultMetadataProperties::BaseURL, DefaultMetadataProperties::CreateDate, DefaultMetadataProperties::CreatorTool,
  DefaultMetadataProperties::Identifier, DefaultMetadataProperties::MetadataDate, DefaultMetadataProperties::ModifyDate, DefaultMetadataProperties::Nickname,
  DefaultMetadataProperties::Thumbnails
}
 Enumeration of standard XMP properties. More...
 
enum  EncodingType {
  EncodingType::Identity_h, EncodingType::Identity_v, EncodingType::Cp1250, EncodingType::Cp1252,
  EncodingType::Cp1257, EncodingType::Winansi, EncodingType::Macroman
}
 Enumerates encoding types of the text using. More...
 
enum  FieldType {
  FieldType::Text, FieldType::ComboBox, FieldType::ListBox, FieldType::Radio,
  FieldType::CheckBox, FieldType::PushButton, FieldType::MultiLineText, FieldType::Barcode,
  FieldType::InvalidNameOrType, FieldType::Signature, FieldType::Image
}
 Enumeration of possible field types. More...
 
enum  FontStyle {
  FontStyle::Courier = 0, FontStyle::CourierBold = 1, FontStyle::CourierOblique = 2, FontStyle::CourierBoldOblique = 3,
  FontStyle::Helvetica = 4, FontStyle::HelveticaBold = 5, FontStyle::HelveticaOblique = 6, FontStyle::HelveticaBoldOblique = 7,
  FontStyle::Symbol = 8, FontStyle::TimesRoman = 9, FontStyle::TimesBold = 10, FontStyle::TimesItalic = 11,
  FontStyle::TimesBoldItalic = 12, FontStyle::ZapfDingbats = 13, FontStyle::Unknown = 14, FontStyle::CjkFont = 15
}
 Enumerates 14 types of font. More...
 
enum  KeySize { KeySize::x40, KeySize::x128, KeySize::x256 }
 Defines different key sizes which can be used to encrypt pdf documents. More...
 
enum  PositioningMode { PositioningMode::Legacy, PositioningMode::ModernLineSpacing, PositioningMode::Current }
 Defines positioning mode. Possible values include Legacy (backward compatibility) and Current (updated text position calculation method) More...
 
enum  PropertyFlag { PropertyFlag::ReadOnly, PropertyFlag::Required, PropertyFlag::NoExport, PropertyFlag::InvalidFlag }
 Enumeration of possible field flags. More...
 
enum  StampType { StampType::Form, StampType::Image }
 Describes stamp types. More...
 
enum  SubmitFormFlag {
  SubmitFormFlag::Fdf, SubmitFormFlag::Html, SubmitFormFlag::Xfdf, SubmitFormFlag::FdfWithComments,
  SubmitFormFlag::XfdfWithComments, SubmitFormFlag::Pdf
}
 Enumeration of possible submit form flags. More...
 
enum  WordWrapMode { WordWrapMode::Default, WordWrapMode::ByWords }
 Defines word wrapping strategies More...
 

Functions

Aspose::Pdf::Facades::PdfContentEditor Aspose::Pdf::Facades::SaveableFacade GetViewerPreference ()
 
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...
 
System::Object::shared_members_type GetSharedMembers () override
 
 DECLARE_ENUM_OPERATORS (Aspose::Pdf::Facades::SubmitFormFlag)
 

Typedef Documentation

◆ PdfQueryPageSettingsEventHandler

Enumeration Type Documentation

◆ Algorithm

Represents algorithms which can be used to encrypt pdf document.

Enumerator
RC4 

RC4 algorithm.

AES 

AES algorithm.

◆ AutoRotateMode

Direction of the rotation when document is printed.

Enumerator
None 

No rotation.

ClockWise 

Rotation direction is clockwise.

AntiClockWise 

Rotation directon is counterclockwise.

◆ BlendingColorSpace

Class represents blending color space.

Enumerator
DontChange 

The blending color space is not changed.

Auto 

The blending color space is determined automatically.

DeviceRGB 

Blending color space is set to DeviceRGB.

DeviceCMYK 

Blending color space is set to DeviceCMYK.

◆ DataType

Enumerates field types definitions.

Enumerator
FDF 

FDF stream.

XML 

XML stream.

XFDF 

XFDF stream.

PDF 

PDF stream.

OLEDB 

OLEDB database, such as MS Access.

ODBC 

ODBC database, such as MS SQL Server.

◆ DefaultMetadataProperties

Enumeration of standard XMP properties.

Enumerator
Advisory 

xmp:Advisory property. An unordered array specifying properties that were edited outside the authoring application. Each item should contain a single /// namespace and XPath separated by one ASCII space

BaseURL 

xmp:BaseURL property. The base URL for relative URLs in the document content. If this document contains Internet links, and those links are relative, /// they are relative to this base URL. This property provides a standard way for embedded relative URLs to be interpreted by tools. /// Web authoring tools should set the value based on their notion of where URLs will be interpreted

CreateDate 

xmp:CreateDate property. The date and time the resource was originally created.

CreatorTool 

xmp:CreatorTool property. The name of the first known tool used to create the resource.

Identifier 

xmp:Identifier property. An unordered array of text strings that unambiguously identify the resource within a given context

MetadataDate 

xmp:MetadataDate property. The date and time that any metadata for this resource was last changed

ModifyDate 

xmp:ModifyDate property. The date and time the resource was last modified.

Nickname 

xmp:Nickname property. A short informal name for the resource.

Thumbnails 

xmp:Thumbnails property. An alternative array of thumbnail images for a file, which can differ in characteristics such as size or image encoding.

◆ EncodingType

Enumerates encoding types of the text using.

Enumerator
Identity_h 

The Unicode encoding with horizontal writing.

Identity_v 

The Unicode encoding with vertical writing.

Cp1250 

A windows text encoding name.

Cp1252 

A windows text encoding name.

Cp1257 

A windows text encoding name.

Winansi 

Windows ansi encoding.

Macroman 

Mac os standard encoding for Latin text.

◆ FieldType

Enumeration of possible field types.

Enumerator
Text 

Text field.

ComboBox 

Combo box field.

ListBox 

List box field.

Radio 

Radio button field.

CheckBox 

Check box field.

PushButton 

Push button field.

MultiLineText 

Multiline text field.

Barcode 

Barcode field.

InvalidNameOrType 

Invalid field type.

Signature 

Signature field.

Image 

Image field.

◆ FontStyle

Enumerates 14 types of font.

Enumerator
Courier 

Courier font.

CourierBold 

Bold Courier font.

CourierOblique 

Oblique Curier font.

CourierBoldOblique 

Bold oblique Courier font.

Helvetica 

Helvetica font.

HelveticaBold 

Bold Helvetica font.

HelveticaOblique 

Oblique Helvetica font.

HelveticaBoldOblique 

Bold oblique Helvetica font.

Symbol 

Symbol font.

TimesRoman 

Times-Roman font.

TimesBold 

Bold Times font.

TimesItalic 

Italic Times font.

TimesBoldItalic 

Bold italic Times font.

ZapfDingbats 

ZapfDingbats font.

Unknown 

Unknown font. Standard font will be used.

CjkFont 

True Type Font for CJK supporting ,default is MS PGothic font.

◆ KeySize

Defines different key sizes which can be used to encrypt pdf documents.

Enumerator
x40 

40 bit key. Such key size is used with RC4 algorithm and provides low level of security. Nevertheless old versions of pdf documents can be encrypted only with such keys (v. 1.3 and lower);

x128 

128 bit key. Both RC4 and AES algorithms can use such key size.

x256 

256 bit key. Such key size can be used only with AES and is recognized with the last Adobe Reader versions (starting from v.9).

◆ PositioningMode

Defines positioning mode. Possible values include Legacy (backward compatibility) and Current (updated text position calculation method)

Enumerator
Legacy 

Legacy text positioning

ModernLineSpacing 

Updated line spacing, vertical position calculation is done by the old rules (i.e. text is positioned relative to bottom-left corner of the specified rectangle)

Current 

Updated line spacing and vertical position calculation is done based on left-top corner rather than left-bottom.

◆ PropertyFlag

Enumeration of possible field flags.

Enumerator
ReadOnly 

Field is read-only.

Required 

Field is required.

NoExport 

Field is not exportable.

InvalidFlag 

Invalid field flag.

◆ StampType

Describes stamp types.

Enumerator
Form 

Stamp if Form.

Image 

Stamp is image.

◆ SubmitFormFlag

Enumeration of possible submit form flags.

Enumerator
Fdf 

Data will be returned in FDF format.

Html 

Data will be returned in HTML format.

Xfdf 

Data will be returned in XFDF format.

FdfWithComments 

Data will be returned in FDF format with comments.

XfdfWithComments 

Data will be returned in XFDF format with comments.

Pdf 

Whole PDF file will be submitted.

◆ WordWrapMode

Defines word wrapping strategies

Enumerator
Default 

Default algorithm (allows breaking words in the middle)

ByWords 

Word wrapping only wraps complete words. If the complete word cannot be wrapped, attempts to wrap word in the middle

Function Documentation

◆ Close()

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

Closes opened document.

◆ CreateLocalLink()

void Aspose::Pdf::Facades::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.
System::SharedPtr<Aspose::Pdf::Facades::PdfContentEditor> editor = System::MakeObject<Aspose::Pdf::Facades::PdfContentEditor>();
editor->BindPdf(L"example.pdf");
editor->CreateLocalLink(System::Drawing::Rectangle(0, 0, 100, 100), 2, 1);
editor->Save(L"example_out.pdf");

◆ CreateMovie()

void Aspose::Pdf::Facades::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.

◆ CreateSound()

void Aspose::Pdf::Facades::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.

◆ DECLARE_ENUM_OPERATORS()

Aspose::Pdf::Facades::DECLARE_ENUM_OPERATORS ( Aspose::Pdf::Facades::SubmitFormFlag  )

◆ DeleteImage() [1/2]

void Aspose::Pdf::Facades::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.
System::SharedPtr<Aspose::Pdf::Facades::PdfContentEditor> editor = System::MakeObject<Aspose::Pdf::Facades::PdfContentEditor>();
editor->BindPdf(L"example.pdf");
editor->DeleteImage(1, System::MakeArray<int32_t>({ 1, 2}));
editor->Save(L"example_out.pdf");

◆ DeleteImage() [2/2]

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

Deletes all images from PDF document.

System::SharedPtr<Aspose::Pdf::Facades::PdfContentEditor> editor = System::MakeObject<Aspose::Pdf::Facades::PdfContentEditor>();
editor->BindPdf(L"example.pdf");
editor->DeleteImage();
editor->Save(L"example_out.pdf");

◆ DeleteStamp()

void Aspose::Pdf::Facades::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.
System::SharedPtr<Aspose::Pdf::Facades::PdfContentEditor> contentEditor = System::MakeObject<Aspose::Pdf::Facades::PdfContentEditor>();
contentEditor->BindPdf(L"file.pdf");
contentEditor->DeleteStamp(1, System::MakeArray<int32_t>({ 2, 3, 5}));
contentEditor->Save(L"outfile.pdf");

◆ DeleteStampById() [1/2]

void Aspose::Pdf::Facades::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.
System::SharedPtr<Aspose::Pdf::Facades::PdfContentEditor> contentEditor = System::MakeObject<Aspose::Pdf::Facades::PdfContentEditor>();
contentEditor->BindPdf(L"file.pdf");
contentEditor->DeleteStampById(1, 100);
contentEditor->Save(L"outfile.pdf");

◆ DeleteStampById() [2/2]

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

Delete stamp by ID from all pages of the document.

Parameters
stampIdIdentifier of stamp which should be deleted.
System::SharedPtr<Aspose::Pdf::Facades::PdfContentEditor> contentEditor = System::MakeObject<Aspose::Pdf::Facades::PdfContentEditor>();
contentEditor->BindPdf(L"file.pdf");
contentEditor->DeleteStampById(100);
contentEditor->Save(L"outfile.pdf");

◆ DeleteStampByIds() [1/2]

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

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

Parameters
stampIdsArray of stamp IDs.
System::SharedPtr<Aspose::Pdf::Facades::PdfContentEditor> contentEditor = System::MakeObject<Aspose::Pdf::Facades::PdfContentEditor>();
contentEditor->BindPdf(L"file.pdf");
contentEditor->DeleteStampByIds(System::MakeArray<int32_t>({ 102, 103}));
contentEditor->Save(L"outfile.pdf");

◆ DeleteStampByIds() [2/2]

void Aspose::Pdf::Facades::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.
System::SharedPtr<Aspose::Pdf::Facades::PdfContentEditor> contentEditor = System::MakeObject<Aspose::Pdf::Facades::PdfContentEditor>();
contentEditor->BindPdf(L"file.pdf");
contentEditor->DeleteStampByIds(1, System::MakeArray<int32_t>({ 100, 101}));
contentEditor->Save(L"outfile.pdf");

◆ GetSharedMembers()

System::Object::shared_members_type Aspose::Pdf::Facades::GetSharedMembers ( )
overrideprotected

◆ GetStamps()

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

Returns array of stamps on the page.

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

◆ GetViewerPreference()

◆ HideStampById()

void Aspose::Pdf::Facades::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::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::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.

◆ PdfContentEditor() [1/2]

The constructor of the PdfContentEditor object.

◆ PdfContentEditor() [2/2]

Initializes new PdfContentEditor object on base of the document .

Parameters
documentPdf document.

◆ ReplaceImage()

void Aspose::Pdf::Facades::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.
System::SharedPtr<Aspose::Pdf::Facades::PdfContentEditor> editor = System::MakeObject<Aspose::Pdf::Facades::PdfContentEditor>();
editor->BindPdf(L"example.pdf");
editor->ReplaceImage(1, 1, L"image.jpg");
editor->Save(L"example_out.pdf");

◆ ReplaceText() [1/5]

bool Aspose::Pdf::Facades::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
System::SharedPtr<Aspose::Pdf::Document> doc = System::MakeObject<Aspose::Pdf::Document>(inFile);
// Create font and mark it to be embedded
font->set_IsEmbedded(true);
// create PdfContentEditor object to edit text
System::SharedPtr<Aspose::Pdf::Facades::PdfContentEditor> editor = System::MakeObject<Aspose::Pdf::Facades::PdfContentEditor>();
editor->BindPdf(doc);
// create textState object
System::SharedPtr<Aspose::Pdf::Text::TextState> textState = System::MakeObject<Aspose::Pdf::Text::TextState>();
textState->set_Font(font);
textState->set_FontSize(17);
// change text with specified font
editor->ReplaceText(L"hello world", 1, L"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::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
System::SharedPtr<Aspose::Pdf::Document> doc = System::MakeObject<Aspose::Pdf::Document>(inFile);
// create PdfContentEditor object to edit text
System::SharedPtr<Aspose::Pdf::Facades::PdfContentEditor> editor = System::MakeObject<Aspose::Pdf::Facades::PdfContentEditor>();
editor->BindPdf(doc);
// change text
editor->ReplaceText(L"hello world", L"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::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
System::SharedPtr<Aspose::Pdf::Document> doc = System::MakeObject<Aspose::Pdf::Document>(inFile);
// create PdfContentEditor object to edit text
System::SharedPtr<Aspose::Pdf::Facades::PdfContentEditor> editor = System::MakeObject<Aspose::Pdf::Facades::PdfContentEditor>();
editor->BindPdf(doc);
// change text
editor->ReplaceText(L"hello world", 1, L"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::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
System::SharedPtr<Aspose::Pdf::Document> doc = System::MakeObject<Aspose::Pdf::Document>(inFile);
// Create font and mark it to be embedded
font->set_IsEmbedded(true);
// create PdfContentEditor object to edit text
System::SharedPtr<Aspose::Pdf::Facades::PdfContentEditor> editor = System::MakeObject<Aspose::Pdf::Facades::PdfContentEditor>();
editor->BindPdf(doc);
// create textState object
System::SharedPtr<Aspose::Pdf::Text::TextState> textState = System::MakeObject<Aspose::Pdf::Text::TextState>();
textState->set_Font(font);
// change text with specified font
editor->ReplaceText(L"hello world", L"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::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
System::SharedPtr<Aspose::Pdf::Document> doc = System::MakeObject<Aspose::Pdf::Document>(inFile);
// Create font and mark it to be embedded
font->set_IsEmbedded(true);
// create PdfContentEditor object to edit text
System::SharedPtr<Aspose::Pdf::Facades::PdfContentEditor> editor = System::MakeObject<Aspose::Pdf::Facades::PdfContentEditor>();
editor->BindPdf(doc);
// change text with specified font
editor->ReplaceText(L"hello world", L"hi world", 14);
// save document
doc->Save(outFile);
Parameters
srcStringString to be replaced.
destStringReplacing string.
fontSizeFont size.
Returns
Returns true if replacement was made.

◆ ShowStampById()

void Aspose::Pdf::Facades::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.