PdfContentEditor
Przegląd
PdfContentEditor jest klasą w Aspose.PDF FOSS dla .NET. Dziedziczy po: System.IDisposable.
Fasada do edycji na poziomie treści: zamiana tekstu, tworzenie linków, operacje na obrazach.
Ta klasa udostępnia 83 metody do pracy z obiektami PdfContentEditor w programach .NET. Dostępne metody obejmują: AddDocumentAdditionalAction, AddDocumentAttachment, BindPdf, ChangeViewerPreference, Close, CreateApplicationLink, CreateBookmarksAction, CreateCaret, CreateCustomActionLink, CreateFileAttachment, CreateFreeText, CreateJavaScriptLink oraz 35 dodatkowych metod. Wszystkie publiczne elementy są dostępne dla każdej aplikacji .NET po zainstalowaniu pakietu Aspose.PDF FOSS dla .NET. Właściwości: Document, DocumentClose, DocumentOpen, DocumentPrinted, DocumentSaved, DocumentWillPrint oraz 5 kolejnych.
Właściwości
| Nazwa | Typ | Dostęp | Opis |
|---|---|---|---|
Document | Document | Odczyt | Dokument PDF aktualnie przeznaczony do edycji. |
TextReplaceOptions | TextReplaceOptions | Odczyt/zapis | Opcje zamiany tekstu używane przez rodzinę ReplaceText(string,string). |
TextEditOptions | TextEditOptions | Odczyt/zapis | Opcje edycji tekstu przekazywane do leżącego u podstaw silnika zamiany. |
TextSearchOptions | TextSearchOptions | Odczyt/zapis | Opcje wyszukiwania tekstu używane przez stanowe warianty zamiany tekstu. |
ReplaceTextStrategy | ReplaceTextStrategy | Odczyt/zapis | Pobiera lub ustawia strategię zamiany tekstu. |
DocumentOpen | string | Odczyt | Pobiera otwarty dokument. |
DocumentClose | string | Odczyt | Pobiera zamknięcie dokumentu. |
DocumentWillSave | string | Odczyt | Pobiera dokument, który zostanie zapisany. |
DocumentSaved | string | Odczyt | Pobiera zapisany dokument. |
DocumentWillPrint | string | Odczyt | Pobiera dokument, który zostanie wydrukowany. |
DocumentPrinted | string | Odczyt | Pobiera wydrukowany dokument. |
Metody
| Sygnatura | Opis |
|---|---|
PdfContentEditor() | Domyślny konstruktor — podłącz PDF później za pomocą BindPdf(string). |
PdfContentEditor(document: Document) | Podłącz do istniejącego dokumentu przy tworzeniu. |
BindPdf(pdfData: byte[]) | Podłącz plik PDF do edycji. |
BindPdf(inputFile: string) | Powiąż plik PDF według ścieżki w celu edycji. |
BindPdf(inputStream: Stream) | Powiąż strumień PDF w celu edycji. |
BindPdf(srcDoc: Document) | Powiąż dokument PDF w pamięci w celu edycji. |
Save() | Zapisz powiązany dokument. |
Save(path: string) | Zapisz powiązany dokument pod wskazaną ścieżką pliku. |
Save(stream: Stream) | Zapisz powiązany dokument do strumienia. |
Close() | Zamknij powiązany dokument. |
Dispose() | Zwalnia powiązany dokument (odpowiednik Close). |
GetViewerPreference() | Pobierz bieżące flagi preferencji widza jako maskę bitową całkowitą. |
ChangeViewerPreference(viewerAttribution: int) | Zmień preferencję widza. |
GetStamps(pageNumber: int) | Uzyskaj informacje o pieczątkach na stronie. |
DeleteStamp(pageNumber: int, index: int[]) | Usuń pieczątki na stronie według ich indeksów zaczynających się od 0. |
DeleteStampById(pageNumber: int, stampId: int) | Usuń znaczek według jego identyfikatora (ID przypisanego przez Stamp.StampId). |
DeleteStampByIds(pageNumber: int, stampIds: int[]) | Usuń znaczniki według ich identyfikatorów. |
ReplaceText(srcString: string, destString: string) | Zastąp tekst w powiązanym dokumencie zgodnie z ReplaceTextStrategy. |
ReplaceText(srcString: string, thePage: int, destString: string) | Zastąp tekst na określonej stronie (liczona od 1). |
ReplaceText(srcString: string, destString: string, textState: TextState) | Zastąp tekst wyraźnym formatowaniem TextState (czcionka/rozmiar/kolor). |
ReplaceText(srcString: string, thePage: int, destString: string, textState: TextState) | Zastąp tekst na określonej stronie wyraźnym TextState. |
ReplaceText(srcString: string, destString: string, fontSize: int) | Zastąp tekst i nadpisz rozmiar czcionki wstawionego ciągu. |
ReplaceText(input: byte[], searchText: string, replaceText: string) | Zastąp wszystkie wystąpienia tekstu we wszystkich stronach. |
ReplaceText(input: byte[], searchText: string, replaceText: string, options: TextSearchOptions) | Zastąp wszystkie wystąpienia tekstu na wszystkich stronach, używając opcji wyszukiwania. |
ReplaceTextOnPage(input: byte[], pageNumber: int, searchText: string, replaceText: string) | Zastąp tekst na konkretnej stronie (liczona od 1). |
CreateLocalLink(input: byte[], rect: Rectangle, pageNumber: int, destinationPage: int) | Utwórz adnotację z lokalnym łączem, która przechodzi do strony w tym samym dokumencie. |
CreateWebLink(input: byte[], rect: Rectangle, pageNumber: int, url: string) | Utwórz adnotację z łączem URI, które otwiera adres URL. |
CreateFreeText(input: byte[], rect: Rectangle, pageNumber: int, text: string, fontName: string?, fontSize: double) | Utwórz adnotację wolnym tekstem na stronie. |
CreateText(input: byte[], rect: Rectangle, pageNumber: int, title: string, contents: string) | Utwórz adnotację tekstową (przypięta notatka) na stronie. |
DeleteAnnotations(input: byte[], pageNumber: int) | Usuń wszystkie adnotacje na określonej stronie. |
DeleteAnnotations(input: byte[], pageNumber: int, annotationType: string) | Usuń adnotacje określonego podtypu ze strony. |
ExtractText(input: byte[], pageNumber: int) | Wyodrębnij tekst z konkretnej strony. |
ExtractText(input: byte[]) | Wyodrębnij tekst ze wszystkich stron. |
DrawCurve(lineInfo: LineInfo, page: int, annotRect: System.Drawing.Rectangle, annotContents: string) | Przeciążenie, które konwertuje Rectangle do formy prostokąta PDF i deleguje. |
DrawCurve(lineInfo: LineInfo, pageNumber: int, rect: Rectangle, message: string?) | Narysuj krzywą (polilinię) na stronie. |
CreateLocalLink(rect: System.Drawing.Rectangle, desPage: int, originalPage: int) | Wywołuje CreateLocalLink(rect, desPage, originalPage) na tej instancji PdfContentEditor. |
CreateLocalLink(rect: System.Drawing.Rectangle, desPage: int, originalPage: int, clr: System.Drawing.Color) | Wywołuje CreateLocalLink(rect, desPage, originalPage, clr) na tej instancji PdfContentEditor. |
CreateLocalLink(rect: System.Drawing.Rectangle, desPage: int, originalPage: int, clr: System.Drawing.Color, actionName: System.Enum[]) | Wywołuje CreateLocalLink(rect, desPage, originalPage, clr, actionName) na tej instancji PdfContentEditor. |
CreateWebLink(rect: System.Drawing.Rectangle, url: string, originalPage: int) | Wywołuje CreateWebLink(rect, url, originalPage) na tej instancji PdfContentEditor. |
CreateWebLink(rect: System.Drawing.Rectangle, url: string, originalPage: int, clr: System.Drawing.Color) | Wywołuje CreateWebLink(rect, url, originalPage, clr) na tej instancji PdfContentEditor. |
CreateWebLink(rect: System.Drawing.Rectangle, url: string, originalPage: int, clr: System.Drawing.Color, actionName: System.Enum[]) | Wywołuje CreateWebLink(rect, url, originalPage, clr, actionName) na tej instancji PdfContentEditor. |
CreateApplicationLink(rect: System.Drawing.Rectangle, application: string, page: int) | Wywołuje CreateApplicationLink(rect, application, page) na tej instancji PdfContentEditor. |
CreateApplicationLink(rect: System.Drawing.Rectangle, application: string, page: int, clr: System.Drawing.Color) | Wywołuje CreateApplicationLink(rect, application, page, clr) na tej instancji PdfContentEditor. |
CreateApplicationLink(rect: System.Drawing.Rectangle, application: string, page: int, clr: System.Drawing.Color, actionName: System.Enum[]) | Wywołuje CreateApplicationLink(rect, application, page, clr, actionName) na tej instancji PdfContentEditor. |
CreatePdfDocumentLink(rect: System.Drawing.Rectangle, remotePdf: string, originalPage: int, destinationPage: int) | Wywołuje CreatePdfDocumentLink(rect, remotePdf, originalPage, destinationPage) na tej instancji PdfContentEditor. |
CreatePdfDocumentLink(rect: System.Drawing.Rectangle, remotePdf: string, originalPage: int, destinationPage: int, clr: System.Drawing.Color) | Wywołuje CreatePdfDocumentLink(rect, remotePdf, originalPage, destinationPage, clr) na tej instancji PdfContentEditor. |
CreatePdfDocumentLink(rect: System.Drawing.Rectangle, remotePdf: string, originalPage: int, destinationPage: int, clr: System.Drawing.Color, actionName: System.Enum[]) | Wywołuje CreatePdfDocumentLink(rect, remotePdf, originalPage, destinationPage, clr, actionName) na tej instancji PdfContentEditor. |
CreateJavaScriptLink(code: string, rect: System.Drawing.Rectangle, originalPage: int, color: System.Drawing.Color) | Wywołuje CreateJavaScriptLink(code, rect, originalPage, color) w tej instancji PdfContentEditor. |
CreateCustomActionLink(rect: System.Drawing.Rectangle, originalPage: int, color: System.Drawing.Color, actionName: System.Enum[]) | Wywołuje CreateCustomActionLink(rect, originalPage, color, actionName) w tej instancji PdfContentEditor. |
CreateFreeText(rect: System.Drawing.Rectangle, contents: string, page: int) | Wywołuje CreateFreeText(rect, contents, page) w tej instancji PdfContentEditor. |
CreateText(rect: System.Drawing.Rectangle, title: string, contents: string, open: bool, icon: string, page: int) | Wywołuje CreateText(rect, title, contents, open, icon, page) w tej instancji PdfContentEditor. |
CreateCaret(page: int, annotRect: System.Drawing.Rectangle, caretRect: System.Drawing.Rectangle, symbol: string, annotContents: string, color: System.Drawing.Color) | Wywołuje CreateCaret(page, annotRect, caretRect, symbol, annotContents, color) na tej instancji PdfContentEditor. |
CreateMarkup(rect: System.Drawing.Rectangle, contents: string, type: int, page: int, clr: System.Drawing.Color) | Wywołuje CreateMarkup(rect, contents, type, page, clr) na tej instancji PdfContentEditor. |
CreateSquareCircle(rect: System.Drawing.Rectangle, contents: string, clr: System.Drawing.Color, square: bool, page: int, borderWidth: int) | Wywołuje CreateSquareCircle(rect, contents, clr, square, page, borderWidth) na tej instancji 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[]) | Wywołuje CreateLine(rect, contents, x1, y1, x2, y2, page, border, clr, borderStyle, dashArray, LEArray) na tej instancji PdfContentEditor. |
CreatePolygon(lineInfo: LineInfo, page: int, annotRect: System.Drawing.Rectangle, annotContents: string) | Wywołuje CreatePolygon(lineInfo, page, annotRect, annotContents) na tej instancji PdfContentEditor. |
CreatePolyLine(lineInfo: LineInfo, page: int, annotRect: System.Drawing.Rectangle, annotContents: string) | Wywołuje CreatePolyLine(lineInfo, page, annotRect, annotContents) na tej instancji PdfContentEditor. |
CreatePopup(rect: System.Drawing.Rectangle, contents: string, open: bool, page: int) | Wywołuje CreatePopup(rect, contents, open, page) na tej instancji PdfContentEditor. |
CreateRubberStamp(page: int, annotRect: System.Drawing.Rectangle, annotContents: string, color: System.Drawing.Color, appearanceFile: string) | Wywołuje CreateRubberStamp(page, annotRect, annotContents, color, appearanceFile) na tej instancji PdfContentEditor. |
CreateRubberStamp(page: int, annotRect: System.Drawing.Rectangle, annotContents: string, color: System.Drawing.Color, appearanceStream: Stream) | Wywołuje CreateRubberStamp(page, annotRect, annotContents, color, appearanceStream) na tej instancji PdfContentEditor. |
CreateRubberStamp(page: int, annotRect: System.Drawing.Rectangle, icon: string, annotContents: string, color: System.Drawing.Color) | Wywołuje CreateRubberStamp(page, annotRect, icon, annotContents, color) na tej instancji PdfContentEditor. |
CreateMovie(rect: System.Drawing.Rectangle, filePath: string, page: int) | Wywołuje CreateMovie(rect, filePath, page) na tej instancji PdfContentEditor. |
CreateSound(rect: System.Drawing.Rectangle, filePath: string, name: string, page: int, rate: string) | Wywołuje CreateSound(rect, filePath, name, page, rate) na tej instancji PdfContentEditor. |
CreateFileAttachment(rect: System.Drawing.Rectangle, contents: string, filePath: string, page: int, name: string) | Wywołuje CreateFileAttachment(rect, contents, filePath, page, name) na tej instancji PdfContentEditor. |
CreateFileAttachment(rect: System.Drawing.Rectangle, contents: string, filePath: string, page: int, name: string, opacity: double) | Wywołuje CreateFileAttachment(rect, contents, filePath, page, name, opacity) na tej instancji PdfContentEditor. |
CreateFileAttachment(rect: System.Drawing.Rectangle, contents: string, attachmentStream: Stream, attachmentName: string, page: int, name: string) | Wywołuje CreateFileAttachment(rect, contents, attachmentStream, attachmentName, page, name) na tej instancji PdfContentEditor. |
CreateFileAttachment(rect: System.Drawing.Rectangle, contents: string, attachmentStream: Stream, attachmentName: string, page: int, name: string, opacity: double) | Wywołuje CreateFileAttachment(rect, contents, attachmentStream, attachmentName, page, name, opacity) na tej instancji PdfContentEditor. |
CreateBookmarksAction(title: string, color: System.Drawing.Color, boldFlag: bool, italicFlag: bool, file: string, actionType: string, destination: string) | Wywołuje CreateBookmarksAction(title, color, boldFlag, italicFlag, file, actionType, destination) na tej instancji PdfContentEditor. |
AddDocumentAdditionalAction(eventType: string, code: string) | Wywołuje AddDocumentAdditionalAction(eventType, code) na tej instancji PdfContentEditor. |
RemoveDocumentOpenAction() | Wywołuje RemoveDocumentOpenAction na tej instancji PdfContentEditor. |
AddDocumentAttachment(fileAttachmentPath: string, description: string) | Wywołuje AddDocumentAttachment(fileAttachmentPath, description) na tej instancji PdfContentEditor. |
AddDocumentAttachment(fileAttachmentStream: Stream, fileAttachmentName: string, description: string) | Wywołuje AddDocumentAttachment(fileAttachmentStream, fileAttachmentName, description) na tej instancji PdfContentEditor. |
DeleteAttachments() | Wywołuje DeleteAttachments na tej instancji PdfContentEditor. |
ExtractLink() | Wywołuje ExtractLink na tej instancji PdfContentEditor. |
DeleteImage() | Wywołuje DeleteImage na tej instancji PdfContentEditor. |
DeleteImage(pageNumber: int, index: int[]) | Wywołuje DeleteImage(pageNumber, index) na tej instancji PdfContentEditor. |
ReplaceImage(pageNumber: int, index: int, imageFile: string) | Wywołuje ReplaceImage(pageNumber, index, imageFile) na tej instancji PdfContentEditor. |
HideStampById(pageNumber: int, stampId: int) | Ukryj pieczątki o podanym stampId na stronie bez ich usuwania: operatory rysujące pieczątkę są zachowane, ale tłumione przez pusty prolog empty-clip, a znacznik %StampHidden=1 zapisuje stan, dzięki czemu GetStamps zgłasza Visible = false i ShowStampById może go przywrócić. |
ShowStampById(pageNumber: int, stampId: int) | Pokaż wcześniej ukrytą pieczątkę: usuń znacznik ukrycia i prolog empty-clip, aby pieczątka ponownie się rysowała. |
DeleteStampById(stampId: int) | Usuń wszystkie pieczątki o podanym stampId na wszystkich stronach. |
DeleteStampByIds(stampIds: int[]) | Usuń wszystkie pieczątki, których identyfikator znajduje się w stampIds, na wszystkich stronach. |
MoveStamp(pageNumber: int, stampIndex: int, x: double, y: double) | Wywołuje MoveStamp(pageNumber, stampIndex, x, y) na tej instancji PdfContentEditor. |
MoveStampById(pageNumber: int, stampId: int, x: double, y: double) | Wywołuje MoveStampById(pageNumber, stampId, x, y) na tej instancji PdfContentEditor. |