We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

DOCX to PDF conversion issue with Header Footer and Section break rendering using .NET

Hi Ahmad,

We are using Aspose.Total 18.5 dll.

We are facing a big problem while converting word to pdf with Header, Footer, Section break and Page break.

Issues are as follows:-

  1. The sentence is moving to next page if it is near to the footer.
  2. Content overflow is occurring if the sentence is near to the header.
  3. The sentence is removing if it is having any section breaks or page breaks.

We are using the below code:-

using Aspose.Words;

var newDocument1 = new Document(Path.Combine(path, sessionid, filename));
newDocument1.Save(Path.Combine(Path.Combine(outputpath, sessionid), filename + “_temp.pdf”), SaveFormat.Pdf);
newDocument1.AcceptAllRevisions();

=> Could you please help us for the above issues. Our code is there in production now and client is behind us.

Thanks,
Santosh Kumar Panigrahi

@santoshp1989,

We suggest you please try the latest version of Aspose.Words.Cpp 20.3.0. If you still face problem, please ZIP and attach your input Word document and problematic output PDF here for testing. We will investigate the issue and provide you more information on it.

Hi Tahir,

I am very sorry but we can’t go for Aspose.Words.Cpp 20.3.0 dll at this situation.
Our code already moved to Production and we are not in a situation to go for any new dll.
Client also not allowed us to go for any new dll.
We need to manage with the existing Aspose.Word 18.5 dll.

I can share the word file and pdf file if you want.
Could you please find the attached Zip file for where you can fine the Word(Test.zip) and PDF (Test.pdf) file.Test.pdf (266.8 KB)
Test.zip (257.5 KB)

=> We are in a critical situation, please help us.

Thanks & Regards,
Santosh Kumar Panigrahi

@santoshp1989,

We are investigating this issue and will get back to you soon.

@santoshp1989,

We have tested the scenario using the latest version of Aspose.Words.Cpp 20.3 and have not found the shared issue. So, please use Aspose.Words.Cpp 20.3. We have attached the output PDF with this post for your kind reference. awcpp-output-20.3.pdf (266.0 KB)

Hi Tahir,

I am sorry but Aspose.Words.Cpp 20.3 dll is for C++ developers and it will work only in C++ environment.

We are .Net Developers and we use .Net Framework and C# as a programming language.

If we try to install Aspose.Words.Cpp 20.3 dll in .Net Framework 4.6.1 then it will throw an error
saying “Install-Package : Could not install package ‘CodePorting.Native.Cs2Cpp.API 20.3.0’. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.1

=> For you kind information, we are using Aspose.Total 18.5 and this includes Apose.Words 18.5 version dll. We have to find the solution by using Aspose.Words 18.5 version dll only.

=> Our code already moved to Production and we are not in a situation to go for any new dll.

=> We need to manage with the existing Aspose.Words 18.5 dll.

=> We are in a critical situation, please help us.

Thanks & Regards,
Santosh Kumar Panigrahi

@santoshp1989,

Please accept my apologies for your inconvenience.

We suggest you please use the latest version of Aspose.Words for .NET 20.4. The latest version of Aspose.Words for .NET generates the correct output.

Please note that we do not provide support for older released versions of Aspose.Words. Moreover, we do not provide any fixes or patches for old versions of Aspose products either. All fixes and new features are always added into new versions of our products.

We always encourage our customers to use the latest version of Aspose.Words as it contains newly introduced features, enhancements and fixes to the issues that were reported earlier.

Hi Tahir,

Thank you Tahir for giving us the information, we will definitely use Aspose.Words 20.4 dll.
But before that, we need to test converting word files to pdf files with Aspose.Word trial version 20.4 dll.

Could you please find the attached zip for Word and pdf files Test1.zip (767.6 KB)

So have tried with on of the word file converting to pdf file using Aspose.Words 20.4 trial version and we got issues.

Issues while converting word to pdf where word is the input and pdf is output are as follows:-

  1. Word file is having 10 pages but pdf file is having 11 pages.
  2. Word file is having page break in page no. 9 but Aspose do not handle.
  3. In PDF, page 10 there is a cut in the top of the page.

Could you please help on the above issues, why the still the issues are coming with latest version Aspose.Words 20.4.

Please help us.

Thanks,
Santosh Kumar Panigrahi

@santoshp1989

You are facing these issues because you are using Aspose.Words in evaluation mode. Please get the temporary license and apply it before importing document into Aspose.Words’ DOM. We have converted your document into PDF and attached it with this post for your kind reference. 20.4.pdf (375.6 KB)

Hi Tahir,

I think temporary license is paid one?

