Pdf.FileName := 'document.pdf';
Pdf.Password := 'password';
Pdf.Active := True; // open PDF document
Pdf.PageNumber := 1; // select page
ShowMessage(Pdf.Text); // extract text
type TBookmark = record
Handle: FPDF_BOOKMARK;
Title: WString;
PageNumber: Integer;
Destination: TDestination;
DescendantCount: Integer;
IsOpen: Boolean;
Action: TPdfAction;
ActionPageNumber: Integer;
ActionDestination: TDestination;
ActionPath: WString;
HasColor: Boolean;
Color: TColor;
end;
type TBookmarks = array of TBookmark;
Dane zakładki
type TDestination = record
Handle: FPDF_DEST;
Name: WString;
PageNumber: Integer;
ViewMode: TPdfDestinationViewMode;
ViewParameterCount: Integer;
ViewParameters: TPdfDestinationViewParameters;
HasX: Boolean;
X: Single;
HasY: Boolean;
Y: Single;
HasZoom: Boolean;
Zoom: Single;
end;
Dane nazwanego miejsca docelowego
type TPdfDestinationViewMode = (dvmUnknown, dvmXYZ, dvmFit, dvmFitHorizontal, dvmFitVertical, dvmFitRectangle, dvmFitBoundingBox, dvmFitBoundingBoxHorizontal, dvmFitBoundingBoxVertical);
type TPdfDestinationViewParameters = array [0..3] of Single;
Tryb widoku miejsca docelowego i jego uporządkowane natywne parametry
type TLinkAnnotation = record
Handle: FPDF_LINK;
Rectangle: TPdfRectangle;
PageNumber: Integer;
Action: TPdfAction;
ActionPageNumber: Integer;
ActionPath: WString;
Points: array of TQuadrilateralPoint;
end;
type TLinkAnnotations = array of TLinkAnnotation;
type TQuadrilateralPoint = array [1..4] of TPdfPoint;
Dane adnotacji linku
type TPdfPermission = (permPrint, permModify, permCopy, permAnnotate, permFillForms, permAccessibility, permAssemble, permPrintHighQuality);
type TPdfPermissions = set of TPdfPermission;
Typowane flagi uprawnień dokumentu zdekodowane z natywnej maski uprawnień
type TPdfDocumentMetadata = record
Title: WString;
Author: WString;
Subject: WString;
Keywords: WString;
Creator: WString;
Producer: WString;
CreationDate: WString;
ModifiedDate: WString;
end;
Migawka standardowych pól słownika Info dokumentu
type TObjectType = (otUnknown, otText, otPath, otImage, otShading, otForm);
Określa typ obiektu PDF
type TPageMode = (pmNone, pmOutline, pmThumbs, pmFullScreen, pmOptionalContentGroup, pmAttachments, pmUnknown);
Określa, jak dokument PDF ma być wyświetlany po otwarciu
type TPdfAction = (acUnsupported, acGoto, acGotoRemote, acUri, acLaunch);
Określa typ akcji powiązanej z elementem zakładki
type TPdfAnnotation = record
Subtype: TPdfAnnotationSubtype;
Flags: TPdfAnnotationFlags;
HasColor: Boolean;
Color: TColor;
ColorAlpha: Byte;
HasInteriorColor: Boolean;
InteriorColor: TColor;
InteriorColorAlpha: Byte;
HasAttachmentPoints: Boolean;
AttachmentPoints: TQuadrilateralPoint;
Rectangle: TPdfRectangle;
ContentsText: WString;
AuthorText: WString;
end;
Dane adnotacji
type TPdfAnnotationFlag = (afInvisible, afHidden, afPrint, afNoZoom, afNoRotate, afNoView, afReadOnly, afLocked, afToggleNoView);
type TPdfAnnotationFlags = set of TPdfAnnotationFlag;
Flagi adnotacji
type TPdfAnnotationSubtype = (anUnknown, anText, anLink, anFreeText, anLine, anSquare, anCircle, anPolygon, anPolyLine, anHighlight, anUnderline, anSquiggly, anStrikeout, anStamp, anCaret, anInk, anPopup, anFileAttachment, anSound, anMovie, anWidget, anScreen, anPrinterMark, anTrapNet, anWaterMark, anThreed, anRichMedia, anXfaWidget, anRedact);
Podtyp adnotacji
type TPdfBlendMode = (bmDefault, bmColor, bmColorBurn, bmColorDodge, bmDarken, bmDifference, bmExclusion, bmHardLight, bmHue, bmLighten, bmLuminosity, bmMultiply, bmNormal, bmOverlay, bmSaturation, bmScreen, bmSoftLight);
Określa sposób mieszania warstw ze sobą
type TPdfDisplayMode = (dmSingleContinuous, dmTwoPageContinuous, dmTwoPageContinuousWithCover);
Określa sposób wyświetlania stron dokumentu PDF
type TPdfFeature = (feUnknown, feXfaForm, fePortableCollection, feAttachment, feSecurity, feSharedReview, feSharedFormAcrobat, feSharedFormFilesystem, feSharedFormEmail, fe3dAnnotation, feMovieAnnotation, feSoundAnnotation, feScreenMediaAnnotation, feScreenRichMediaAnnotation, feAttachmentAnnotation, feSignatureAnnotation);
Funkcja dokumentu PDF zgłaszana przez zdarzenie OnUnsupportedFeature
type TPdfFillMode = (fmNone, fmAlternate, fmWinding);
Określa sposób tworzenia obszarów wypełnienia, gdy ścieżka przecina samą siebie
type TPdfFormFieldFlag = (ffReadOnly, ffRequired, ffNoExport, ffMultiline, ffChoiceCombo, ffChoiceEdit, ffPassword, ffChoiceMultiSelect);
type TPdfFormFieldFlags = set of TPdfFormFieldFlag;
Flagi pola formularza
type TPdfFormFieldInfo = record
Name: WString;
AlternateName: WString;
FieldType: TPdfFormFieldType;
Flags: TPdfFormFieldFlags;
OptionLabels: array of WString;
OptionSelected: array of Boolean;
FontSize: Single;
Checked: Boolean;
ExportValue: WString;
GroupCount: Integer;
GroupIndex: Integer;
end;
Informacje o polu formularza
type TPdfFormFieldType = (fiUnknown, fiPushButton, fiCheckBox, fiRadioButton, fiComboBox, fiListBox, fiTextField, fiSignature);
Określa typ pola formularza
type TPdfFormType = (ftUnknown, ftNone, ftAcroForm, ftXfaFull, ftXfaForeground);
Określa typ formularzy w dokumencie PDF
type TPdfImage = record
Width: Integer;
Height: Integer;
Data: TBytes;
end;
Rozmiar w pikselach i dane obiektu obrazu PDF
type TPdfLineCap = (lcDefault, lcButt, lcRound, lcProjectingSquare);
Kształt używany na końcach otwartych podścieżek
type TPdfLineJoin = (ljDefault, ljMiter, ljRound, ljBevel);
Kształt używany na narożnikach obrysowywanych ścieżek
type TPdfPoint = record
X, Y: Double;
end;
Punkt o współrzędnych X i Y
type TPdfRectangle = record
Left, Top, Right, Bottom: Double;
end;
type TPdfRectangles = array of TPdfRectangle;
Obszar prostokątny o współrzędnych Left, Top, Right i Bottom
type TPdfFileIdentifierType = (fidPermanent, fidChanging);
Selektor identyfikatora pliku z trailer. fidPermanent odczytuje pierwszy wpis /ID, a fidChanging drugi wpis /ID
type TPdfPageBox = (pbMedia, pbCrop, pbBleed, pbTrim, pbArt);
Selektor ramki słownika strony używany przez PageBox, GetPageBox i SetPageBox
type TPdfJavaScriptAction = record
Name: WString;
Script: WString;
end;
type TPdfJavaScriptActions = array of TPdfJavaScriptAction;
Dane akcji drzewa nazw JavaScript na poziomie dokumentu
type TPdfSignature = record
Content: TBytes;
Encoding: WString;
Reason: WString;
Time: WString;
Permission: Integer;
end;
Informacje o podpisie cyfrowym
type TPdfIntegerArray = array of Integer;
Tablica liczb całkowitych używana przez listy ID marked-content drzewa struktury
type TPdfSingleArray = array of Single;
Tablica liczb zmiennoprzecinkowych pojedynczej precyzji używana przez metody ustawiające pozycje znaków obiektu tekstowego
type TPdfPrintPageRange = record
StartPage: Integer;
EndPage: Integer;
end;
type TPdfPrintPageRanges = array of TPdfPrintPageRange;
Liczone od jedynki zakresy stron drukowania z preferencji przeglądarki dokumentu
type TPdfStructureElement = record
Level: Integer;
ParentIndex: Integer;
TypeName: WString;
ObjectType: WString;
Title: WString;
AlternateText: WString;
ActualText: WString;
Expansion: WString;
ID: WString;
Language: WString;
MarkedContentID: Integer;
MarkedContentIDs: TPdfIntegerArray;
ChildCount: Integer;
ChildMarkedContentIDs: TPdfIntegerArray;
AttributeCount: Integer;
ListNumbering: WString;
Scope: WString;
HasHeaders: Boolean;
HeadersIds: array of WString;
ColSpan: Integer;
RowSpan: Integer;
HasPrintField: Boolean;
NamespaceUri: WString;
RoleMappedNamespaceUri: WString;
RoleMappedTypeName: WString;
HasReference: Boolean;
HasAssociatedFile: Boolean;
AssociatedFileRelationship: WString;
AssociatedFileDescription: WString;
AnnotationSubtype: WString;
AnnotationContents: WString;
AnnotationAlternateText: WString;
IsArtifact: Boolean;
WidgetCount: Integer;
HasAppearance: Boolean;
LabelText: WString;
FieldAlternateName: WString;
end;
type TPdfStructureElements = array of TPdfStructureElement;
Spłaszczone dane logicznych elementów struktury dla stron Tagged PDF
type TPdfFormSelectionRect = record
PageNumber: Integer;
Bounds: TPdfRectangle;
end;
Jeden należący do wywołującego prostokąt w przestrzeni strony zgłaszany przez natywne zaznaczanie tekstu formularza
type TPdfStructureReadOptions = record
MaxDepth: Integer;
MaxElements: Integer;
MaxAttributeValues: Integer;
DeadlineMilliseconds: Cardinal;
IncludeAttributes: Boolean;
class function Default: TPdfStructureReadOptions; static;
end;
Budżety zasobów dla iteracyjnego przechodzenia natywnego drzewa struktury
type TPdfStructureReadStatus = record
Completed: Boolean;
ElementsVisited: Integer;
AttributeValuesVisited: Integer;
DepthLimitReached: Boolean;
ElementLimitReached: Boolean;
AttributeLimitReached: Boolean;
DeadlineReached: Boolean;
VisitorStopped: Boolean;
end;
Szczegóły ukończenia i skrócenia zwracane przez metody przechodzenia struktury
type TPdfVersion = (pvUnknown, pv10, pv11, pv12, pv13, pv14, pv15, pv16, pv17);
Wersja pliku PDF albo jawny cel SaveAs. Możliwe wartości to: nieznana wersja, wersje PDF od 1.0 do 1.7. Jawne cele SaveAs od PDF 1.3 do PDF 1.7 są normalizowane i walidowane względem wybranej wersji PDF
type TPrintPaperHandling = (phUndefined, phSimplex, phDuplexFlipShortEdge, phDuplexFlipLongEdge);
Opcje obsługi papieru przy drukowaniu
type TPdfPrintMode = (prEmf, prTextOnly, prPostScript2, prPostScript3, prPostScript2PassThrough, prPostScript3PassThrough, prEmfImageMasks, prPostScript3Type42, prPostScript3Type42PassThrough);
Tryb wyjścia drukowania PDFium w Windows wybierany przez SetPdfPrintMode
type TRenderOption = (reAnnotations, reLcd, reNoNativeText, reGrayscale, reDebugInfo, reNoCatchException, reLimitCache, reHalftone, rePrinting, reReverseByteOrder, reNoSmoothText, reNoSmoothImage, reNoSmoothPath, reInvert, reNightDuotone);
type TRenderOptions = set of TRenderOption;
Flagi renderowania stron
type TRotation = (ro0, ro90, ro180, ro270);
Obrót strony PDF. Obrót strony odbywa się zgodnie ze wskazówkami zegara
type TSaveOption = (saNone, saIncremental, saNoIncremental, saRemoveSecurity);
Określa sposób zapisania dokumentu PDF
type TSearchOption = (seCaseSensitive, seWholeWord, seConsecutive);
type TSearchOptions = set of TSearchOption;
Flagi wyszukiwania
type TWebLink = record
Url: WString;
Rectangles: TPdfRectangles;
end;
type TWebLinks = array of TWebLink;
Informacje o adresie URL i granice łącza internetowego
type WString = {$ifdef D2009PLUS} string {$else} WideString {$endif D2009PLUS};
Szeroki ciąg znaków
const PointsPerInch: Integer = 72;
PDF używa punktów o gęstości 72 punkty na cal
const FLAT_NORMALDISPLAY = 0;
const FLAT_PRINT = 1;
Profile spłaszczania przekazywane do FlattenPage / FlattenAllPages. FLAT_NORMALDISPLAY celuje w wyświetlanie na ekranie; FLAT_PRINT celuje w wydruk
const FLATTEN_FAIL = 0;
const FLATTEN_SUCCESS = 1;
const FLATTEN_NOTHINGTODO = 2;
Kody wyników zwracane przez FlattenPage
type TPdfReadingUnit = record
Text: WString;
Kind: TPdfContentFragmentKind;
HeadingLevel: Integer;
Page: Integer;
Rects: TPdfRectangles;
FragmentIndex: Integer;
SentenceIndex: Integer;
IsAlternateText: Boolean;
Language: WString;
end
type TPdfReadingUnits = array of TPdfReadingUnit;
Jednostki czytania na poziomie zdań używane przez syntezę mowy i wspomagane przepływy słuchania z czytaniem
type TPdfWordBox = record
Text: WString;
StartIndex: Integer;
Count: Integer;
Rect: TPdfRectangle;
Page: Integer;
end
type TPdfWordBoxes = array of TPdfWordBox;
Zakresy tekstu na poziomie słów i prostokąty stron używane przez zsynchronizowane podświetlanie czytania
type TPdfSpokenSpan = record
SpokenStart: Integer;
SpokenCount: Integer;
Page: Integer;
StartIndex: Integer;
Count: Integer;
end
type TPdfSpokenSpans = array of TPdfSpokenSpan;
Zmapowane przebiegi, które tłumaczą przesunięcia silnika mowy z powrotem na tekst strony PDF
type TPdfSpokenText = record
Text: WString;
Spans: TPdfSpokenSpans;
end
type TPdfSpokenTexts = array of TPdfSpokenText;
Segmenty mowy i mapowania źródłowe używane przez przepływy czytania na głos i TPdfReadingSession
type TPdfReadingSessionState = (pssIdle, pssSpeaking, pssPaused);
Stan odtwarzania raportowany przez TPdfReadingSession
var LibraryName: string = 'pdfium.dll';
Nazwa standardowej biblioteki PDFium używana, gdy EnableV8Engine ma wartość False. Można ją zmienić przed wywołaniem LoadLibrary
var EnableV8Engine: Boolean = False;
Ustaw na True przed wczytaniem, aby wybrać pdfium.v8.dll z pasującego folderu DLLs Win32 lub Win64