DocIo converting to PDF is not showing headers with images.

Hello,

I have using DocIO and converting docx to pdf.
below is the code. but when i tries to convert those to pdf.
DocIORenderer render = new DocIORenderer();
            render.Settings.ExportBookmarks = Syncfusion.DocIO.ExportBookmarkType.Headings;
            render.Settings.ChartRenderingOptions.ImageFormat = ExportImageFormat.Jpeg;
            PdfDocument pdf = render.ConvertToPDF(document);

6 Replies 1 reply marked as answer

HC Hemalatha Chiranjeevulu Syncfusion Team March 8, 2021 09:08 AM UTC

Hi Sandip,

Thank you for contacting Syncfusion support.

From the details, we are not able to find the details about the exact issue you are facing to proceed further at our end. Could you please share us the complete details about the issue, that you are facing at your end.

If you are facing preservation issue means, could you please share the below things at your end
1. Complete code snippets which used at your end
2. Input Word document
3. Syncfusion product version which used in your application
4. Screenshot of the issue

This will be more helpful for us to reproduce the exact issue at our end and to proceed further at our side.

Please let us know if you have any other questions.

Regards,
Hemalatha C



SA Sandip March 8, 2021 12:12 PM UTC

Hello, thanks for responding.

My Syncfusion version :18.4.0.46 and uploaded word doc and also code snippet. if you see in header i have logo which isn't converting to pdf.

 FileStream fileStreamPath = new FileStream(_currentEnvironment.WebRootPath + "\\template\\Worker Status Determination Statement template v1.docx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
            WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx);
            string[] fieldNames = new string[] { "WorkerName", "WorkerAddress", "WorkerOperatingAs", "WorkerIntermediary", "WorkerOtherIntermediary", "EngagementDate", "EngagementContractingParty", "EngagementBusinessContact", "EngagementDetails", "DeterminationDate", "EngagementScope", "WorkerDeemed" };
            string[] fieldValues = new string[] { $"{currentMapping.Freelancers.FirstName} {currentMapping.Freelancers.LastName}", currentMapping.FreelancerAddress, currentMapping.FreelancerOperatingAs, currentMapping.FreelancerIntermediary, currentMapping.FreelancerOtherIntermediary, currentMapping.Projects.StartDate.ToString("dd-MMM-yyyy"), currentMapping.Projects.ContractingContact, currentMapping.Projects.BusinessContact, currentMapping.Projects.Description, currentMapping.DeterminationDate.HasValue ? currentMapping.DeterminationDate.Value.ToString("dd-MMM-yyyy") : string.Empty, currentMapping.EngagementScope, currentMapping.WorkerDeemed };

            document.MailMerge.Execute(fieldNames, fieldValues);
            DocIORenderer render = new DocIORenderer();
            render.Settings.ExportBookmarks = Syncfusion.DocIO.ExportBookmarkType.Headings;
            render.Settings.ChartRenderingOptions.ImageFormat = ExportImageFormat.Jpeg;
            PdfDocument pdf = render.ConvertToPDF(document);
            MemoryStream memoryStream = new MemoryStream();
            pdf.Save(memoryStream);
            render.Dispose();
            pdf.Close();
            document.Close();
            memoryStream.Position = 0;
            return File(memoryStream, "application/pdf", $"Worker Status Determination Statement-{currentMapping.Freelancers.FirstName}-{currentMapping.Projects.Name}-{currentMapping.IR35QuestionnairesVersionHistory.Name}.pdf");     

Attachment: Worker_Status_Determination_Statement_template_v1_110000b8.zip


MJ Mohanaselvam Jothi Syncfusion Team March 9, 2021 03:18 PM UTC

  
Hi Sandip,

Thank you for your update.

Currently we are checking on your query and we will update you details on 10th March, 2021.

Regards,
Mohanaselvam J



HC Hemalatha Chiranjeevulu Syncfusion Team March 11, 2021 05:42 PM UTC

Hi Sandip,

Thank you for your patience.

We can reproduce reported logo missing issue in v18.4.0.46 using the given details. On further checking, we have found that the issue occurring element is grouped custom shapes in the Word document. DocIO doesn’t have support to preserve custom shapes in Word to PDF conversion. Currently, we have implemented to preserve custom shapes (DrawingML) in Word to PDF conversion and it is planned to include in our upcoming 2021 Volume 1 Main release which is expected to be available at the mid of March 2021.

We have ensured the given document in our custom shapes implementation and found other preservation problem. Please refer the below screenshot of the issue which we faced at our end:

 
 


Currently we are validating on this line preservation problem in the generated PDF. We will update you more details about this on 15th March, 2021.

Please let us know if you have any other questions.

Regards,
Hemalatha C 



MJ Mohanaselvam Jothi Syncfusion Team March 15, 2021 02:56 PM UTC

Hi Sandip,

Thank you for your patience.

We have validated the issue that we found after preserving custom shapes in the document. As we mentioned earlier, you can make use of our custom shapes feature once our 2021 Volume 1 Main release rolled out, which is expected to be available in March 2021.

We confirmed the issue “An extra line is preserved in the resultant PDF document while converting Word to PDF” as a defect in our product. We will include the fix for this issue in our weekly NuGet release, which will be available on March 30, 2021. 
 
Please use the below feedback link to track the status of the reported bug. 
Please let us know if you have any other questions.

Regards,
Mohanaselvam J 



LB Lokesh Baskar Syncfusion Team March 30, 2021 09:31 PM UTC

Hi Sandip, 

We are glad to announce that our Essential Studio 2021 Volume 1 release v19.1.0.54 is rolled out and is available for download under the following link. 
Lokesh B 


Marked as answer
Loader.
Up arrow icon