Is there a way to load this RadFixedDocument into a RadPdfViewer without writing the document to a file first and then loading it in the viewer?
Workaround:
You can achieve the desired functionality by exporting the RadFixedDocument to a MemoryStream instead of a file in the file system and then load it in the PdfViewer:
RadFixedDocument document = CreateRadFixedDocument();
PdfFormatProvider pdfFormatProvider = new PdfFormatProvider();
Stream ms = new MemoryStream();
pdfFormatProvider.Export(document, ms);
radPdfViewer1.LoadDocument(ms);
Is there a way to customize the box to request a signature?
Thanks in advance
I am using RadPDFViewer, i built a specific toolbar for manage the funcionalities of the viewer.
I didn´t found the any event when the current page is changed in viewer. I would like to show a label "Page NN of TT".
I found this "https://www.telerik.com/forums/page-changed-detected", but didn´t have this event in RadPDFViewer.
Whats the better solution for the raise event when the current page displayed is changed?
Can you help me ?!?
This is Unicode (UTF-16BE) encoding for the Adobe-GB1 character collection; contains mappings for all characters in the GB18030-2000 character set. Described on page 443 in Pdf Reference 1.7.
The events should provide information as to when a page is about to be rendered and when it is displayed in the control.
According to PDF format specification, there are three valid encoding name values (MacRomanEncoding, MacExpertEncoding and WinAnsiEncoding). There are documents that instead of skipping the optional Encoding property, are writing invalid /NULL name value in the font dictionary. Currently, in this invalid document scenario RadPdfViewer throws and catches Exception and this results in missing text content. We may handle this invalid document scenario by ignoring the invalid Encoding value.
Workaround: until the feature be implemented one can print each page individually respecting its orientation whether it is portrait or landscape public partial class Form1 : Form { public Form1() { InitializeComponent(); this.radPdfViewer1.LoadDocument(@"..\..\sample.pdf"); } private void radButton1_Click(object sender, EventArgs e) { RadPrintDocument doc = new RadPrintDocument(); doc.AssociatedObject = this.radPdfViewer1; for (int i = 0; i < this.radPdfViewer1.Document.Pages.Count; i++) { RadFixedPage page = this.radPdfViewer1.Document.Pages[i]; doc.CurrentPage = i; doc.PrinterSettings.PrintRange = PrintRange.CurrentPage; doc.Landscape = page.ActualWidth > page.ActualHeight; doc.Print(); } } }
Note: If you use the next button to navigate to the next search result, the user should be notified when the end of the document is reached as well. Workaround: public Form1() { InitializeComponent(); this.radPdfViewer1.LoadDocument(@"..\..\..\samplePdf.pdf"); //create a new button CommandBarButton findNext = new CommandBarButton(); findNext.Text = PdfViewerLocalizationProvider.CurrentProvider.GetLocalizedString(PdfViewerStringId.NavigatorFindNextButton); findNext.Click += findNext_Click; findNext.Image = this.radPdfViewerNavigator1.FindNextButton.Image; //hide the currently available button this.radPdfViewerNavigator1.DefaultStrip.Items.Add(findNext); this.radPdfViewerNavigator1.FindNextButton.Visibility = ElementVisibility.Collapsed; } private void findNext_Click(object sender, EventArgs e) { if (this.radPdfViewerNavigator1.SearchTextBox.Text != string.Empty) { if (this.radPdfViewerNavigator1.AssociatedViewer == null || this.radPdfViewerNavigator1.AssociatedViewer.Document == null) { return; } PropertyInfo internalDocumentPI = typeof(RadFixedDocument).GetProperty("InternalDocument", BindingFlags.NonPublic | BindingFlags.Instance); object internalDocument = internalDocumentPI.GetValue(this.radPdfViewerNavigator1.AssociatedViewer.Document, null); object textSearch = internalDocument.GetType().GetProperty("TextSearch", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(internalDocument, null); MethodInfo mi = textSearch.GetType().GetMethod("Find", BindingFlags.Public | BindingFlags.Instance); TextSearchOptions searchOptions = new TextSearchOptions(false); SearchResult searchResult = mi.Invoke(textSearch, new object[2] { this.radPdfViewerNavigator1.SearchTextBox.Text, searchOptions }) as SearchResult; if (searchResult.Result != null) { this.radPdfViewerNavigator1.AssociatedViewer.Select(searchResult); } else { RadMessageBox.Show("No matches"); } } }
http://docs.telerik.com/devtools/wpf/controls/radpdfviewer/document-model/exceptionhandling
Import documents that use this type of encryption. Currently, a handled NotSupportedEncryptionException with message "The encryption method with code 5 is not supported." is thrown while importing such a document.
1. Load file which is signed with digital signature 2. Scroll to the end of document - you will see that the signature is not visible.