Hi.
Hi Michal,
Thanks for your inquiry. I am afraid you cannot access a floating box in an existing PDF document directly and change the font settings. However, if you know the coordinates of the specific area, then you can change the font and font size as follows.
Moreover, please note as described in [documentation](("[[BL]]http://www.aspose.com/docs/display/pdfnet/Tips+and+Tricks
[[/BL]]) that Point is the measuring unit of Aspose Pdf and 72 points = 1 Inch = 25.4 mm. In the case of an A4 page size, the coordinates of the lower left corner are (0,0) and the top right corner are (594,841) in points.
//open document
Document pdfDocument = new Document(myDir + "input.pdf");
// TextFragmentAbsorber to find text within a specific rectangle
TextFragmentAbsorber textFragmentAbsorber = new TextFragmentAbsorber();
textFragmentAbsorber.TextSearchOptions.LimitToPageBounds = true;
textFragmentAbsorber.TextSearchOptions.Rectangle = new Aspose.Pdf.Rectangle(90, 190, 255, 345);
// accept the absorber for the desired page number search
pdfDocument.Pages[1].Accept(textFragmentAbsorber);
// get the extracted text fragments
TextFragmentCollection textFragmentCollection = textFragmentAbsorber.TextFragments;
// loop through the fragments
foreach (TextFragment textFragment in textFragmentCollection)
{
Console.WriteLine("Text : {0}", textFragment.Text);
textFragment.TextState.Font = FontRepository.FindFont("Arial");
textFragment.TextState.FontSize=16;
}
pdfDocument.Save(myDir + "output.pdf");
Please feel free to contact us for any further assistance.
Best Regards,