Declined
Last Updated: 28 Jun 2019 14:11 by ADMIN
Naval
Created on: 07 Jun 2019 10:00
Category: RichTextBox
Type: Bug Report
0
XAML to PDF conversion issue - While opening converted pdf file Adobe Reader DC gives an error

Hi Telerik,

We are converting XAML content into PDF file with below code.

private byte[] Xaml2Pdf(string xamlContent)
{
	try
	{
		XamlFormatProvider xamlFormatProvider = new XamlFormatProvider();
		PdfFormatProvider pdfFormatProvider = new PdfFormatProvider();
		PdfExportSettings exportSettings = new PdfExportSettings();
		exportSettings.ContentsCompressionMode = PdfContentsCompressionMode.Automatic;
		exportSettings.ContentsDeflaterCompressionLevel = 9;
		exportSettings.DocumentInfo = new PdfDocumentInfo() { Producer = "ALIS", Author = "ALIS", Creator = "ALIS" };
		exportSettings.ImagesCompressionMode = PdfImagesCompressionMode.Automatic;
		exportSettings.ImagesDeflaterCompressionLevel = 9;
		pdfFormatProvider.ExportSettings = exportSettings;

		byte[] content = pdfFormatProvider.Export(xamlFormatProvider.Import(xamlContent));

		return content;
	}
	catch
	{
		throw;
	}
}
When we convert attached XAML content with above code it will gives an output pdf file but when we open pdf file into Adobe Reader DC it will display some error message before opening it.

Currently we are using 2016.2.905.45 version.

Previously when we was use 2016.1.302.45 version at that time we didn't notice same issue.

Please assist.

Thank you.
Attached Files:
4 comments
ADMIN
Ivan Ivanov
Posted on: 12 Jun 2019 16:31
Hello,

Please excuse me for the delayed reply. Indeed, the reported behavior seems to be quite similar to the one from the item that I shared in my previous post. To avoid confusion with existing subscribers of it, we decided to log a new issue. While the documents related to the original one seem to be fixed with the newest version, the one that you provided is still faulty. You can track our progress with the issue by subscribing to the public item.

Regards,
Ivan Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Naval
Posted on: 12 Jun 2019 11:08

Hello Telerik,

Can you please provide me the update for below mentioned issue.

ADMIN
Ivan Ivanov
Posted on: 07 Jun 2019 15:08
Hi Naval,

The error seems to be caused by some of the exported pictures (the lines), while using the ImagesDeflaterCompressionLevel setting. I found a logged issue in our system that describes the same behavior. "PdfFormatProvider: Invalid document is generated when exporting PNG image SMask with non-default ImagesDeflaterCompressionLevel export setting". We will need some more time to investigate this scenario further and decide whether we shall reopen the issue, or log a new one. I will write back on Monday to share the details with you.

Regards,
Ivan Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
ADMIN
Ivan Ivanov
Posted on: 07 Jun 2019 15:08
Hi Naval,

The error seems to be caused by some of the exported pictures (the lines), while using the ImagesDeflaterCompressionLevel setting. I found a logged issue in our system that describes the same behavior. "PdfFormatProvider: Invalid document is generated when exporting PNG image SMask with non-default ImagesDeflaterCompressionLevel export setting". We will need some more time to investigate this scenario further and decide whether we shall reopen the issue, or log a new one. I will write back on Monday to share the details with you.

Regards,
Ivan Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.