PdfContentEditor
概述
PdfContentEditor 是 Aspose.PDF 为 C++ 提供的 FOSS(自由开源软件)中的一个类。
PdfContentEditor.ReplaceText(srcText, destText) 会搜索整个文档并替换匹配的字符串,在至少完成一次替换时返回 true。
此类在 C++ 程序中提供了用于操作 PdfContentEditor 对象的 22 个方法。可用的方法包括:AddDocumentAdditionalAction、AddDocumentAttachment、ChangeViewerPreference、DeleteAttachments、DeleteImage、DeleteStamp、DeleteStampById、DeleteStampByIds、GetViewerPreference、HideStampById、MoveStamp、MoveStampById,以及另外 5 个方法。安装 Aspose.PDF 为 C++ 提供的 FOSS 包后,所有公共成员均可供任何 C++ 应用程序访问。访问器方法:DocumentClose、DocumentOpen、DocumentPrinted、DocumentSaved、DocumentWillPrint、DocumentWillSave。
访问器方法
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
DocumentOpen | std::string | 读写 | 获取或设置文档打开。 |
DocumentClose | std::string | 读写 | 获取或设置文档关闭。 |
DocumentWillSave | std::string | 读写 | 获取或设置要保存的文档。 |
DocumentSaved | std::string | 读写 | 获取或设置已保存的文档。 |
DocumentWillPrint | std::string | 读写 | 获取或设置文档将打印的内容。 |
DocumentPrinted | std::string | 读写 | 获取或设置打印的文档。 |
方法
| 签名 | 描述 |
|---|---|
PdfContentEditor() | 在此 PdfContentEditor 实例上调用 PdfContentEditor。 |
AddDocumentAttachment(path: std::string, description: std::string) | 在此 PdfContentEditor 实例上调用 AddDocumentAttachment(path, description)。 |
DeleteAttachments() | 在此 PdfContentEditor 实例上调用 DeleteAttachments。 |
AddDocumentAdditionalAction(actionName: std::string, javaScript: std::string) | 在此 PdfContentEditor 实例上调用 AddDocumentAdditionalAction(actionName, javaScript)。 |
RemoveDocumentOpenAction() | 在此 PdfContentEditor 实例上调用 RemoveDocumentOpenAction。 |
ChangeViewerPreference(pageLayout: int) | 在此 PdfContentEditor 实例上调用 ChangeViewerPreference(pageLayout)。 |
GetViewerPreference() → int | 返回查看器的偏好设置。 |
ReplaceImage(pageNum: int, imageNum: int, fileName: std::string) | 在此 PdfContentEditor 实例上调用 ReplaceImage(pageNum, imageNum, fileName)。 |
DeleteImage(pageNum: int, imageNum: std::vector<int>) | 在此 PdfContentEditor 实例上调用 DeleteImage(pageNum, imageNum)。 |
DeleteImage() | |
ReplaceText(srcText: std::string, destText: std::string) → bool | 搜索整个文档并替换匹配的字符串,当至少发生一次替换时返回 true |
ReplaceText(srcText: std::string, pageNum: int, destText: std::string) → bool | 在此 PdfContentEditor 实例上调用 ReplaceText(srcText, pageNum, destText)。 |
ReplaceText(srcText: std::string, destText: std::string, pageNum: int) → bool | 在此 PdfContentEditor 实例上调用 ReplaceText(srcText, destText, pageNum)。 |
DeleteStamp(pageNum: int, stampId: std::vector<int>) | 在此 PdfContentEditor 实例上调用 DeleteStamp(pageNum, stampId)。 |
DeleteStampByIds(stampIds: std::vector<int>) | 在此 PdfContentEditor 实例上调用 DeleteStampByIds(stampIds)。 |
DeleteStampByIds(pageNum: int, stampIds: std::vector<int>) | 在此 PdfContentEditor 实例上调用 DeleteStampByIds(pageNum, stampIds)。 |
DeleteStampById(pageNum: int, stampId: int) | 在此 PdfContentEditor 实例上调用 DeleteStampById(pageNum, stampId)。 |
DeleteStampById(stampId: int) | 在此 PdfContentEditor 实例上调用 DeleteStampById(stampId)。 |
HideStampById(pageNum: int, stampId: int) | 在此 PdfContentEditor 实例上调用 HideStampById(pageNum, stampId)。 |
ShowStampById(pageNum: int, stampId: int) | 在此 PdfContentEditor 实例上调用 ShowStampById(pageNum, stampId)。 |
MoveStampById(pageNum: int, stampId: int, offsetX: double, offsetY: double) | 在此 PdfContentEditor 实例上调用 MoveStampById(pageNum, stampId, offsetX, offsetY)。 |
MoveStamp(pageNum: int, stampId: int, offsetX: double, offsetY: double) | 在此 PdfContentEditor 实例上调用 MoveStamp(pageNum, stampId, offsetX, offsetY)。 |