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;
}
}