Missing Fields in Header after convert to pdf

Hello,
In the header of a Word File we added a Field “FileName”. After converting this Document to PDF, the Filename is missing.

We use document.save (memorystrem, “pdf”) to convert the word-file.
Aspose.Words v15.2.0.0

Is there any known issue about this behavior?
Thx

Hi Daniel,

Thanks for your inquiry. Could you please attach your input Word document here for testing? I will investigate the issue on my side and provide you more information.

Hello, thx for your response.
Attached the source (docx) and target file (pdf)

In the header, “Test Word document.docx” is missing after convert to pdf.

If I save the word document directly to pdf (in Word Client), the Filename is “Test Word document.docx” in the pdf header, as expected.

Thx

Hi Daniel,

Thanks for sharing the detail. I have tested the scenario using latest version of Aspose.Words for .NET 15.3.0 and have not found the shared issue. Please use Aspose.Words for .NET 15.3.0. I have attached the output Pdf with this post for your kind reference.

The the value of filename field should be ‘Test Word document.docx’. Please note that Aspose.Words mimics the same behaviour as MS Word does. If you convert your document to Pdf using MS Word, you will get the same output.

I try to update, and give u a feedback. thx.

Its strange… I wrote a short Test-Tool it works as expected with 15.3.
In our SharePoint Workflow its another behavior… I have to investigate more time to find the differences.

If I have any results I’ll tell you.

Thx

Hi Daniel,

Thanks for your feedback. Please let us know if you face any issue while using Aspose.Words in your SharePoint workflow. The Pdf file shared by you in this post was generated by Aspose.Words v15.2.0.

Please make sure that you are using latest version of Aspose.Words for .NET 15.3.0 and using the same document which you shared in this forum thread.

Hello,
sorry for delay.

Now I have new facts.

If I create a Document with a Stream, the field in the header is missing.
Otherwise If I create a Document with directly FilePath, the field in the header is as expected.

See attached sample. TestWord.docx is the template, and Test_Fail.pdf und Test_Success.pdf are the results.

Thx

Hi Daniel,

Thanks for sharing the detail. I have tested the scenario and have managed to reproduce the same issue at my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-11893. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Thanks for your fast response.
I’m looking forward for the fix.

Hi Daniel,

Sure, we will update you via this forum thread once this issue is resolved. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.

Hi Daniel,

Thanks for your patience. It is to update you that our product team has completed the
analysis of this issue and has come to a conclusion that they won’t be
able to implement the fix to your issue. Your issue has been
closed with ‘‘Won’t Fix’’ resolution. Here is the analysis of this issue.

*Aspose.Words uses Document.OriginalFileName property to work with Field { FILENAME }.

  1. In case of Document document1 = new Document(MyDir + “TestWord.docx”) value of this field comes from constructor:
public Document(string fileName)
  1. In case of Document document2 = new Document(File.OpenRead(MyDir + “TestWord.docx”), loadoptions), constructor is public Document(Stream stream, LoadOptions loadOptions) : and the field OriginalFileName isn’ t filled.

We suggest you please use file path in Document’s constructor instead of stream.

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for .NET 18.12 update and this Aspose.Words for Java 18.12 update.