DOCX tp PDF Conversion: UpdateFields empties the file name field

I want to update all fields in my DOCX when i convert it to a PDF using GroupDocs.Conversion. I tested this with Version 22.7.0 and 23.5.0. Because of an other issue i’m currently unable to upgrade to any version newer than 23.5.0.

This is my function to convert a DOCX to a PDF:

    private static void ConvertWordToPdf(string sourcePath, string outFileName)
    {
        var loadOptions = new WordProcessingLoadOptions
        {
            BookmarkOptions = new WordProcessingBookmarksOptions
            {
                HeadingsOutlineLevels = 9
            },
            UpdateFields = true
        };

        using (var converter = new Converter(sourcePath, () => loadOptions))
        {
            var convertOptions = new PdfConvertOptions();
            convertOptions.PdfOptions.FormattingOptions.PageMode = PdfPageMode.FullScreen;
            converter.Convert(outFileName, convertOptions);
        }
    }

I want to use UpdateFields so my fields in the DOCX will be updated in the converted PDF. As soon as UpdateFields is true, the fields will be updated but the file name field is always empty in the PDF. With UpdateFields = false, the file name is still there but the fields won’t be updated.

How can I update my fields and still have my file name field filled out?

2 Likes

@chillmau

Could you please share the problematic DOCX as well? We’ll then look into this scenario.

Hi @atir.tahir

Thanks for your request. @chillmau is our software development partner so therefore I will take over the communciation as far as possible. Here is the original word document with the “fieldname” marked yellow.

#237 Word FileName.docx (79.7 KB)

and here are the conversion results:
#237 - Word FileName GroupDocs.Conversion 22.7.0.pdf (94.8 KB) --> OK with UpdateFields=false
#237 - Word FileName GroupDocs.Conversion 23.5.0.pdf (95.2 KB) --> FileName missing in footer
#237 - Word FileName GroupDocs.Conversion 23.5.0 - UpdateFields=true.pdf (94.7 KB) --> FileName completely missing

In my understanding there is more than one issue. The library update causes the filename not being written in the footer and the option UpdateFields=true causes the fieldname not beeing written at all with library 22.7.0 and 23.5.0.

Because of this issue we had to downgrad again to version 22.7.0 after having invested a lot of time upgrading. Thanks for your support!

Regards
Sascha

@chillmau
We appreciate all the details that you provided. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CONVERSIONNET-6323

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as CONVERSIONNET-6323) have been fixed in this update. This message was posted using Bugs notification tool by nikola.yankov