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.

Thu Feb 11, 2021 8:03 pm

Hi,

I have a word document with a standard "SAMPLE" watermark. When I run the spire to build pdf it moves the watermark to the left top corner.
It is good on my local test env. but has an issue on the server

The server spec: windows server 2016

Please advise

Kianoush
 
Posts: 9
Joined: Wed Oct 14, 2020 1:44 pm

Fri Feb 12, 2021 8:44 am

Hello,

Thanks for your inquiry.
To help us reproduce and investigate your issue, please provide your Word file for us. And please tell us your local test environment, its DPI and the DPI of your server.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Fri Feb 12, 2021 2:40 pm

Hi

This is mostly happening after the latest windows update on our server. Our server is windows 2016 and it's a virtual box.
What I do is not related to the font size. I read a word document (with a watermark) that is stored as a binary value in a varbinary filed in a database and then convert it to PDF using the Spire component. this was working fine until the latest update on the windows 2016 server. Our server is managed by a third party. I can remote desktop to the server but not able to see the DPI value on this server.
I started with testing a plain white word document with only a watermark.
Please find the results documents in the attachment.

My test environment is Visual studio 2019. mvc and using c# code.


Regards,
Kianoush

Kianoush
 
Posts: 9
Joined: Wed Oct 14, 2020 1:44 pm

Mon Feb 15, 2021 6:26 am

Hello,

Thanks for sharing more information and sorry for the late reply as weekend.

Since we have a 7-Day Chinese Spring Festival Holiday during 02/11/2021-02/17/2021. Sorry I am temporarily unable to verify your issue on Windows Server 2016. Once we come back to work on Feb 18, 2021, I will immediately verify and give you a feedback. Thanks for your understanding.

Besides, could you please provide us with a screenshot that shows the version information about your Windows Server 2016? Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Mon Feb 15, 2021 3:11 pm

here is the snapshot

Kianoush
 
Posts: 9
Joined: Wed Oct 14, 2020 1:44 pm

Tue Feb 16, 2021 9:28 am

Hello,

Thanks for your information.
We will investigate your issue immediately after the holiday and give you a feedback as soon as possible. Thanks for your patience.

Sincerely,
Sofia
E-iceblue support team
User avatar

Sofia.Yang
 
Posts: 84
Joined: Tue Jul 14, 2020 1:41 am

Thu Feb 18, 2021 11:00 am

Hello,

Thanks for your patience.
I tested your case on windows server 2016 standard, but still didn't reproduce your issue. Here I uploaded my executable project for you, you can run the test2.exe directly on your side, and then check the test result. If your issue persists, please try the following PS method to convert your docx file to PDF. If this still does not help you, please provide your region setting such as China, Chinese and the download link for your windows server 2016 package to help us do further investigations. Thanks in advance.
Code: Select all
Document doc = new Document();
doc.LoadFromFile(inputfilepath);
ToPdfParameterList topdf = new ToPdfParameterList();
topdf.UsePSCoversion = true;
doc.SaveToFile(outputfilepath, topdf);

Sincerely,
Sofia
E-iceblue support team
User avatar

Sofia.Yang
 
Posts: 84
Joined: Tue Jul 14, 2020 1:41 am

Thu Feb 18, 2021 2:03 pm

Hi,

Unfortunately, this is not the case. I have stored a word document (as explained at first) in a varbinary field in SQL server. then I retrieve this document using a memory stream and convert it to pdf. This method has not been changed for 3 years and it was working until the last update we did on the windows server 2016. Please see the code snippet below to get some ideas:
once the object is created into memory I save it as a pdf file into the database (varbinary object)

this means all documents are stored in a database. I am not creating a pdf file as an output.

using (Stream content = new MemoryStream(template._DocumentTemplate.Content)) // this is the place I get the binary content from the database and set it to the memory stream.
{
using (var pdfDoc = new Spire.Doc.Document(content)) // create pdf object
{
using (Stream pdfContent = new MemoryStream()) // create pdf content object in memory
{
pdfDoc.SaveToStream(pdfContent, FileFormat.PDF); // Save memory object to pdf object
var pdf = new Models.Document() // some sort of operation to save the object to db
{
Content = ((MemoryStream)pdfContent).ToArray(),
Name = "test.pdf",
};

db.Documents.Add(pdf);
model.Documents.Add(pdf);

//---------------------
pdfContent.Close();
pdfContent.Dispose();
}
}
}


