Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Oct 11, 2022 1:35 pm

Hi,

We are experiencing an issue where a TextWatermark is being cut off in one of our documents.
Is this a known bug? The watermark appears to be in the center, but its only being displayed partially.
Please see attached image for example.

Thanks in advance!

Eliott

EliottOlivieri
 
Posts: 2
Joined: Mon Oct 03, 2022 2:07 pm

Wed Oct 12, 2022 2:55 am

Hello,

Thanks for your inquiry.
I simulated a file and tested your case using the latest version of the Spire.PDF Pack Version:8.9. But I didn't reproduce your question. In order to facilitate our further investigation, please provide us with your test code and test documentation. You can attache them here or send them to us via email ([email protected]). Thank you in advance.

Sincerely,
Simple
E-iceblue support team
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Tue Oct 18, 2022 7:06 am

Hello,

Could you please let us know how is your issue going? Thanks in advance for your feedback and time.

Sincerely,
Simple
E-iceblue support team
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Mon Oct 24, 2022 1:08 pm

Hi,

We have not yet resolved the issue.
I have attached an example of the problematic document.
Here is an example of the code:

if (isCancellation)
{
TextWatermark txtWatermark = new TextWatermark();
txtWatermark.Text = APIQuoteConstants.WATERMARK_CANCELED;
txtWatermark.FontSize = 120;
txtWatermark.Layout = WatermarkLayout.Diagonal;
docx.Watermark = txtWatermark;
}

Regards,

Eliott

EliottOlivieri
 
Posts: 2
Joined: Mon Oct 03, 2022 2:07 pm

Tue Oct 25, 2022 5:55 am

Hello,

Thanks for your more information.
Sorry we have not received any attached documents from this post.
However, we suspected that your document paragraphs may have white background colors, as my attached "test.docx". You can refer to the code below to remove the background color, and then add the watermark to test again. If your problem persists after the test and your file exceeds the size limitation for attachment. You could upload your file to the DropBox or OneDrive and then share the download link with us. Thank you in advance.
Code: Select all
Document document = new Document(@"test.docx");       
foreach (Section section in document.Sections)
{
foreach (Paragraph paragraph in section.Paragraphs)
{                   
paragraph.Format.BackColor = Color.Empty;
foreach (DocumentObject paraChildObject in paragraph.ChildObjects)
{
if (paraChildObject.DocumentObjectType == DocumentObjectType.TextRange)
{
extRange textRange = (TextRange)paraChildObject;
textRange.CharacterFormat.TextBackgroundColor = Color.Empty;                   
}
}
}
}
//Insert text watermark.
InsertTextWatermark(document.Sections[0]);
//Save as docx file.
document.SaveToFile("Sample.docx", FileFormat.Docx);
}
private void InsertTextWatermark(Section section)
{
TextWatermark txtWatermark = new TextWatermark();
txtWatermark.Text = "E-iceblue";
txtWatermark.FontSize = 95;
txtWatermark.Color = Color.Blue;
txtWatermark.Layout = WatermarkLayout.Diagonal;
section.Document.Watermark = txtWatermark;
}


Sincerely,
Simple
E-iceblue support team
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Wed Nov 02, 2022 7:39 am

Hello,

Could you please let us know how is your issue going? Thanks in advance for your feedback and time.

Sincerely,
Simple
E-iceblue support team
User avatar

Simple.Li
 
Posts: 248
Joined: Fri Jul 01, 2022 2:33 am

Return to Spire.PDF

cron