PDFium Delphi Component Docs

API เนื้อหาหน้าขั้นสูง

Component: TPdf  ·  Unit: PDFium
ตรวจสอบและแก้ไขเนื้อหาหน้าแบบ native โดยไม่บังคับให้แอปพลิเคชันจัดการ handle ของ PDFium หรือบัฟเฟอร์ bitmap เอง

Page object inspection

PageObjectInfo คืน snapshot TPdfPageObjectInfo หนึ่งชุด ที่บรรจุ handle, ชนิดอ็อบเจกต์, ขอบเขตแบบปกติและแบบหมุน, เมทริกซ์ที่มีผลจริง, สถานะ active, ความโปร่งใส, สี fill กับ stroke, ค่า alpha, ความกว้าง stroke, line join, line cap, dash array และ dash phase

HasRotatedBounds, HasActiveState และฟิลด์ Has* อื่น ๆ ช่วยแยกค่า native ที่หาไม่ได้ออกจากค่าศูนย์ที่ถูกต้อง

RotatedBounds แบกสี่เหลี่ยมด้านขนานที่หมุนแล้ว, HasLineJoin กับ HasLineCap คุมสไตล์ join กับ cap และ DashPhase เลื่อนจุดเริ่มของรูปแบบ dash

Batched page object editing

Info := Pdf1.PageObjectInfo(0);
Info.StrokeWidth := 4;
SetLength(Info.DashArray, 2);
Info.DashArray[0] := 8;
Info.DashArray[1] := 4;
Pdf1.UpdatePageObject(0, Info, [pocStrokeWidth, pocDashPattern]);

UpdatePageObject ใช้ทุกฟิลด์ที่เลือกกับอ็อบเจกต์ native ตัวเดิม แล้ว regenerate เนื้อหาหน้าเพียงครั้งเดียว

TransformPageObject ประกอบเมทริกซ์ affine แบบ FS_MATRIX เข้ากับอ็อบเจกต์ที่เลือก

Paths, clip paths, and Form XObjects

Content marks, glyphs, and native object helpers

Character inspection and index mapping

CharacterInfo คืนสี fill กับ stroke, ชื่อฟอนต์, flag ฟอนต์ของ PDF, ขอบเขต glyph แบบหลวม, เมทริกซ์ที่มีผลจริง และ handle ของ text object ที่เกี่ยวข้อง

CharacterIndexToTextIndex กับ TextIndexToCharacterIndex แปลงกลับไปมาระหว่างดัชนีอักขระของ PDFium กับดัชนีใน text stream ที่สร้างขึ้น

Annotation borders and appearance streams

TPdfAnnotation เปิดเผยรัศมีและความกว้างของขอบผ่าน HasBorder, BorderHorizontalRadius, BorderVerticalRadius และ BorderWidth

ความครอบคลุมของสียืดไปถึง ColorAlpha, InteriorColor และ InteriorColorAlpha, metadata ของ markup ถูกคุมด้วย HasAuthor, HasName, HasSubject, HasModificationDate, HasCreationDate และ HasIcon ส่วน ink gesture, เรขาคณิต quad-point และเป้าหมายลิงก์เปิดเผยผ่าน InkList, HasAttachmentPoints, HasLinkUri และ LinkUri

appearance stream แบบปกติ, rollover และแบบกดอยู่ เข้าถึงได้ผ่าน sentinel HasAppearanceNormal, HasAppearanceRollover, HasAppearanceDown และสตริงคู่กันคือ AppearanceNormal, AppearanceRollover, AppearanceDown

กำหนดเรกคอร์ดคำอธิบายประกอบที่แก้แล้วกลับเข้า Annotation[Index] เพื่อเขียนค่าขอบหรือ appearance ที่เลือกไว้

Native library, annotation, and form diagnostics

Thumbnails and affine page transforms

Matrix rendering

Matrix.a := 0.5;
Matrix.b := 0;
Matrix.c := 0;
Matrix.d := -0.5;
Matrix.e := 0;
Matrix.f := 421;
Clip.Left := 0;
Clip.Top := 0;
Clip.Right := 300;
Clip.Bottom := 421;
Bitmap := Pdf1.RenderPageWithMatrix(300, 421, Matrix, Clip);

RenderPageWithMatrix รับ FS_MATRIX ที่ผันกลับได้และสี่เหลี่ยม clip ในพิกัดอุปกรณ์

overload ที่รับ TBitmap ของผู้เรียกจะเรนเดอร์ตรงลง DIB 32 บิตที่เข้ากันได้ และ fallback ไปคัดลอกครั้งเดียวเมื่อสร้าง bitmap แบบ PDFium ภายนอกไม่ได้

การเรนเดอร์ด้วยเมทริกซ์วาดเนื้อหาหน้ากับคำอธิบายประกอบที่ไม่โต้ตอบซึ่งเลือกด้วย render flag แต่ไม่เรียกตัวเรนเดอร์ overlay ของ form-fill