stringFormat property

PdfStringFormat? stringFormat
getter/setter pair

Get or sets the stringFormat.

//Create a new Pdf document
PdfDocument document = PdfDocument();
//Create the web link in the PDF page
PdfTextWebLink textWebLink = PdfTextWebLink(
    url: 'www.google.co.in',
    text: 'google',
    font: PdfStandardFont(PdfFontFamily.timesRoman, 14),
    brush: PdfSolidBrush(PdfColor(0, 0, 0)),
    pen: PdfPens.brown);
//Gets or sets the stringFormat
textWebLink.stringFormat  = PdfStringFormat(
        alignment: PdfTextAlignment.center,
        lineAlignment: PdfVerticalAlignment.middle);
//Draw the web link in the PDF page
textWebLink.draw(document.pages.add(), Offset(50, 40));
//Save the document.
List<int> bytes = await document.save();
//Dispose the document.
document.dispose();

Implementation

PdfStringFormat? stringFormat;