LINQ - Inserting Documents Dynamically

I’m having difficulty trying to diagnose an issue with the LINQ syntax for inserting a document dynamically.

I have read this post on the subject but it isn’t helping me solve my issue:

I am using the following code:

    $data = [
            "pagebreak"    => true,
            "hasTC"        => true,
            "TC"           => "Contents Title 2",
            'url'          => 'https://aspose-test-bucket.s3.eu-west-1.amazonaws.com/page1.docx',
            'footer' => ['top1' => 'row 1 col 1', 'top2' => 'row 1 col 2', 'top3' => ['part0' => 'A', 'part1' => 'B', 'part2' => 'C'], 'top4' => 'row 1 col 4', 'bottom' => 'row 2']
        ];

    $settings = new ReportEngineSettings([
                        "data_source_type" => "Json",
                        "report_build_options"  => [
                            "AllowMissingMembers",
                            "RemoveEmptyParagraphs"of the first page
                         ]
                    ]);

    $request = new BuildReportOnlineRequest(__DIR__."/Aspose-LINQ-Template.docx", json_encode($data, JSON_UNESCAPED_SLASHES), $settings);
    $result = $wordsApi->buildReportOnline($request);
    rename($result->getPathname(), "LINQ.docx");

I would expect Page1.docx to use the styles in the template document as both documents have the same style names.

However the final document (LINQ.docx) isn’t formatted correctly - the content of Page1.docx doesn’t appear to have the correct style applied to it.

Dynamically inserted page: page1.docx (141.1 KB)

Template: Aspose-LINQ-Template.docx (175.1 KB)

Result: LINQ.docx (161.8 KB)

Thanks for sharing documents for testing. I will create a ticket for further investigation

@FFSPUD
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): WORDSCLOUD-2814

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.

Please use sourceStyles parameter in the template to keep source document formating
<<doc [url] –build -sourceStyles>>
Aspose-LINQ-TemplateFixed.docx (175.2 KB)