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)