B4JPdf Pro v1.0 โ Public API inventory
This inventory was transcribed from the 13 .bas modules inside the supplied B4JPdf(5).b4xlib (2026-11-11). It lists 290 public Sub declarations across 13 modules, plus selected public fields and declared events. Names, parameter order and return types are case-preserving B4J references. This is API documentation, not a source-code distribution.
B4J properties with getX / setX may be exposed as properties by the IDE. Verify the actual compiler syntax. Do not invent methods absent from this list. Some technically public helpers are low-level implementation details; prefer high-level APIs for new projects.
BytesBuilder โ 12
Initialize
Append(Data() As Byte) As BytesBuilder
Clear
Insert(Index As Int, Data() As Byte)
Set(Index As Int, Data() As Byte)
Remove(BeginIndex As Int, EndIndex As Int) As Byte()
SubArray(BeginIndex As Int) As Byte()
SubArray2(BeginIndex As Int, EndIndex As Int) As Byte()
getLength As Int
ToArray() As Byte()
IndexOf(SearchFor() As Byte) As Int
IndexOf2(SearchFor() As Byte, Index As Int) As Int
PDFBoxTools โ 44
Initialize
getShowName() As Boolean
setShowName(value As Boolean)
getShowReason() As Boolean
setShowReason(value As Boolean)
getShowLocation() As Boolean
setShowLocation(value As Boolean)
getShowDate() As Boolean
setShowDate(value As Boolean)
getTextColor() As Int
setTextColor(value As Int)
getImageOnly() As Boolean
setImageOnly(value As Boolean)
AddTextAt(InputPath As String, OutputPath As String, Text As String, X As Float, Y As Float, FontSize As Float, ColorInt As Int, TargetPage As Int) As Boolean
MergePDFs(InputPaths As List, OutputDir As String, OutputFileName As String) As Boolean
EncryptPDF(InputDir As String, InputFile As String, OutputDir As String, OutputFile As String, UserPassword As String, OwnerPassword As String) As Boolean
ExtractText(InputDir As String, InputFile As String) As String
PDFToImage(InputDir As String, InputFile As String, PageIndex As Int, DPI As Int, OutputDir As String, OutputFile As String) As Boolean
ImagesToPDF(ImagesList As List, OutputDir As String, OutputFile As String) As Boolean
FillForm(InputDir As String, InputFile As String, FieldValues As Map, OutputDir As String, OutputFile As String) As Boolean
SplitPDF(InputDir As String, InputFile As String, OutputDir As String, BaseName As String) As Int
GetPageCount(InputDir As String, InputFile As String) As Int
SignPDF(InputDir As String, InputFile As String, OutputDir As String, OutputFile As String, CertDir As String, CertFile As String, Password As String, Reason As String, Location As String, DateMs As Long) As Boolean
SignPDFVisible(InputDir As String, InputFile As String, OutputDir As String, OutputFile As String, CertDir As String, CertFile As String, Password As String, Reason As String, Location As String, DateMs As Long, ImgDir As String, ImgFile As String, PageIndex As Int, X As Float, Y As Float, Width As Float, Height As Float) As Boolean
GetSignerName(KeystorePath As String, Password As String) As String
FillFormField(inPath As String, outPath As String, fieldName As String, value As String) As Boolean
GetFormFieldNames(pdfPath As String) As List
AddTextField(inPath As String, outPath As String, pageIndex As Int, fieldName As String, x As Float, y As Float, w As Float, h As Float) As Boolean
FlattenForm(inPath As String, outPath As String) As Boolean
ValidatePDFSignatures(PDFPath As String) As List
ValidateCertFile(P12Path As String, Password As String) As CertValidationResult
AddTextWatermark(InputPath As String, OutputPath As String, Text As String, FontSize As Float, Opacity As Float) As Boolean
AddImageWatermark(InputPath As String, OutputPath As String, ImagePath As String, X As Float, Y As Float, Width As Float, Height As Float, Opacity As Float) As Boolean
AddImageWatermark2(InputPath As String, OutputPath As String, ImagePath As String, X As Float, Y As Float, Width As Float, Height As Float, Opacity As Float, TargetPage As Int) As Boolean
DeletePages(InputPath As String, OutputPath As String, PagesList As List) As Boolean
ExtractPages(InputPath As String, OutputPath As String, StartPage As Int, EndPage As Int) As Boolean
InsertDocumentAt(BasePath As String, InsertPath As String, OutputPath As String, InsertIndex As Int) As Boolean
StampPageNumbers(InputPath As String, OutputPath As String) As Boolean
GetPDFMetadata(PDFPath As String) As PDFMetadataResult
ExtractEmbeddedImages(PDFPath As String, OutputFolder As String, Prefix As String) As Int
RotatePages(InputPath As String, OutputPath As String, AngleDegrees As Int, StartPage As Int, EndPage As Int) As Boolean
PrintPDF(PDFPath As String, ShowDialog As Boolean) As Boolean
PrintPDFToPrinter(PDFPath As String, PrinterName As String) As Boolean
GetSystemPrinters() As List
Types exposed by the class: PDFSignatureResult, CertValidationResult, PDFMetadataResult. Key fields for signature inspection: IsValid, SignerName, SignerID, SignatureDate, Reason, Location, CertNotBefore, CertNotAfter, CertIssuer, CertSubject, ErrorMessage. IsValid is not comprehensive certificate-chain trust validation.
PDFChartHelper โ 8
Initialize
CreateLineChart(Title As String, XAxis As List, YValues As List, ValueSuffix As String, Curved As Boolean, FillArea As Boolean) As B4XBitmap
CreateMultiLineChart(Title As String, XAxis As List, SeriesNames As List, SeriesValues As List, ValueSuffix As String, Curved As Boolean, FillArea As Boolean) As B4XBitmap
CreateBarChart(Title As String, XAxis As List, YValues As List, ValueSuffix As String) As B4XBitmap
CreateMultiBarChart(Title As String, XAxis As List, SeriesNames As List, SeriesValues As List, ValueSuffix As String) As B4XBitmap
CreatePieChart(Title As String, Categories As List, Values As List, ValueSuffix As String) As B4XBitmap
SaveTempBitmap(Bmp As B4XBitmap, Prefix As String) As String
ClearTempFiles
Public field: ColoresPaleta.
PDFFooter โ 8
Initialize As PDFFooter
SetHeight(Height As Double) As PDFFooter
getHeight As Double
AddParagraph(Text As String) As PDFParagraph
AddImage(Dir As String, FileName As String, Width As Double, Height As Double)
AddLine(X1 As Double, Y1 As Double, X2 As Double, Y2 As Double, Width As Double, ColorInt As Int)
AddLine2(Width As Double, ColorInt As Int)
getElements As List
PDFHeader โ 8
Initialize As PDFHeader
SetHeight(Height As Double) As PDFHeader
getHeight As Double
AddParagraph(Text As String) As PDFParagraph
AddImage(Dir As String, FileName As String, Width As Double, Height As Double)
AddLine(X1 As Double, Y1 As Double, X2 As Double, Y2 As Double, Width As Double, ColorInt As Int)
AddLine2(Width As Double, ColorInt As Int)
getElements As List
PDFManager โ 45
Initialize(Callback As Object, EventName As String, Unit As String) As PDFManager
GetLoadedFontKey(FamilyName As String, Style As Int) As String
LoadTTFFont(FamilyName As String, Style As Int, Dir As String, FileName As String) As Boolean
LoadNotoCJKFont(LanguageCode As String, Directory As String) As Boolean
LoadBundledNotoSansSC As Boolean
CheckTTFFontCoverage(FamilyName As String, Style As Int, Text As String) As Map
SetMargins(Left As Double, Right As Double, Top As Double, Bottom As Double) As PDFManager
getHeader As PDFHeader
getFooter As PDFFooter
AddParagraph(Text As String) As PDFParagraph
AddTable As PDFTable
AddImage(Dir As String, FileName As String, Width As Double, Height As Double)
AddAlertBox(MainColor As Int, Rounded As Boolean) As PDFParagraph
AddAlertBoxWithImage(MainColor As Int, Rounded As Boolean, Dir As String, FileName As String) As PDFParagraph
AddAlertBoxWithIcon(MainColor As Int, Rounded As Boolean, IconText As String, IconFont As String, IconColor As Int) As PDFParagraph
AddImageAbsolute(Dir As String, FileName As String, X As Double, Y As Double, Width As Double, Height As Double)
AddPageBreak
AddLine2(Width As Double, ColorInt As Int)
Save(Directory As String, FileName As String)
HeaderWriteInternal(aoutputstream As OutputStream, acompress As Int)
saveToFile(adir As String,afile As String,acompress As Int)
PageWidth(apage As Int) As Double
gPageWidth(apage As Int) As Double
PageHeight(apage As Int) As Double
gPageHeight(apage As Int) As Double
getPagesCount As Int
gPagesCount As Int
pageAdd(awidth As Double,aheight As Double)
sDrawColor(argb() As Double)
sDrawWidth(awidth As Double)
sFillColor(argb() As Double)
sFont(afamily As String,astyle As Int,asize As Double,acolor() As Double)
outText(ax As Double,ay As Double,atext As String)
outLine(ax1 As Double,ay1 As Double,ax2 As Double,ay2 As Double)
outRectangle(ax As Double,ay As Double,aw As Double,ah As Double,astyle As String)
outImage(adir As String,afile As String,ax As Double,ay As Double,aw As Double,ah As Double)
sProperty(aproperty As String,avalue As String)
gTextSize(atext As String) As TPDFTextSize
gMultilineTextSize(awidth As Double,atext As String) As TPDFMultilineTextSize
sX(avalue As Double)
sY(avalue As Double)
gX As Double
gy As Double
glibversion As String
outRaw(rawCommand As String)
Declared events: PageCreated, SaveCompleted(Success As Boolean).
Public font constants: fontCourier, fontHelvetica, fontTimes, fontSymbol, fontZapfdingbats, fontNormal, fontBold, fontItalic, fontUnderline, fontStrikeThrough, fontArial, fontCalibri, fontTimesNewRoman, fontCourierNew.
Additional public constants: pageSizeA3PortraitWidth, pageSizeA3PortraitHeight, pageSizeA4PortraitWidth, pageSizeA4PortraitHeight, pageSizeA5PortraitWidth, pageSizeA5PortraitHeight, pageSizeLetterPortraitWidth, pageSizeLetterPortraitHeight, pageSizeLegalPortraitWidth, pageSizeLegalPortraitHeight, pageSizeA3LandscapeWidth, pageSizeA3LandscapeHeight, pageSizeA4LandscapeWidth, pageSizeA4LandscapeHeight, pageSizeA5LandscapeWidth, pageSizeA5LandscapeHeight, pageSizeLetterLandscapeWidth, pageSizeLetterLandscapeHeight, pageSizeLegalLandscapeWidth, pageSizeLegalLandscapeHeight, PropertyAuthor, PropertyCreator, PropertyProducer, PropertyTitle, PropertySubject, PropertyKeywords, RectangleBorderOnly, RectangleFillOnly, RectangleBorderAndFill, AlignLeft, AlignCenter, AlignRight, AlignJusify, CompressAlways, CompressIfSmaller, CompressNever, colorBlack, colorWhite, colorGray, colorRed, colorGreen, colorBlue, ImageBackgroundColor, WatermarkText, WatermarkColor.
PDFParagraph โ 14
Initialize As PDFParagraph
AddText(Text As String) As PDFParagraph
SetBold(Enabled As Boolean) As PDFParagraph
SetItalic(Enabled As Boolean) As PDFParagraph
SetUnderline(Enabled As Boolean) As PDFParagraph
SetStrikeThrough(Enabled As Boolean) As PDFParagraph
SetFontSize(Size As Double) As PDFParagraph
SetTextColor(ColorInt As Int) As PDFParagraph
SetFontFamily(Family As String) As PDFParagraph
SetAlignment(Align As String) As PDFParagraph
AddLineBreak As PDFParagraph
ApplyStyle As PDFParagraph
getRuns As List
getAlignment As String
PDFTable โ 12
Initialize As PDFTable
SetBorderColor(ColorInt As Int) As PDFTable
SetBorderWidth(Width As Double) As PDFTable
SetHeaderRowsCount(Count As Int) As PDFTable
getHeaderRowsCount As Int
SetColWidths(Widths() As Double) As PDFTable
AddRow As PDFTableRow
AddCell(Row As PDFTableRow, Text As String) As PDFParagraph
AddCell2(Row As PDFTableRow, Text As String, BackgroundColor As Int) As PDFParagraph
AddCellSpan(Row As PDFTableRow, Text As String, BackgroundColor As Int, ColSpan As Int) As PDFParagraph
getRows As List
getColWidths As Double()
PDFTemplateManager โ 14
Initialize(pdf As PDFManager)
SetThemeColor(Color As Int)
SetWaveColor(Color As Int)
DrawPageBackground(BackgroundColor As Int)
DrawPageFrame(BackgroundColor As Int, BorderColor As Int, BorderWidth As Double, Style As String)
DrawWaveHeader(Height As Double)
DrawWaveFooter(Height As Double)
DrawDiagonalHeader(Height As Double)
DrawDiagonalFooter(Height As Double)
DrawSweepHeader(Height As Double)
DrawSweepFooter(Height As Double)
DrawRectHeader(Height As Double)
DrawRectFooter(Height As Double)
DrawCard(X As Double, Y As Double, Width As Double, Height As Double, BackgroundColor As Int, BorderColor As Int, BorderWidth As Double, Style As String)
Public style constants: STYLE_BORDER, STYLE_FILL, STYLE_BOTH.
PdfSelectorBox โ 7
Initialize (Callback As Object, EventName As String)
Resize(Width As Double, Height As Double)
SetColors (ColorBordeCaja As Int, GrosorCaja As Int, ColorFondoTirador As Int, ColorBordeTirador As Int)
setEnabled (Active As Boolean)
Reset
GetSelection As PdfSelectionData
AttachToRect(x As Double, y As Double, w As Double, h As Double)
Events: Deleted, Modified(Data As PdfSelectionData), AreaAssigned(Zona As PdfSelectionData), ClickedBackground(X As Double, Y As Double) As Boolean, BoxDoubleClicked. Public field: mBase.
QRCodeGenerator โ 3
Initialize (BitmapSize As Int)
Create(Text As String) As B4XBitmap
AddBitmap(QRBmp As B4XBitmap, logo As B4XBitmap, Alpha As Int) As B4XBitmap
Public field: cvs.
QRCodeLogo โ 20
Initialize (Callback As Object, EventName As String)
DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
Create (Text As String) As B4XBitmap
getLogoAlpha As Int
setLogoAlpha (Alpha As Int)
getLogoImage As String
setLogoImage (ImagePath As String)
getShowLogo As Boolean
setShowLogo (Show As Boolean)
setLogo (Image As B4XBitmap)
getLogoSize As Int
setLogoSize (Size As Int)
getColor As Int
setColor (Color As Int)
getBorderRadius As Int
setBorderRadius (Radius As Int)
getBorderWidth As Int
setBorderWidth (Width As Int)
AddToParent(Parent As B4XView, Left As Double, Top As Double, Width As Double, Height As Double)
Snapshot As B4XBitmap
Event: Click. Public fields: mBase, Tag.
pdfBoxWrapper โ 95
Initialize(CallBack As Object, EventName As String)
DesignerCreateView (Base As Object, Lbl As Label, Props As Map)
AddToParent(Parent As Pane, Left As Double, Top As Double, Width As Double, Height As Double)
setEditMode(Enabled As Boolean)
getEditMode As Boolean
SetLayout(Left As Double, Top As Double, Width As Double, Height As Double)
Base_Resize (Width As Double, Height As Double)
getTag As Object
setTag(Value As Object)
getSignatureImage() As Image
setSignatureImage(img As Image)
setDocumentName(Name As String)
getDocumentName() As String
getSignatureWidth() As Double
setSignatureWidth(Width As Double)
getSignatureHeight() As Double
setSignatureHeight(Height As Double)
getSignatureMode() As Boolean
setSignatureMode(Enabled As Boolean)
setSignatureButtonEnabled(Enabled As Boolean)
getSignatureButtonEnabled() As Boolean
PlaceSignature(img As Image)
UpdatePreviewStyles
setPreviewBorderColor(colorHex As String)
getPreviewBorderColor() As String
setPreviewTextColor(colorHex As String)
getPreviewTextColor() As String
setPreviewLabelVisible(Visible As Boolean)
getPreviewLabelVisible() As Boolean
getNumberOfPages() As Int
getZoomsList() As List
StringZoomToFloat(Zoom As String) As Float
FloatZoomToString(Zoom As Float) As String
loadDocumentFromInputStream(Stream As InputStream, Zoom As Float, DescriptiveName As String) As Boolean
loadDocument(name As String, Zoom As Float) As Boolean
OpenDocuments(Paths As List, Zoom As Float) As Int
SelectDocument(index As Int) As Boolean
ReleaseDocumentFile
GetDocuments As List
renderPage(p As Int, Zoom As Float) As Image
closeDocument
CloseAllDocuments
CloseActiveDocument
getRotationAngle(page As Int) As Int
getPageSizeInPixels(p As Int, Zoom As Float) As PDFrectangle
getPageSizeInPoints(p As Int) As PDFrectangle
Repaint(Zoom As Float)
DrawOverlay
ScrollToPage(page As Int)
ScrollToPositionInDocument(PositionInDocument As PDFrectangle,PositionInScrollPane As PDFrectangle)
getDocName As String
GetSignaturePosition() As Map
getSignerName() As String
setSignerName(Name As String)
getSignerNameColor() As Int
setSignerNameColor(clr As Int)
getSignatureDate() As Long
setSignatureDate(DateMs As Long)
getShowQRLogo() As Boolean
setShowQRLogo(Show As Boolean)
getQRLogoImage() As B4XBitmap
setQRLogoImage(Img As B4XBitmap)
getQRLogoSize() As Int
setQRLogoSize(Size As Int)
getQRLogoAlpha() As Int
setQRLogoAlpha(Alpha As Int)
getQRLogoBorderColor() As Int
setQRLogoBorderColor(Color As Int)
getQRLogoBorderRadius() As Int
setQRLogoBorderRadius(Radius As Int)
getQRLogoBorderWidth() As Int
setQRLogoBorderWidth(Width As Int)
getSignatureButtonText() As String
getZoom() As Float
setSignatureButtonText(txt As String)
SetButtonTooltip(ButtonName As String, Text As String) As Boolean
SetButtonTooltips(Tooltips As Map)
SetPhantomLabelText(Text As String)
getDocPath As String
SetTheme(ThemeName As String)
StartSelection
CancelSelection
FijarFocoEditor
getTextObjectColor As Int
setTextObjectColor(clr As Int)
getTextObjectFontSize As Int
setTextObjectFontSize(size As Int)
getTextObjectFontName As String
setTextObjectFontName(name As String)
SetSelectedTextAlignment(Alignment As String)
SetSelectorColors (BoxBorderColor As Int, BoxThickness As Int, HandleFillColor As Int, HandleBorderColor As Int)
HasEditableObjects As Boolean
FlattenObjectsToPDF(DocumentPath As String)
ResolveFlattenPersistence(Persisted As Boolean, AllWritesRolledBack As Boolean)
getLastFlattenSucceeded As Boolean
Declared events: ZoomChanged(Zoom As Float), SignaturePlaced(Position As Map, Image As Image), DocumentActivated(Path As String), PdfTabChanged(ActivePath As String, ClosedPath As String), DocumentsRequested(Paths As List), PageClicked(PageIndex As Int, Coords() As Double), AreaSelected(Zone As PDFSelectionArea), BurnObject(Data As TBurnObjectData), BurnObjectConfirmed(Data As TBurnObjectData, ObjectID As String) As Boolean.
Public theme constants: THEME_SLATE, THEME_LIGHT, THEME_DARK, THEME_BLUE, THEME_SKY, THEME_CYAN, THEME_GREEN, THEME_EMERALD, THEME_TEAL, THEME_LIME, THEME_RED, THEME_ROSE, THEME_ORANGE, THEME_AMBER, THEME_YELLOW, THEME_BROWN, THEME_PURPLE, THEME_VIOLET, THEME_INDIGO, THEME_SEPIA, THEME_PEACH, THEME_LAVENDER, THEME_MINT. Other public constants: OBJ_TYPE_TEXT, OBJ_TYPE_IMAGE, OBJ_TYPE_SIGNATURE. Public fields include EditableObjects, SelectedObject, InsertMode, PendingImagePath.
Safe usage policy for coding assistants
- Select only existing public signatures listed above.
- Do not assume
Savereturns a Boolean; usePDF_SaveCompleted(Success As Boolean). SignPDFVisibleuses zero-based page indices and PDF points (72 per inch) from bottom-left.- Sign with the actual certificate owner permission; do not bypass PKCS#12 password protection.
- Never hard-code production passwords or expose private P12/PFX files.
- Preserve the existing signature engine, Bouncy Castle 1.85 and public method names.
- Document unsigned/invalid/untrusted as different states;
IsValidalone is not a full trust check. - Confirm persisted overlay changes before clearing or switching documents.
- CJK fonts must be available to the consuming B4J application's assets; check font coverage before rendering.