UnlockKey | 代码中无需调用 |
NewDocument | TsgcPDFDocument.Create,然后 AddPage(新文档在添加之前没有页面) |
NewPage, SetPageDimensions, SetPageSize | TsgcPDFDocument.AddPage(AWidth, AHeight): TsgcPDFPage, InsertPage(AIndex, AWidth, AHeight) |
LoadFromFile, LoadFromString | TsgcPDFDocument.LoadFromFile, LoadFromStream, LoadFromBytes |
带密码的 LoadFromFile | 在 LoadFromFile 之前调用 TsgcPDFDocument.SetPassword(APassword) |
SaveToFile, SaveToString | TsgcPDFDocument.SaveToFile, SaveToStream, SaveIncremental |
PageCount | TsgcPDFDocument.PageCount;仅针对文件时用 sgcPDFGetPageCount(AFileName) |
SelectPage | TsgcPDFDocument.Pages[AIndex](从 0 开始,默认属性),GetPage(AIndex) |
SetInformation | TsgcPDFDocument.Info.Title, .Author, .Subject, .Keywords, .Creator, .Producer |
AddStandardFont + SelectFont + SetTextSize + DrawText | TsgcPDFPage.DrawText(AText, X, Y, AFont, AFontSize),搭配 TsgcPDFStandardFont(sfHelvetica、sfTimesRoman、sfCourier 及其粗体和斜体变体) |
SetTextColor + DrawText | TsgcPDFPage.DrawTextColor(AText, X, Y, AFont, AFontSize, R, G, B)(分量取值 0 到 1) |
AddTrueTypeFont + DrawText | TsgcPDFDocument.AddTrueTypeFont(AFontName, ABold, AItalic): Integer(或 AddTrueTypeFontFromFile),然后 TsgcPDFPage.DrawTextTT |
DrawLine, DrawBox | TsgcPDFPage.DrawLine(X1, Y1, X2, Y2, ALineWidth), DrawRectangle(X, Y, W, H, ALineWidth), DrawRectangleFill |
AddImageFromFile + SelectImage + DrawImage | TsgcPDFDocument.AddImage(AFileName): Integer + TsgcPDFPage.DrawImageFromIndex(AIndex, X, Y, W, H),或 DrawImageFile(AFileName, X, Y, W, H) |
GetPageText | TsgcPDFDocument.ExtractTextW(APageIndex), ExtractText, FindText; TsgcPDFEditor.ExtractAllText, SearchText |
AddToFileList + MergeFileList | sgcPDFMergeFiles([...], AOutputFile) |
MergeDocument | TsgcPDFDocument.AppendDocument(ADoc), TsgcPDFEditor.MergeFrom(AFileName) |
ExtractPageRanges, ExtractFilePages | sgcPDFExtractPages(AInputFile, AOutputFile, ARange)(从 1 开始的范围字符串,如 '1,3,5-9'),TsgcPDFEditor.ExtractPages(ARange, AOutputFileName) |
DeletePages | TsgcPDFDocument.DeletePages(ARange), DeletePage(AIndex) |
RotatePage | TsgcPDFEditor.RotatePage(AIndex, ADegrees) |
SetTransparency + DrawText(水印) | TsgcPDFEditor.AddWatermarkAllPages(TsgcPDFWatermarkOptions), AddWatermark, AddTransparentText |
在每一页上 DrawText(印章、页眉、页脚) | TsgcPDFEditor.AddTextColor, AddHeaderText, AddFooterText, AddPageNumbers |
RenderPageToDC | TsgcPDFRendererGDI.RenderPage(ADC, ADocument.Parser, APage.PageDict, AWidth, AHeight);在 VCL 查看器中用 TsgcPDFViewerControl.RenderPageToBitmap |
RenderPageToFile | TsgcPDFExporter.ExportPage(ADocument, APageIndex, AFileName)(BMP、PNG、JPEG),sgcPDFPageToImage(APDFFile, AImageFile, APageIndex, ADPI) |
FormFieldCount, FindFormFieldByTitle | TsgcPDFDocument.AcroForm.FieldCount, AcroForm.FindField(AName) |
SetFormFieldValue, SetFormFieldValueByTitle | AcroForm.FillField(AName, AValue), AcroForm.SetCheckBox(AName, AChecked), TsgcPDFEditor.FillFormField |
GetFormFieldValue | AcroForm.GetFieldValue(AName) |
NewFormField | AcroForm.AddTextField, AddCheckBox, AddComboBox, AddListBox, AddRadioGroup + AddRadioButton, AddButton, AddSignatureField |
FlattenFormField | AcroForm.FlattenFields, TsgcPDFEditor.FlattenForm |
Encrypt | TsgcPDFDocument.SetEncryption(AMethod, AUserPassword, AOwnerPassword),取值 emAES_256、emAES_128、emRC4_128 或 emRC4_40 |
CapturePage | TsgcPDFDocument.AddPageAsForm(ASource, APageIndex): Integer(带页面框、矩形或批注的重载) |
DrawCapturedPage | TsgcPDFPage.DrawForm(AFormIndex, X, Y, AScaleX, AScaleY, ARotation), DrawFormInRect(AFormIndex, ATarget, AKeepAspect, ARotation), DrawFormMatrix |
GetPageBox | TsgcPDFPage.GetPageBox(ABox) (ppbTrimBox, ppbBleedBox, ...), TsgcPDFDocument.GetFormBBox |
NewOutline | TsgcPDFEditor.AddBookmark(ATitle, APageIndex), AddBookmarkChild |
AddLinkToPage | TsgcPDFEditor.AddLinkAnnotation(APageIndex, ALeft, ABottom, ARight, ATop, ADestPage) |
AddNoteAnnotation | TsgcPDFEditor.AddTextAnnotation(APageIndex, ALeft, ABottom, ARight, ATop, AText) |
SignFile | TsgcPDFEditor.SignDocument(AOutputFile, ACertSubjectName, AReason, ALocation) |
PrintDocument | VCL 查看器 TsgcPDFViewerControl.Print(AFromPage, AToPage, ATitle) 不弹对话框直接打印,PrintDialog(ATitle) 显示打印机对话框(页面范围、份数)后打印。FireMonkey 查看器 TsgcPDFViewerFMX 在 Windows 和 macOS 上有同样的两个方法。 |
SetMeasurementUnits(0), SetOrigin(0) | 默认且唯一的坐标系:以点为单位,原点在左下角;辅助函数 sgcPDFMMToPoints、sgcPDFRectMM |