Strange artifact (tiny dot) at the bottom left of a TextStamp

As I see there is already similar issue reported in the topic ‘Gray dot as visual artifact at lower left corner of stamp’, but the topic is private, so I will make a new topic related to the issue

When using a multiline FormattedText with a TextStamp there is strange dot at the bottom left of the TextStamp . You can see it in the attached file under the ‘123asd…’ test office address

The code I’m using is this:

var formattedText = new FormattedText();
formattedText.AddNewLineText(office.Name);
formattedText.AddNewLineText(address.Street);
formattedText.AddNewLineText($"{address.ZipCode} {address.City}");

var stamp = new TextStamp(formattedText)
{
    TopMargin = 0,
    BottomMargin = 0,
    LeftMargin = _defaultMargin.Left,
    RightMargin = _defaultMargin.Right,
    TextAlignment = ConvertAlignment(layout.OfficeTextAlignment),
    HorizontalAlignment = GetHorizontalAlignment(layout.OfficePlacement),
    VerticalAlignment = VerticalAlignment.Top,
    TextState = { FontSize = OfficeInfoFontSize }
};

Can you help to get rid of this unnecessary dot?

test_output_pdf_v2.pdf (596.8 KB)

@VladimirEfimenko

This issue involves a visual artifact (a tiny dot) appearing at the bottom left of a TextStamp when using multiline FormattedText in Aspose.Pdf. Similar rendering anomalies have been reported by users in contexts involving TextStamp and multi-line text layout, particularly around text alignment and clipping . While the exact cause is not explicitly documented, the artifact may be related to how the text baseline or bounding box is calculated during rendering, especially with specific font and margin settings.

To help mitigate the issue, consider the following adjustments:

  1. Apply minimal margins: Introduce small top and bottom margins to prevent edge rendering issues.
  2. Set an explicit font: Use FontRepository.FindFont() to ensure consistent font metrics.
  3. Adjust text content: Add a dummy first line (e.g., an empty string) to shift baseline positioning and avoid unintended rendering artifacts.

Example adjustment:

var formattedText = new FormattedText();
formattedText.AddNewLineText(""); // Optional: shift baseline with empty line
formattedText.AddNewLineText(office.Name);
formattedText.AddNewLineText(address.Street);
formattedText.AddNewLineText($"{address.ZipCode} {address.City}");

var stamp = new TextStamp(formattedText)
{
 TopMargin = 1,
 BottomMargin = 1,
 LeftMargin = _defaultMargin.Left,
 RightMargin = _defaultMargin.Right,
 TextAlignment = ConvertAlignment(layout.OfficeTextAlignment),
 HorizontalAlignment = GetHorizontalAlignment(layout.OfficePlacement),
 VerticalAlignment = VerticalAlignment.Top,
 TextState = 
 { 
 FontSize = OfficeInfoFontSize,
 Font = FontRepository.FindFont("Arial") // Explicit font assignment
 }
};

This behavior has been observed in scenarios involving multiline FormattedText and alignment settings , suggesting a possible limitation in the current version of Aspose.Pdf. Execution did not complete, so the code above is a hypothesis based on similar user-reported cases. If the issue persists, please confirm your Aspose.Pdf version and provide a minimal reproducible sample for further analysis. A moderator will follow up in this thread.

I’ve tried minimal marings and explicit font ‘Arial’, but that didn’t help

The Aspose.PDF version used is the latest at this moment 25.12.0.
The code I’m using :

var formattedText = new FormattedText();
formattedText.AddNewLineText(office.Name);
formattedText.AddNewLineText(address.Street);
formattedText.AddNewLineText($"{address.ZipCode} {address.City}");

var stamp = new TextStamp(formattedText)
{
    TopMargin = 1,
    BottomMargin = 1,
    LeftMargin = _defaultMargin.Left,
    RightMargin = _defaultMargin.Right,
    TextAlignment = ConvertAlignment(layout.OfficeTextAlignment),
    HorizontalAlignment = GetHorizontalAlignment(layout.OfficePlacement),
    VerticalAlignment = VerticalAlignment.Top,
    TextState = { FontSize = OfficeInfoFontSize, Font = FontRepository.FindFont("Arial")}
};

@VladimirEfimenko

The user is reporting a visual artifact (tiny dot) at the bottom left of a TextStamp when using Aspose.PDF for .NET, and has provided code and version details. This is a code-level issue requiring troubleshooting or workaround suggestions.

Any updates known in this regard ?

@VladimirEfimenko

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-61555

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like