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;
}
}
Adding bookmarks with the same name programmatically always returns the first one in case use attempts to navigate to it using the Bookmarks dialog.
Workaround: Remove the bookmark before adding a new one with the very same name.
If I setup the richtextbox content through the UI as shown in P1.png and try to restore it by pasting the generated html, I get instead P2.png. Expected to be the same.
I attached the sample project. We're using the recommended settings to use the same html in telerik reports, but can't find the reference on your site, it used on the on this link http://docs.telerik.com/devtools/wpf/controls/radrichtextbox/import-export/features-import-export-settings#htmlformatprovider
Finding text with regex for the last paragraph is not possible. This is caused by the fact that the search treats the last paragraph symbol as the last paragraph.
htmlProvider.ExportSettings.StylesExportMode = StylesExportMode.Classes;
Nested ol/ul list should be inside a <li> element of the list in which it is nested. For example:
<ul>
htmlProvider.ExportSettings.StylesExportMode = StylesExportMode.Inline;
With a picture of original size like this : width 2 800 and Height 1376. On the screen the picture is around 470 by 230. If I go to the Image Editor, it shows me the picture size itself but not the area size used by the picture. It is a good thing to have the original picture's dimension but we work with the dimension used in the document. So, could you do something to resize the picture used in the document.
In my samples, you'll see my picture in a document (ie1), what I see when I go in the Image Editor (ie2) and, when I go to the Resize section (ie3). Suggestion, put the original image's dimension on the top of the right corner in the resize section. The width and Height should show the dimension in the document.
Thanks a lot,