PdfContentEditor
Обзор
PdfContentEditor — это класс в Aspose.PDF FOSS для .NET. Наследует от: System.IDisposable.
Фасад для редактирования на уровне контента: замена текста, создание ссылок, операции с изображениями.
Этот класс предоставляет 83 метода для работы с объектами PdfContentEditor в программах .NET. Доступные методы включают: AddDocumentAdditionalAction, AddDocumentAttachment, BindPdf, ChangeViewerPreference, Close, CreateApplicationLink, CreateBookmarksAction, CreateCaret, CreateCustomActionLink, CreateFileAttachment, CreateFreeText, CreateJavaScriptLink и ещё 35 методов. Все публичные члены доступны любой .NET-приложению после установки пакета Aspose.PDF FOSS для .NET. Свойства: Document, DocumentClose, DocumentOpen, DocumentPrinted, DocumentSaved, DocumentWillPrint и ещё 5.
Свойства
| Имя: | Тип: | Доступ | Описание: |
|---|---|---|---|
Document | Document | Чтение | PDF-документ в данный момент привязан к редактированию. |
TextReplaceOptions | TextReplaceOptions | Чтение/запись | Варианты замены текста, используемые семейством ReplaceText(string,string). |
TextEditOptions | TextEditOptions | Чтение/запись | Параметры редактирования текста, передаваемые нижележащему движку замены. |
TextSearchOptions | TextSearchOptions | Чтение/запись | Параметры поиска текста, используемые вариантами замены текста с сохранением состояния. |
ReplaceTextStrategy | ReplaceTextStrategy | Чтение/запись | Получает или задает стратегию замены текста. |
DocumentOpen | string | Чтение | Получает открытый документ. |
DocumentClose | string | Чтение | Получает закрытие документа. |
DocumentWillSave | string | Чтение | Получает документ, который будет сохранён. |
DocumentSaved | string | Чтение | Получает сохранённый документ. |
DocumentWillPrint | string | Чтение | Получает документ, который будет печататься. |
DocumentPrinted | string | Чтение | Получает печатный документ. |
Методы
| Подпись | Описание: |
|---|---|
PdfContentEditor() | Конструктор по умолчанию — привязывайте PDF позже через BindPdf(string). |
PdfContentEditor(document: Document) | Привязать к существующему Document при создании. |
BindPdf(pdfData: byte[]) | Привязать PDF-файл для редактирования. |
BindPdf(inputFile: string) | Привязать PDF-файл по пути для редактирования. |
BindPdf(inputStream: Stream) | Привязать PDF-поток для редактирования. |
BindPdf(srcDoc: Document) | Привязать PDF-документ в памяти для редактирования. |
Save() | Сохранить привязанный документ. |
Save(path: string) | Сохраните bound document по пути к файлу. |
Save(stream: Stream) | Сохраните bound document в поток. |
Close() | Закройте bound document. |
Dispose() | Освобождает bound document (то же, что и Close). |
GetViewerPreference() | Получить текущие флаги настроек просмотрщика в виде целочисленной битовой маски. |
ChangeViewerPreference(viewerAttribution: int) | Изменить настройку просмотрщика. |
GetStamps(pageNumber: int) | Получить информацию о штампах на странице. |
DeleteStamp(pageNumber: int, index: int[]) | Удалить штампы на странице по их нулевым индексам. |
DeleteStampById(pageNumber: int, stampId: int) | Удалить штамп по его ID (ID, назначенный через Stamp.StampId). |
DeleteStampByIds(pageNumber: int, stampIds: int[]) | Удалить штампы по их ID. |
ReplaceText(srcString: string, destString: string) | Заменить текст в связанном документе согласно ReplaceTextStrategy. |
ReplaceText(srcString: string, thePage: int, destString: string) | Заменить текст на конкретной странице (нумерация с 1). |
ReplaceText(srcString: string, destString: string, textState: TextState) | Заменить текст с явным TextState форматированием (шрифт/размер/цвет). |
ReplaceText(srcString: string, thePage: int, destString: string, textState: TextState) | Заменить текст на конкретной странице на явный TextState. |
ReplaceText(srcString: string, destString: string, fontSize: int) | Заменить текст и переопределить размер шрифта заменяемого фрагмента. |
ReplaceText(input: byte[], searchText: string, replaceText: string) | Заменить все вхождения текста на всех страницах. |
ReplaceText(input: byte[], searchText: string, replaceText: string, options: TextSearchOptions) | Заменить все вхождения текста на всех страницах, используя параметры поиска. |
ReplaceTextOnPage(input: byte[], pageNumber: int, searchText: string, replaceText: string) | Replace text on a specific page (1-based). |
CreateLocalLink(input: byte[], rect: Rectangle, pageNumber: int, destinationPage: int) | Create a local link annotation that navigates to a page in the same document. |
CreateWebLink(input: byte[], rect: Rectangle, pageNumber: int, url: string) | Create a URI link annotation that opens a URL. |
CreateFreeText(input: byte[], rect: Rectangle, pageNumber: int, text: string, fontName: string?, fontSize: double) | Create a free text annotation on a page. |
CreateText(input: byte[], rect: Rectangle, pageNumber: int, title: string, contents: string) | Создать текстовую (липкую заметку) аннотацию на странице. |
DeleteAnnotations(input: byte[], pageNumber: int) | Удалить все аннотации на конкретной странице. |
DeleteAnnotations(input: byte[], pageNumber: int, annotationType: string) | Удалить аннотации конкретного подтипа со страницы. |
ExtractText(input: byte[], pageNumber: int) | Извлечь текст с конкретной страницы. |
ExtractText(input: byte[]) | Извлечь текст со всех страниц. |
DrawCurve(lineInfo: LineInfo, page: int, annotRect: System.Drawing.Rectangle, annotContents: string) | Перегрузка, которая преобразует Rectangle в форму PDF-прямоугольника и делегирует. |
DrawCurve(lineInfo: LineInfo, pageNumber: int, rect: Rectangle, message: string?) | Нарисовать кривую (полилинию) на странице. |
CreateLocalLink(rect: System.Drawing.Rectangle, desPage: int, originalPage: int) | Вызывает CreateLocalLink(rect, desPage, originalPage) у этого экземпляра PdfContentEditor. |
CreateLocalLink(rect: System.Drawing.Rectangle, desPage: int, originalPage: int, clr: System.Drawing.Color) | Вызывает CreateLocalLink(rect, desPage, originalPage, clr) у этого экземпляра PdfContentEditor. |
CreateLocalLink(rect: System.Drawing.Rectangle, desPage: int, originalPage: int, clr: System.Drawing.Color, actionName: System.Enum[]) | Выполняет вызов CreateLocalLink(rect, desPage, originalPage, clr, actionName) у этого экземпляра PdfContentEditor. |
CreateWebLink(rect: System.Drawing.Rectangle, url: string, originalPage: int) | Выполняет вызов CreateWebLink(rect, url, originalPage) у этого экземпляра PdfContentEditor. |
CreateWebLink(rect: System.Drawing.Rectangle, url: string, originalPage: int, clr: System.Drawing.Color) | Выполняет вызов CreateWebLink(rect, url, originalPage, clr) у этого экземпляра PdfContentEditor. |
CreateWebLink(rect: System.Drawing.Rectangle, url: string, originalPage: int, clr: System.Drawing.Color, actionName: System.Enum[]) | Выполняет вызов CreateWebLink(rect, url, originalPage, clr, actionName) у этого экземпляра PdfContentEditor. |
CreateApplicationLink(rect: System.Drawing.Rectangle, application: string, page: int) | Вызывает CreateApplicationLink(rect, application, page) у этого экземпляра PdfContentEditor. |
CreateApplicationLink(rect: System.Drawing.Rectangle, application: string, page: int, clr: System.Drawing.Color) | Вызывает CreateApplicationLink(rect, application, page, clr) у этого экземпляра PdfContentEditor. |
CreateApplicationLink(rect: System.Drawing.Rectangle, application: string, page: int, clr: System.Drawing.Color, actionName: System.Enum[]) | Вызывает CreateApplicationLink(rect, application, page, clr, actionName) у этого экземпляра PdfContentEditor. |
CreatePdfDocumentLink(rect: System.Drawing.Rectangle, remotePdf: string, originalPage: int, destinationPage: int) | Вызывает CreatePdfDocumentLink(rect, remotePdf, originalPage, destinationPage) у этого экземпляра PdfContentEditor. |
CreatePdfDocumentLink(rect: System.Drawing.Rectangle, remotePdf: string, originalPage: int, destinationPage: int, clr: System.Drawing.Color) | Вызывает CreatePdfDocumentLink(rect, remotePdf, originalPage, destinationPage, clr) на этом экземпляре PdfContentEditor. |
CreatePdfDocumentLink(rect: System.Drawing.Rectangle, remotePdf: string, originalPage: int, destinationPage: int, clr: System.Drawing.Color, actionName: System.Enum[]) | Вызывает CreatePdfDocumentLink(rect, remotePdf, originalPage, destinationPage, clr, actionName) на этом экземпляре PdfContentEditor. |
CreateJavaScriptLink(code: string, rect: System.Drawing.Rectangle, originalPage: int, color: System.Drawing.Color) | Вызывает CreateJavaScriptLink(code, rect, originalPage, color) на этом экземпляре PdfContentEditor. |
CreateCustomActionLink(rect: System.Drawing.Rectangle, originalPage: int, color: System.Drawing.Color, actionName: System.Enum[]) | Вызывает CreateCustomActionLink(rect, originalPage, color, actionName) на этом экземпляре PdfContentEditor. |
CreateFreeText(rect: System.Drawing.Rectangle, contents: string, page: int) | Вызывает CreateFreeText(rect, contents, page) у этого экземпляра PdfContentEditor. |
CreateText(rect: System.Drawing.Rectangle, title: string, contents: string, open: bool, icon: string, page: int) | Вызывает CreateText(rect, title, contents, open, icon, page) у этого экземпляра PdfContentEditor. |
CreateCaret(page: int, annotRect: System.Drawing.Rectangle, caretRect: System.Drawing.Rectangle, symbol: string, annotContents: string, color: System.Drawing.Color) | Вызывает CreateCaret(page, annotRect, caretRect, symbol, annotContents, color) у этого экземпляра PdfContentEditor. |
CreateMarkup(rect: System.Drawing.Rectangle, contents: string, type: int, page: int, clr: System.Drawing.Color) | Вызывает CreateMarkup(rect, contents, type, page, clr) у этого экземпляра PdfContentEditor. |
CreateSquareCircle(rect: System.Drawing.Rectangle, contents: string, clr: System.Drawing.Color, square: bool, page: int, borderWidth: int) | Вызывает CreateSquareCircle(rect, contents, clr, square, page, borderWidth) на этом экземпляре PdfContentEditor. |
CreateLine(rect: System.Drawing.Rectangle, contents: string, x1: float, y1: float, x2: float, y2: float, page: int, border: int, clr: System.Drawing.Color, borderStyle: string, dashArray: int[], LEArray: string[]) | Вызывает CreateLine(rect, contents, x1, y1, x2, y2, page, border, clr, borderStyle, dashArray, LEArray) на этом экземпляре PdfContentEditor. |
CreatePolygon(lineInfo: LineInfo, page: int, annotRect: System.Drawing.Rectangle, annotContents: string) | Вызывает CreatePolygon(lineInfo, page, annotRect, annotContents) на этом экземпляре PdfContentEditor. |
CreatePolyLine(lineInfo: LineInfo, page: int, annotRect: System.Drawing.Rectangle, annotContents: string) | Вызывает CreatePolyLine(lineInfo, page, annotRect, annotContents) на этом экземпляре PdfContentEditor. |
CreatePopup(rect: System.Drawing.Rectangle, contents: string, open: bool, page: int) | Вызывает CreatePopup(rect, contents, open, page) на этом экземпляре PdfContentEditor. |
CreateRubberStamp(page: int, annotRect: System.Drawing.Rectangle, annotContents: string, color: System.Drawing.Color, appearanceFile: string) | Вызывает CreateRubberStamp(page, annotRect, annotContents, color, appearanceFile) на этом экземпляре PdfContentEditor. |
CreateRubberStamp(page: int, annotRect: System.Drawing.Rectangle, annotContents: string, color: System.Drawing.Color, appearanceStream: Stream) | Вызывает CreateRubberStamp(page, annotRect, annotContents, color, appearanceStream) на этом экземпляре PdfContentEditor. |
CreateRubberStamp(page: int, annotRect: System.Drawing.Rectangle, icon: string, annotContents: string, color: System.Drawing.Color) | Вызывает CreateRubberStamp(page, annotRect, icon, annotContents, color) на этом экземпляре PdfContentEditor. |
CreateMovie(rect: System.Drawing.Rectangle, filePath: string, page: int) | Выполняет вызов CreateMovie(rect, filePath, page) на этом экземпляре PdfContentEditor. |
CreateSound(rect: System.Drawing.Rectangle, filePath: string, name: string, page: int, rate: string) | Вызывает CreateSound(rect, filePath, name, page, rate) у этого экземпляра PdfContentEditor. |
CreateFileAttachment(rect: System.Drawing.Rectangle, contents: string, filePath: string, page: int, name: string) | Вызывает CreateFileAttachment(rect, contents, filePath, page, name) у этого экземпляра PdfContentEditor. |
CreateFileAttachment(rect: System.Drawing.Rectangle, contents: string, filePath: string, page: int, name: string, opacity: double) | Вызывает CreateFileAttachment(rect, contents, filePath, page, name, opacity) у этого экземпляра PdfContentEditor. |
CreateFileAttachment(rect: System.Drawing.Rectangle, contents: string, attachmentStream: Stream, attachmentName: string, page: int, name: string) | Вызывает CreateFileAttachment(rect, contents, attachmentStream, attachmentName, page, name) у этого экземпляра PdfContentEditor. |
CreateFileAttachment(rect: System.Drawing.Rectangle, contents: string, attachmentStream: Stream, attachmentName: string, page: int, name: string, opacity: double) | Выполняет вызов CreateFileAttachment(rect, contents, attachmentStream, attachmentName, page, name, opacity) у этого экземпляра PdfContentEditor. |
CreateBookmarksAction(title: string, color: System.Drawing.Color, boldFlag: bool, italicFlag: bool, file: string, actionType: string, destination: string) | Выполняет вызов CreateBookmarksAction(title, color, boldFlag, italicFlag, file, actionType, destination) у этого экземпляра PdfContentEditor. |
AddDocumentAdditionalAction(eventType: string, code: string) | Выполняет вызов AddDocumentAdditionalAction(eventType, code) у этого экземпляра PdfContentEditor. |
RemoveDocumentOpenAction() | Выполняет вызов RemoveDocumentOpenAction у этого экземпляра PdfContentEditor. |
AddDocumentAttachment(fileAttachmentPath: string, description: string) | Вызывает AddDocumentAttachment(fileAttachmentPath, description) на этом экземпляре PdfContentEditor. |
AddDocumentAttachment(fileAttachmentStream: Stream, fileAttachmentName: string, description: string) | Вызывает AddDocumentAttachment(fileAttachmentStream, fileAttachmentName, description) на этом экземпляре PdfContentEditor. |
DeleteAttachments() | Вызывает DeleteAttachments на этом экземпляре PdfContentEditor. |
ExtractLink() | Вызывает ExtractLink на этом экземпляре PdfContentEditor. |
DeleteImage() | Вызывает DeleteImage у данного экземпляра PdfContentEditor. |
DeleteImage(pageNumber: int, index: int[]) | Вызывает DeleteImage(pageNumber, index) у данного экземпляра PdfContentEditor. |
ReplaceImage(pageNumber: int, index: int, imageFile: string) | Вызывает ReplaceImage(pageNumber, index, imageFile) у данного экземпляра PdfContentEditor. |
HideStampById(pageNumber: int, stampId: int) | Скрыть штамп(ы) с указанным stampId на странице, не удаляя их: операторы рисования штампа сохраняются, но подавляются пустым-clip прологом, а маркер %StampHidden=1 фиксирует состояние, поэтому GetStamps сообщает Visible = false, а ShowStampById может восстановить его. |
ShowStampById(pageNumber: int, stampId: int) | Показать ранее скрытую печать: удалить скрытый маркер и пролог empty-clip, чтобы печать снова отрисовалась. |
DeleteStampById(stampId: int) | Удалить все печати с указанным stampId на всех страницах. |
DeleteStampByIds(stampIds: int[]) | Удалить все печати, идентификатор которых находится в stampIds, на всех страницах. |
MoveStamp(pageNumber: int, stampIndex: int, x: double, y: double) | Вызов MoveStamp(pageNumber, stampIndex, x, y) у этого экземпляра PdfContentEditor. |
MoveStampById(pageNumber: int, stampId: int, x: double, y: double) | Вызывает MoveStampById(pageNumber, stampId, x, y) на этом экземпляре PdfContentEditor. |