DocProperties in content control not converting properly

Hello GroupDocs Support Team,

I have this problem, when converting a word document to pdf. The document contains content controls (developer tools in word) and I have some custom document properties in those. After the conversion it looks like in the picture below.
image.png (6,1 KB)
Somehow the conversion just prints the technical string and not the value it contains.
Would love to have that fixed, since i use it a lot.

Thank you in advance.
NeoTS

@NeoTS

The conversion engine currently does not resolve custom document‑property placeholders that are placed inside Word content controls – it outputs the raw field code (e.g., «DocProperty MyProp»). This is a known limitation of the current GroupDocs.Conversion implementation.

To investigate further and file a defect internally, please provide:

  1. Exact SDK version you are using (e.g., GroupDocs.Conversion .NET 2.5.0).
  2. A minimal Word file that reproduces the issue (content control with the custom property).
  3. The code snippet you use for the Word‑to‑PDF conversion (including any ConversionOptions).

If you can test with the latest GroupDocs.Conversion release and the problem persists, let us know – we will log the bug and prioritize a fix.

Hello @NeoTS ,

We are sorry to hear that you have encountered this issue while converting DOCX to PDF. In order for us to assist you, we first need to analyze your source document and the code sample you are using for conversion. Please also specify the version of GroupDocs.Conversion you are working with, as well as your development environment, so that we can collect as much useful information as possible for our investigation.

Hi,

here is a demo file with a simple example. I am using GroupDocs.Conversion 24.11 nuget package with C# and .NET.
test.docx (33,6 KB)
test.pdf (56,0 KB)

    Func<LoadContext, LoadOptions> loadOptions = loadContext =>
    {
        if (inputFilePath.EndsWith(".doc") || inputFilePath.EndsWith(".docx"))
        {
            var wordLoadOptions = new WordProcessingLoadOptions
            {
                ClearBuiltInDocumentProperties = false,
                ClearCustomDocumentProperties = false,
                PreserveDocumentStructure = false,
                SkipExternalResources = false,
                UpdateFields = true,
                UpdatePageLayout = true,
                UseTextShaper = false,
                PreserveFormFields = true,
                HyphenationOptions = new HyphenationOptions() { AutoHyphenation = true }
            };
            switch (Path.GetExtension(inputFilePath))
            {
                case ".doc": wordLoadOptions.Format = WordProcessingFileType.Doc; break;
                case ".docx": wordLoadOptions.Format = WordProcessingFileType.Docx; break;
                default: break;
            }
            return wordLoadOptions;
        }
    };

    var options = new PdfConvertOptions();
    options.PdfOptions.PdfFormat = PdfFormats.PdfA_3B;
    options.PageOrientation = PageOrientation.Default;

    using (Converter converter = new Converter(inputFilePath, loadOptions))
    {
        converter.Convert(outputFilePath, options);
    }

This is the code i use for conversion and other than the problems with developer tools it works fine.

Thanks for the fast replies!
NeoTS

@NeoTS ,

It appears that the PreserveFormFields = true parameter is causing this issue. Since this option is responsible for preserving form fields in PDF, the problem is most likely related to its incorrect behavior with content controls. Nevertheless, I have forwarded your use case to our development team and created a corresponding ticket in our tracking system under ID CONVERSIONNET-8116. As soon as I receive any feedback from the developers or an estimated timeframe for a fix, I will inform you immediately.

@evgen.efimov
Thank you so much. It fixed my problem.

Hello @NeoTS ,

You’re very welcome. We will continue to investigate your use case in order to improve our functionality in future versions. If you have any further questions, please feel free to contact us.