Before going for a temporary license could you please clarify our doubts below:-

  1. Aspose.Words 18.5 supports .Net Core 2.2?
  2. Aspose.Words 18.5 supports .Net Framework 4.5?
  3. Aspose.Words 18.5 supports .Net Framework 4.6?
  4. Aspose.Words 20.4 supports .Net Core 2.2?
  5. Aspose.Words 20.4 supports .Net Framework 4.5?
  6. Aspose.Words 20.4 supports .Net Framework 4.6?

Note:-
=> We are having three different applications in our Project.
=> First one is using .Net Framework 4.5, Second one is using .Net Framework 4.6 and Last one is using .Net Core 2.2.
=> That’s why the above questions we are asking.
=> If we are clarified with our doubts then may be we can plan for Aspose.Words 20.4.

Please help us.

Thanks & Regards,
Santosh Kumar Panigrahi

@santoshp1989

No, it is free license for 30 days.

Aspose.Words for .NET does support the shared .NET versions.

Hi Tahir,

Could you please help us to find temporary license file(Aspose.Total.lic) and Aspose.Words 20.4 dll.

I have tried but I am not getting anywhere.

You can zip it(both - temporary license file(Aspose.Total.lic) and Aspose.Words 20.4 dll) and give in this same email.

We are in a hurry.

Please help us.

Thanks & Regards,
Santosh Kumar Panigrahi

@santoshp1989

Please go through the steps by clicking ‘purchase wizard’ in the following link. After completing the steps, you can get an option to download temporary license.
https://purchase.aspose.com/temporary-license

Please download Aspose.Words for .NET (Download | NuGet).

Hi Tahir,

Thank you Tahir for giving information regarding downloading Aspose.Words dll. I can able to download the dll and able to use in our application.

But I am unable to get a chance to download temporary license. I completed the steps by clicking ‘purchase wizard’ but after completing the steps, I am unable get any option to download the temporary license.

Below image is for our reference:-

image.png (93.7 KB)

Please help us.

Thanks,
Santosh Kumar Panigrahi

@santoshp1989

Please click the ‘Get a Temp License’ button at 5th step as shown in attached image. This will send the temporary license to your email.
temp license.png (14.5 KB)

Hi Tahir,

Could you please answer by below question:-

-> We are using two Servers, one is Web Server and another one is Application Server in our Project.
-> Same code is working fine in Application Server but not working fine in Web Server.
-> I am talking about that Header and Footer issue what I share with earlier.
-> Web Server installed with .Net Core 2.2 and Application installed with .Net Framework 4.6.1

=> Earlier you told Aspose.Words 18.5 dll will work for both .Net Framework and .Net Core.

Could you please help us by giving the answer why the same code is not working in Web Server.

Thanks,
Santosh Kumar Panigrahi

Hi Tahir,

Thank you for giving me the information. Now I am able to use Aspose.Word 20.4 for .Net dll and Temporary license in my local and it is working fine.

But the same thing, we are trying to move the code to Servers/Environments(QA, UAT), it is not working.

Could you please help me on this.

Thanks,
Santosh Kumar Panigrahi

@santoshp1989

Yes, Aspose.Words for .NET does support both .NET Framework and .NET Core 2.2

It is nice to hear from you that your problem has been resolved.

Please make sure that all fonts used in your document are installed on the machine where you are converting document to PDF. Following code example shows how to get notification for missing fonts.

Document doc = new Document(MyDir + "Document.doc");

HandleDocumentWarnings callback = new HandleDocumentWarnings();
doc.WarningCallback = callback;

doc.Save(MyDir + "20.4.pdf");

public class HandleDocumentWarnings : IWarningCallback
{
    public void Warning(WarningInfo info)
    {
        // We are only interested in fonts being substituted.
        if (info.WarningType == WarningType.FontSubstitution)
        {
            Console.WriteLine(info.WarningType + " :: " + info.Description.ToString());
        }
    }
}

Moreover, please check the latest version of Aspose.Words for .NET 20.4 is installed and license is set properly.

If you still face problem, please attach the PDF files generated by the latest version of Aspose.Words at both systems (Web Server and Application Server). We will investigate the issue and provide you more information on it.

Hi Tahir,

-> Do you mean, for using Aspose.Words 20.4 dll, we need to installed all the fonts?
-> For your kind information, all the fonts are installed in Servers/Environments(QA, UAT). If not then how it is working fine in case of Aspose.Words 18.5 dll.
-> What do you mean by latest version of Aspose.Words for .NET 20.4 is installed here, this is a dll. Only thing is to move the dll the server Project folder.
-> Whatever temporary license I got it in email from Aspose, I am using the same in the server. But still it is not working.

Could you please help me on this.
.
Thanks,
Santosh Kumar Panigrahi

Tahir, any update on the above issues.