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.
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.
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.
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.
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.
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.
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.
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 }.
In case of Document document1 = new Document(MyDir + “TestWord.docx”) value of this field comes from constructor:
public Document(string fileName)
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.