Page
ภาพรวม
Page เป็นตัวอย่างใน Aspose.PDF FOSS for Go.
หน้า คือภาพสดของหน้าเดียวในเอกสาร.
ประเภทนี้ให้ 57 วิธีในการทํางานกับวัตถุหน้าในโปรแกรม Go. วิธีการที่ใช้ได้แก่: AddFloatingBox, AddForm, AddImage, AddImageFromStream, AddInlineImage, AddInlineImageFromStream, AddSVG, AddSVGFromStream, AddSVGObject, AddStamp, AddTOC, AddTable,และ 45 วิธีการเพิ่มเติม. สมาชิกสาธารณะทุกคนสามารถเข้าถึงการใช้งาน Go ได้หลังจากติดตั้งแพ็คเกจ FOSS for Go.
วิธีการ
| Signature | คําอธิบาย |
|---|---|
RenderBMP(w: io.Writer, opts: RenderOptions) → error | RenderBMP ทําการทําหน้าและเขียนมันเป็น BMP ที่ไม่ถูกกดสั้น. |
AddFloatingBox(box: *FloatingBox, rect: Rectangle) → error | AddFloatingBox วาดกล่องที่ตําแหน่งสมบูรณ์ภายใน rect: มันสีพื้นหลังและขอบ, แล้ววางออกเนื้อหากลองภายใต้ reck ลบ padding (เน้นส่วนที่ไหลผ่านกลอนถูกตัด). |
Forms() → []*XForm | Forms กลับ Form XObjects ที่ทําการอ้างอิงโดยทรัพยากรของหน้า กลุ่มเนื้อหาที่สามารถใช้ได้ซ้ําที่มีอยู่ (เช่น. |
AddForm(form: *XForm, rect: Rectangle) → error | AddForm วางแบบฟอร์มบนหน้า เพื่อให้กล่องของมันตรงไปตามเส้นตรง โดยรักษาขนาดของแบบเองต่อแกน. |
ExtractImages() → ([]Image, error) | ExtractImages จะส่งภาพทั้งหมดที่พบในหน้า. |
ImageInfos() → ([]ImageInfo, error) | ImageInfos ส่งกลับเมตาเดทสําหรับภาพทั้งหมดที่พบในหน้าโดยไม่เปิดรหัสข้อมูลพิกเซล. |
AddImage(path: string, rect: Rectangle) → error | AddImage เพิ่มภาพจากไฟล์เข้าหน้าภายในสี่เหลี่ยมที่ให้. |
AddImageFromStream(r: io.Reader, rect: Rectangle) → error | AddImageFromStream เพิ่มภาพจากผู้อ่านเข้าหน้าภายในสี่เหลี่ยมที่ให้. |
AddInlineImage(path: string, rect: Rectangle) → error | AddInlineImage ดึงภาพเล็กๆ เข้าไปตรงกับสตรีมเนื้อหาหน้าเป็นรูปในเส้น (BI … ID … EI, ISO 32000-1 §8.9.7) แทนที่จะเป็น Image XObject. |
AddInlineImageFromStream(r: io.Reader, rect: Rectangle) → error | AddInlineImageFromStream เป็นตัวแปร io.Reader ของ AddInlineImage. |
BeginLayer(layer: *Layer) → error | BeginLayer เริ่มการแสดงส่วนของเนื้อหาที่ถูกกําหนดไว้ในหน้าที่ได้รับมอบให้กับชั้น: เนื้อความที่วาดหลังจากการเรียกนี้ (AddText, Draw*, AddImage,…) เป็นของชั้นจนถึง EndLayer. |
EndLayer() → error | EndLayer ปิดส่วนที่ติดเครื่องหมายที่มีเนื้อหาเปิดโดย BeginLayer. |
Number() → int | Number ส่งเลขหน้าที่เน้น 1 ภายในเอกสาร. |
Annotations() → *AnnotationCollection | Annotations ส่งผลการรวมคําอธิบายของหน้า. |
Size() → (PageSize, error) | Size จะคืนขนาดหน้าจาก MediaBox. |
Rotation() → RotationAngle | การหมุนกลับการหมวนเวียนของหน้าในระดับ (0, 90, 180, 270). |
MediaBox() → (Rectangle, error) | MediaBox ส่งกลับหน้าของ MediaBox เป็นรูปสี่เหลี่ยมในพื้นที่ผู้ใช้ PDF. |
CropBox() → (Rectangle, error) | CropBox จะส่งกล่องการตัดของหน้าเป็น Rectangle. |
TrimBox() → (Rectangle, error) | TrimBox จะส่งกล่องตัดของหน้าเป็น Rectangle. |
BleedBox() → (Rectangle, error) | BleedBox จะส่งกล่องเลือดของหน้าเป็นสี่เหลี่ยม. |
ArtBox() → (Rectangle, error) | ArtBox จะส่งกล่องภาพของหน้าเป็น Rectangle. |
SetMediaBox(rect: Rectangle) → error | SetMediaBox ตั้งค่าของหน้า MediaBox (ตารางสี่เหลี่ยมเต็มหน้า) ในพื้นที่ผู้ใช้ PDF. |
SetCropBox(rect: Rectangle) → error | SetCropBox ตั้งค่าที่ CropBox ของหน้า (พื้นที่ที่เห็นได้). |
SetTrimBox(rect: Rectangle) → error | SetTrimBox ตั้งค่าของหน้า TrimBox (ขนาดที่ต้องการจบ). |
SetBleedBox(rect: Rectangle) → error | SetBleedBox ตั้งค่าที่ BleedBox ของหน้า (เขตการผลิต). |
SetArtBox(rect: Rectangle) → error | SetArtBox กําหนดการที่หน้า ArtBox (ความหมายของเนื้อหา). |
SetPageSize(width: float64) → error | SetPageSize เปลี่ยนขนาดหน้าโดยการตั้งค่า MediaBox ให้เป็น [ 0 ความสูงความกว้าง ] (จุด). |
Label() → string | Label จะส่งกลับการจัดรูปแบบของหน้า ตราสําหรับหน้านี้ ตามที่กําหนดโดยต้นเลข /PageLabels ของเอกสาร (รายละเอียด PDF § 12.4.2). |
Paragraphs() → (PageMarkup, error) | ข้อความคืนข้อความของหน้าที่จัดเป็นคอลัมน์ (ส่วน) และข้อ. |
RenderImage(opts: RenderOptions) → (image.Image, error) | RenderImage ทําการรัสเตอร์หน้าเป็น * image.RGBA ที่ DPI ที่ขอ. |
RenderPNG(w: io.Writer, opts: RenderOptions) → error | RenderPNG ทําการทําหน้าและเขียนมันเป็น PNG. |
RenderJPEG(w: io.Writer, opts: RenderOptions, quality: int) → error | RenderJPEG ทําการทําหน้าและเขียนเป็น JPEG. |
RenderGIF(w: io.Writer, opts: RenderOptions) → error | RenderGIF ทําการทําหน้าและเขียนเป็น GIF (256 สี, จํานวน). |
ReplaceText(old: string, opts: ...ReplaceOptions) → (int, error) | ReplaceText แทนการเกิดขึ้นทุกครั้งของเก่าด้วยการเปลี่ยนในหน้าและคืนจํานวนการเปลี่ยนแปลงที่ทํา. |
AddStamp(s: Stamp) → error | AddStamp วาดตราบนหน้า. |
AddSVG(path: string, rect: Rectangle) → error | AddSVG อ่านไฟล์ SVG และทําการให้มันเป็นสี่เหลี่ยมที่ได้รับในหน้า. |
AddSVGFromStream(r: io.Reader, rect: Rectangle) → error | AddSVGFromStream ทําการแสดง SVG จาก io.Reader ใด ๆ เป็นสี่เหลี่ยมที่ให้ไว้บนหน้า. |
AddSVGObject(svg: *SVG, rect: Rectangle) → error | AddSVGObject ทําการทํา SVG ที่มีการพาร์สก่อน เป็นรูปทรงตั้งที่ให้ไว้บนหน้า. |
AddTable(t: *Table, rect: Rectangle) → (int, error) | AddTable ทําตารางภายในสี่เหลี่ยมที่ให้. |
TagContent(parent: *StructElement, t: StructType, draw: func() error) → (*StructElement, error) | TagContent ดึงบล็อกของเนื้อหาหน้า (ทุกอย่างที่การดึงเรียกกลับออก) ภายในลําดับเน้น-เนื่องหมายและเพิ่มองค์ประกอบใบที่ตรงกันแบบ t เป็นลูกของพ่อแม่ (ศูนย์ = รูตเอกสาร). |
TagArtifact(draw: func() error) → error | TagArtifact ใส่บล็อกการวาดหน้าเป็นลําดับเนื้อหาที่ติด /Artifact ดังนั้นมันจึงถูกปฏิบัติให้เป็นเครื่องประดับและไม่รวมจากต้นโครงสร้างทาง logical structure. |
AddTaggedList(tc: *TaggedContent, parent: *StructElement, items: []string, style: TextStyle, rect: Rectangle, ordered: bool) → (*StructElement, error) | AddTaggedList ตัดลิสต์ของรายการในตัวเลข (ordered=false) หรือนับจํานวน (ordered=true) และสร้างโครงสร้างที่สามารถเข้าถึงได้: องค์ประกอบ /L ในฐานะผู้ปกครอง (nil = รูตเอกสาร), โดยมี /LI ต่อรายละรายงานที่มี / Lbl (บอลเล็ท/หมายเลข) กับ /LBody (ข้อความรายชื่อ). |
AddTaggedTable(tc: *TaggedContent, parent: *StructElement, t: *Table, rect: Rectangle) → (*StructElement, int, error) | AddTaggedTable ทํา t inside rect เหมือน AddTable และในขณะเดียวกันสร้างโครงสร้างทางลักษณะของตาราง (/Table → /TR →/TH/ TD) ภายใต้ parent (nil = รูทเอกสาร), การแท็กเนื้อหาของเซลล์แต่ละตัวเป็น เนื้อหากระบุและการครากเบื้องหลังเซิลและชายแดนเป็น / Artifact. |
ExtractText(opts: ...TextExtractOptions) → (string, error) | ExtractText ส่งกลับเนื้อหาข้อความของหน้า. |
AddText(text: string, style: TextStyle, rect: Rectangle) → error | AddText สลากข้อความภายในสี่เหลี่ยม โดยใช้รูปแบบที่ให้ไว้. |
ExtractTextWithLayout() → ([]TextLine, error) | ExtractTextWithLayout ส่งการจัดเรียงเส้นข้อความที่มีโครงสร้างตามลําดับการอ่านทางวิว (จากบนไปล่าง, จากซ้ายไปขวา). |
SearchText(query: string, opts: ...SearchOptions) → ([]TextMatch, error) | SearchText ค้นหาทุกครั้งที่คําถามเกิดขึ้นบนหน้า และส่งผลให้ตรงกันในลําดับการอ่านทางวิว (จากด้านบนไปข้างล่าง, จากซ้ายไปขวา). |
RenderTIFF(w: io.Writer, opts: RenderOptions) → error | RenderTIFF ทําการทําหน้าและเขียนมันเป็น TIFP Deflate หน้าเดียว. |
AddTOC(entries: []TOCEntry, rect: Rectangle, opts: ...TOCOptions) → (int, error) | AddTOC ทําตารางเนื้อหาจากรายการที่ได้รับมาในหน้านี้. |
DrawLine(from: Point, style: LineStyle) → error | DrawLine สล็อตช่วงเส้นเดียวจาก→ไปกับสไตล์ที่ให้. |
DrawRectangle(rect: Rectangle, style: ShapeStyle) → error | DrawRectangle ดึงและ/หรือเติมรูปสี่เหลี่ยมที่ตรงกับแกน. |
DrawCircle(center: Point, radius: float64, style: ShapeStyle) → error | DrawCircle สตรอปและ/หรือเต็มวงกลม. |
DrawEllipse(center: Point, rx: float64, style: ShapeStyle) → error | DrawEllipse ดึงและ/หรือเติมตัวเอลิปซที่ตรงกับแกน. |
DrawPolyline(points: []Point, style: LineStyle) → error | DrawPolyline สล็อตโพลีไลน์ที่เปิด (จุดแรกและสุดท้ายไม่ได้เชื่อมต่อกัน). |
DrawPath(path: *Path, style: ShapeStyle) → error | DrawPath สตรอปและ/หรือเต็มเส้นทางที่สร้างไว้ก่อนหน้านี้. |
DrawRoundedRectangle(rect: Rectangle, radius: float64, style: ShapeStyle) → error | DrawRoundedRectangle ดึงและ/หรือเติมตัวขั้นตั้งที่ตรงกับแกนด้วยมุมกลมของรัศมีที่ให้ไว้. |
DrawPolygon(points: []Point, style: ShapeStyle) → error | DrawPolygon ดึงและ/หรือเต็ม polygon ปิด (จุดสุดท้ายเชื่อมต่อกลับไปที่แรกผ่าน h). |