besides all culture and the regional setting is in US format.

Kianoush
 
Posts: 9
Joined: Wed Oct 14, 2020 1:44 pm

Fri Feb 19, 2021 8:24 am

Hello,

Thank you for sharing more information.
With the same system environment and language setting as yours, I used the memory stream to load and save document and tested our latest version(Spire.Doc Pack(hot fix) Version:9.2.0), but I still did not encounter your issue. Attached is my converted pdf file. If you used an older version, please use the latest version to test again. Meanwhile, I suggest that you test on other computers to eliminate the caused reason. Look forward to your further testing results.

Sincerely,
Sofia
E-iceblue support team
User avatar

Sofia.Yang
 
Posts: 84
Joined: Tue Jul 14, 2020 1:41 am

Fri Feb 19, 2021 4:22 pm

Hi Sofia,

I already installed version 9.2.0. That made me to think of downgrading the version to see how it reacts.
I installed version 8.12.14 and it worked a charm. So I believe the problem resides in the hot fox 9.2.0
I am reporting this as a bug in your last hotfix.
for your information, I ran my code on different servers with different os and the results are the same: 9.1.0 and 9.2.0 have the same issue with WaterMark
I am expecting my bonus anytime soon :)


Conclusion:
Downgraded to 8.12.14 and it is working for me.

Cheers,

Kianoush
 
Posts: 9
Joined: Wed Oct 14, 2020 1:44 pm

Sat Feb 20, 2021 11:29 am

Hello,

Thank you for sharing your more testing results.
I also did more tests with our latest version(Spire.Doc9.2.0) but still didn't reproduce your issue. To help reproduce the issue and locate the root reason, could you please provide a runnable project that shows your issue? You could upload it to the DropBox or OneDrive and then share the download link with us. Thanks in advance.

Sincerely,
Sofia
E-iceblue support team
User avatar

Sofia.Yang
 
Posts: 84
Joined: Tue Jul 14, 2020 1:41 am

Mon Feb 22, 2021 4:08 pm

Hi,

I am not sure why you have different results. Unfortunately, I do not have time to create a mini-project just to replicate this issue.
I am not sure why this is happening on my side. According to my personal experience, when a component is broken after upgrading it, it is related to the version.


Regards,

Kianoush
 
Posts: 9
Joined: Wed Oct 14, 2020 1:44 pm

Tue Feb 23, 2021 9:43 am

Hello,

Thanks for your response.
As for the watermark part, our dev colleagues informed that they indeed made some adjustments on the internal code for the recent versions. Since we can not reproduce your issue on our side, it is difficult to find out the caused reason. Could you please help to run my executable .exe program that I provided on 2/18? If there is no problem when running our simple program, I'm afraid that we still need your cooperation to provide your project that can reproduce your issue. Look forward your further feedback.

Sincerely,
Sofia
E-iceblue support team
User avatar

Sofia.Yang
 
Posts: 84
Joined: Tue Jul 14, 2020 1:41 am

Tue Feb 23, 2021 4:09 pm

Hi,

It seems it is a bug. To reproduce the issue please do the followings:
create a new MVC c# project
install spire doc v 9.2.0
create a method Like I explained in one of my posts eralier.
Run the project and you will see the issue. If you don't see the issue on your local IIS, publish it to a server and verify the watermark is displaced.
I suggest you open an internal ticket for it.



Regards,
Kianoush

Kianoush
 
Posts: 9
Joined: Wed Oct 14, 2020 1:44 pm

Wed Feb 24, 2021 11:02 am

Hi Kianoush,

Thank you for providing more information.
I created a MVC project and did more tests on different computers. Finally, we reproduced the issue on one computer. We have logged the issue into our tracking system with the ticket SPIREDOC-5554, our Dev team will do further investigation and fixing. Once there is any update, I will let you know immediately. Sorry for the inconvenience caused.

Sincerely,
Sofia
E-iceblue support team
User avatar

Sofia.Yang
 
Posts: 84
Joined: Tue Jul 14, 2020 1:41 am

Return to Spire.PDF

cron