Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Oct 19, 2017 12:32 pm

Hi,

First I would like to thank you for providing a temporary license so quickly.
When converting from docx to pdf I've encountered two issues. Please see the attachment.

1. A full 2 page document conversion has 3 pages. This is a problem for us because we've got a lot of dynamic templates and some content controls must not change position.
2. On some png images with transparency the background color is ignored.

Are there any options that I can set in order to fix these or are they bugs?

Thank you,
Sebastian

Code: Select all
var inputFolder = @"C:\SpireTests";
var files = Directory.GetFiles(inputFolder, "*.docx", SearchOption.TopDirectoryOnly);

foreach (var file in files)
{
    var document = new Document();
    document.LoadFromFile(file);

    var newFile = Path.ChangeExtension(file, "pdf");
    document.SaveToFile(newFile, FileFormat.PDF);
}
Last edited by sebastian.fratila.itp on Mon Oct 23, 2017 2:24 pm, edited 1 time in total.

sebastian.fratila.itp
 
Posts: 2
Joined: Thu Oct 19, 2017 7:50 am

Fri Oct 20, 2017 6:06 am

Hi Sebastian,

Thanks for your inquiry.
As for the first issue, I have reproduced it and logged it in bug system.
As for the second issue, I checked the file(test2.docx) and found there are 4 images in it, three of them have gray background, and only one image(the largest one on right) has transparency background and it is blurry after converting. I have logged the issue in bug systems.
Once there is any progress about the issues, we will let you know immediately.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Oct 23, 2017 7:24 am

Yes, that's the problematic png. I noticed the png changes and it converts correctly if I export the image and put it back in into the docx. This would take a lot of time to do by hand, if it can be fixed, it would be much appreciated.
Thank you for checking.

sebastian.fratila.itp
 
Posts: 2
Joined: Thu Oct 19, 2017 7:50 am

Mon Oct 23, 2017 7:43 am

Hi Sebastian,

We will inform you when there is any update for the issues I found.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Mar 02, 2018 7:47 am

Hi Sebastian,

Sorry for long silence.
We first suggest you use PS method which could make the quality of image better when converting your Word to PDF. And I attached the result, you could have a check.
Code: Select all
            var document = new Document();
            document.LoadFromFile(@"F:\test2.docx");
            ToPdfParameterList topdf = new ToPdfParameterList();
            topdf.UsePSCoversion = true;
            document.SaveToFile("11924.pdf",topdf);

Another side, we will continue looking into it and the paging issue, once there is other news, we will let you know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc