Pdf.FileName := 'document.pdf';
Pdf.Password := 'password';
Pdf.Active := True; // apre il documento PDF
Pdf.PageNumber := 1; // seleziona la pagina
ShowMessage(Pdf.Text); // estrae il testo
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;
Dati del segnalibro
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;
Dati della destinazione con nome
type TPdfDestinationViewMode = (dvmUnknown, dvmXYZ, dvmFit, dvmFitHorizontal, dvmFitVertical, dvmFitRectangle, dvmFitBoundingBox, dvmFitBoundingBoxHorizontal, dvmFitBoundingBoxVertical);
type TPdfDestinationViewParameters = array [0..3] of Single;
Modalità di vista della destinazione e relativi parametri nativi ordinati
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;
Dati dell'annotazione di collegamento
type TPdfPermission = (permPrint, permModify, permCopy, permAnnotate, permFillForms, permAccessibility, permAssemble, permPrintHighQuality);
type TPdfPermissions = set of TPdfPermission;
Flag tipizzati dei permessi del documento decodificati dalla maschera di permessi nativa
type TPdfDocumentMetadata = record
Title: WString;
Author: WString;
Subject: WString;
Keywords: WString;
Creator: WString;
Producer: WString;
CreationDate: WString;
ModifiedDate: WString;
end;
Una istantanea dei campi standard del dizionario Info del documento
type TObjectType = (otUnknown, otText, otPath, otImage, otShading, otForm);
Determina il tipo dell'oggetto PDF
type TPageMode = (pmNone, pmOutline, pmThumbs, pmFullScreen, pmOptionalContentGroup, pmAttachments, pmUnknown);
Determina come deve essere visualizzato il documento PDF quando viene aperto
type TPdfAction = (acUnsupported, acGoto, acGotoRemote, acUri, acLaunch);
Determina il tipo di azione associata a un elemento segnalibro
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;
Dati dell'annotazione
type TPdfAnnotationFlag = (afInvisible, afHidden, afPrint, afNoZoom, afNoRotate, afNoView, afReadOnly, afLocked, afToggleNoView);
type TPdfAnnotationFlags = set of TPdfAnnotationFlag;
Flag dell'annotazione
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);
Il sottotipo di annotazione
type TPdfBlendMode = (bmDefault, bmColor, bmColorBurn, bmColorDodge, bmDarken, bmDifference, bmExclusion, bmHardLight, bmHue, bmLighten, bmLuminosity, bmMultiply, bmNormal, bmOverlay, bmSaturation, bmScreen, bmSoftLight);
Determina come i livelli si fondono tra loro
type TPdfDisplayMode = (dmSingleContinuous, dmTwoPageContinuous, dmTwoPageContinuousWithCover);
Determina come vengono visualizzate le pagine del documento PDF
type TPdfFeature = (feUnknown, feXfaForm, fePortableCollection, feAttachment, feSecurity, feSharedReview, feSharedFormAcrobat, feSharedFormFilesystem, feSharedFormEmail, fe3dAnnotation, feMovieAnnotation, feSoundAnnotation, feScreenMediaAnnotation, feScreenRichMediaAnnotation, feAttachmentAnnotation, feSignatureAnnotation);
Caratteristica del documento PDF riportata dall'evento OnUnsupportedFeature
type TPdfFillMode = (fmNone, fmAlternate, fmWinding);
Determina come si formano le aree di riempimento quando un tracciato si interseca con se stesso
type TPdfFormFieldFlag = (ffReadOnly, ffRequired, ffNoExport, ffMultiline, ffChoiceCombo, ffChoiceEdit, ffPassword, ffChoiceMultiSelect);
type TPdfFormFieldFlags = set of TPdfFormFieldFlag;
Flag del campo modulo
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;
Informazioni sul campo modulo
type TPdfFormFieldType = (fiUnknown, fiPushButton, fiCheckBox, fiRadioButton, fiComboBox, fiListBox, fiTextField, fiSignature);
Determina il tipo del campo modulo
type TPdfFormType = (ftUnknown, ftNone, ftAcroForm, ftXfaFull, ftXfaForeground);
Determina il tipo di moduli nel documento PDF
type TPdfImage = record
Width: Integer;
Height: Integer;
Data: TBytes;
end;
Dimensione in pixel e dati dell'oggetto immagine PDF
type TPdfLineCap = (lcDefault, lcButt, lcRound, lcProjectingSquare);
La forma usata alle estremità dei sottotracciati aperti
type TPdfLineJoin = (ljDefault, ljMiter, ljRound, ljBevel);
La forma usata negli angoli dei tracciati con tratteggio
type TPdfPoint = record
X, Y: Double;
end;
Punto con coordinate X e Y
type TPdfRectangle = record
Left, Top, Right, Bottom: Double;
end;
type TPdfRectangles = array of TPdfRectangle;
Area rettangolare con coordinate Left, Top, Right e Bottom
type TPdfFileIdentifierType = (fidPermanent, fidChanging);
Selettore dell'identificatore di file del trailer. fidPermanent legge la prima voce /ID e fidChanging legge la seconda voce /ID
type TPdfPageBox = (pbMedia, pbCrop, pbBleed, pbTrim, pbArt);
Selettore della casella del dizionario di pagina usato da PageBox, GetPageBox e SetPageBox
type TPdfJavaScriptAction = record
Name: WString;
Script: WString;
end;
type TPdfJavaScriptActions = array of TPdfJavaScriptAction;
Dati delle azioni dell'albero dei nomi JavaScript a livello di documento
type TPdfSignature = record
Content: TBytes;
Encoding: WString;
Reason: WString;
Time: WString;
Permission: Integer;
end;
Informazioni sulla firma digitale
type TPdfIntegerArray = array of Integer;
Array di interi usato dagli elenchi di ID di contenuto contrassegnato dell'albero della struttura
type TPdfSingleArray = array of Single;
Array di numeri in virgola mobile a precisione singola usato dai metodi di impostazione della posizione dei caratteri degli oggetti di testo
type TPdfPrintPageRange = record
StartPage: Integer;
EndPage: Integer;
end;
type TPdfPrintPageRanges = array of TPdfPrintPageRange;
Intervalli di pagine di stampa con base uno ricavati dalle preferenze del visualizzatore del documento
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;
Dati appiattiti degli elementi della struttura logica per le pagine PDF con tag
type TPdfFormSelectionRect = record
PageNumber: Integer;
Bounds: TPdfRectangle;
end;
Rettangolo nello spazio pagina di proprietà del chiamante riportato dalla selezione nativa del testo dei moduli
type TPdfStructureReadOptions = record
MaxDepth: Integer;
MaxElements: Integer;
MaxAttributeValues: Integer;
DeadlineMilliseconds: Cardinal;
IncludeAttributes: Boolean;
class function Default: TPdfStructureReadOptions; static;
end;
Budget di risorse per l'attraversamento iterativo dell'albero della struttura nativo
type TPdfStructureReadStatus = record
Completed: Boolean;
ElementsVisited: Integer;
AttributeValuesVisited: Integer;
DepthLimitReached: Boolean;
ElementLimitReached: Boolean;
AttributeLimitReached: Boolean;
DeadlineReached: Boolean;
VisitorStopped: Boolean;
end;
Dettagli di completamento e troncamento restituiti dai metodi di attraversamento della struttura
type TPdfVersion = (pvUnknown, pv10, pv11, pv12, pv13, pv14, pv15, pv16, pv17);
La versione di un file PDF o di una destinazione SaveAs esplicita. I valori possibili sono: versione sconosciuta, versioni PDF da 1.0 a 1.7. Le destinazioni SaveAs esplicite da PDF 1.3 a PDF 1.7 vengono normalizzate e validate rispetto alla versione PDF selezionata
type TPrintPaperHandling = (phUndefined, phSimplex, phDuplexFlipShortEdge, phDuplexFlipLongEdge);
Opzioni di gestione della carta per la stampa
type TPdfPrintMode = (prEmf, prTextOnly, prPostScript2, prPostScript3, prPostScript2PassThrough, prPostScript3PassThrough, prEmfImageMasks, prPostScript3Type42, prPostScript3Type42PassThrough);
Modalità di output di stampa di PDFium in Windows selezionata da SetPdfPrintMode
type TRenderOption = (reAnnotations, reLcd, reNoNativeText, reGrayscale, reDebugInfo, reNoCatchException, reLimitCache, reHalftone, rePrinting, reReverseByteOrder, reNoSmoothText, reNoSmoothImage, reNoSmoothPath, reInvert, reNightDuotone);
type TRenderOptions = set of TRenderOption;
Flag di rendering della pagina
type TRotation = (ro0, ro90, ro180, ro270);
La rotazione della pagina PDF. La rotazione della pagina è in senso orario
type TSaveOption = (saNone, saIncremental, saNoIncremental, saRemoveSecurity);
Determina come verrà salvato il documento PDF
type TSearchOption = (seCaseSensitive, seWholeWord, seConsecutive);
type TSearchOptions = set of TSearchOption;
Flag di ricerca
type TWebLink = record
Url: WString;
Rectangles: TPdfRectangles;
end;
type TWebLinks = array of TWebLink;
Informazioni URL e confini del collegamento web
type WString = {$ifdef D2009PLUS} string {$else} WideString {$endif D2009PLUS};
Stringa di caratteri wide
const PointsPerInch: Integer = 72;
Il PDF usa punti con una densità di 72 punti per pollice
const FLAT_NORMALDISPLAY = 0;
const FLAT_PRINT = 1;
Profili di appiattimento passati a FlattenPage / FlattenAllPages. FLAT_NORMALDISPLAY è destinato alla visualizzazione a schermo; FLAT_PRINT è destinato all'output stampato
const FLATTEN_FAIL = 0;
const FLATTEN_SUCCESS = 1;
const FLATTEN_NOTHINGTODO = 2;
Codici di risultato restituiti da 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;
Unità di lettura a livello di frase usate dai flussi di lavoro di sintesi vocale e di lettura ascoltata assistita
type TPdfWordBox = record
Text: WString;
StartIndex: Integer;
Count: Integer;
Rect: TPdfRectangle;
Page: Integer;
end
type TPdfWordBoxes = array of TPdfWordBox;
Intervalli di testo a livello di parola e rettangoli di pagina usati per l'evidenziazione sincronizzata della lettura
type TPdfSpokenSpan = record
SpokenStart: Integer;
SpokenCount: Integer;
Page: Integer;
StartIndex: Integer;
Count: Integer;
end
type TPdfSpokenSpans = array of TPdfSpokenSpan;
Sequenze mappate che traducono gli offset del motore vocale nel testo della pagina PDF
type TPdfSpokenText = record
Text: WString;
Spans: TPdfSpokenSpans;
end
type TPdfSpokenTexts = array of TPdfSpokenText;
Blocchi vocali e mappature di origine usati dai flussi di lettura ad alta voce e da TPdfReadingSession
type TPdfReadingSessionState = (pssIdle, pssSpeaking, pssPaused);
Stato di riproduzione riportato da TPdfReadingSession
var LibraryName: string = 'pdfium.dll';
Nome della libreria PDFium standard usata quando EnableV8Engine è False. Può essere modificato prima di chiamare LoadLibrary
var EnableV8Engine: Boolean = False;
Impostare a True prima del caricamento per selezionare pdfium.v8.dll dalla cartella DLLs corrispondente di Win32 o Win64