I have open and displayed PDF document using Telerik RadPDFViewer WPF application, and i was able to do certain functions like Open, Save, print, Rotate, Zoom, Navigations.
But i want to append a page to the existing document that was opened using RadPDFViewer and also need to upload multiple PDFfiles and display at a time
Please suggest me on this.
Thanks,
Bindu
30 Answers, 1 is accepted
Currently you cannot append pages to the document opened in RadPdfViewer. We will consider implementing such functionality in some of the future releases.
If you have additional questions please do not hesitate to contact us again.
Regards,
Deyan
the Telerik team
I was using Radgridview and binding data from XML, I want inline delete functionality for each record in the grid and it should delete in XML as well
Thanks
Do RadPDFViewer have the functionality of Re-Ordering of pages
Thanks in advance
Let me go straight to your questions:
1. You can place a button in the CellTemplate of GridViewColumn which executes a delete command. Please check this online demo for a reference. Also, you can check the Setting CellTemplate and CellEditTemplate help article which demonstrates how to set GridViewColumn's CellTemplate.
2. PDF documents have fixed layout and each object in a document has its specific place. That being said, RadPdfViewer is not capable of editing documents in any way, including reordering its pages.
Regards,
Petya
Telerik
I was using RadPDFViewer, fine working with save option in toolbar, but i need to save it in Application folder which saves default without opening opendialog.
Thanks in Advance
I'm presuming you are talking about the Custom save command demo in our SDK examples, could you confirm that? This example contains the code that executes the saving of the PDF file in its CustomSaveCommand class where the Execute method shows a SaveFileDialog. If you want to change that, you could simply save the file to the desired location.
public
override
void
Execute(
object
parameter)
{
using
(Stream output =
new
FileStream(
"Sample.pdf"
, FileMode.OpenOrCreate))
{
documentStream.Seek(0, SeekOrigin.Begin);
documentStream.CopyTo(output);
documentStream.Flush();
output.Flush();
}
}
I hope this helps.
Regards,
Petya
Telerik
Thanks for the reply,
Onclick save button i need to pass 'Filename' from the textbox entered, for the document that i was saving in the desired location.
for example: savefiledialog.Filename=????;
Thanks in advance
Bindu
You can check the documentation of SaveFileDialog for more information on the topic, but generally the dialog has InitialDirectory and FileName properties that allow you to specify where you want to save your file.
SaveFileDialog saveDialog =
new
SaveFileDialog();
saveDialog.Filter =
"PDF File|*.pdf"
;
saveDialog.InitialDirectory =
"c:\\temp"
;
saveDialog.FileName =
"MySample"
;
bool
? dialogResult = saveDialog.ShowDialog();
if
(dialogResult ==
true
)
{
}
Regards,
Petya
Telerik
Thank you for the support
Thanks for your support
My issue here is i need to pass a value to savefiledialog, i got the solution by passing through 'commandparameter'. Once again thanks for your support
Bindu
Adding several PDF documents to the same stream will not merge them together and the behavior you are experiencing is expected. If you want to combine PDFs, at this point the only solution I can suggest is through the RadPdfProcessing library. You can import the two documents and copy the pages and destinations from one of them to the other.
while
(sourceDocument.Destinations.Count > 0) {
Destination destination = sourceDocument.Destinations(0);
sourceDocument.Dest
inations.Remove(destination);
targetDocument.Destinations.Add(destination);
}
while
(sourceDocument.Pages.Count > 0) {
RadFixedPage page = sourceDocument.Pages(0);
sourceDocument.Pages.Remove(page);
targetDocument.Pages.Add(page);
}
Please note that while both RadPdfViewer and RadPdfProcessing use RadFixedDocument as the base of their model, importing a document with the processing library and passing the RadFixedDocument instance to RadPdfViewer would not work. Instead, you can export the combined PDF to a stream and import it back in RadPdfViewer.
Regards,
Petya
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
I want to view multiple PDF documents one after the other using RADPDFViewer wpf windows application
Thanks
Bindu
RadPdfViewer allows you to show a single PDF document, but you could try merging several documents together. Are you having troubles implementing the suggestion from my previous post? Once you've merged the documents with the PdfProcessing library you can export them to PDF and show that document in RadPdfViewer.
Let me know if you have any concrete question regarding this.
Regards,
Petya
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
If i have array[5] i.e 5 pdf documents and for every document i need to create RADPDFViewer, so that i should view all the 5 pdf documents one after the other
Thanks in Advance
Bindu
The thing what i need is
If i have array[5] i.e 5 pdf documents and for every document should have its annotations for each, so that i should view all the 5 pdf documents one after the other with seperate Annotations for each document.
I don't need to merge PDF documents but i need to show them individually with their annotations.
For this i thought of working in a way of creating RADPDFViewer dynamically, so that for every pdf it will create PDFViewer as well as its annotations.
So for this i was trying to create RadPDFViewer dynamically from code behind, can you please help me on this
Thanks in Advance
Bindu
Can anyone help me out on this, is there any other approach
Thanks,
Bindu
RadPdfViewer is an UI control and if you want to show a PDF document in it, you need to make sure the control is in the visual tree. There are several approaches you could adopt in this regard, one of them being to dynamically create the control, assign a document to it and add it to the root of the window. There are plenty of discussions on the topic in internet, for example in this StackOverfow thread and here is a simple example.
If your window contains a Grid definition and you want to place the RadPdfViewer in the first row of the grid, give the Grid control a name in the XAML.
<
Grid
Name
=
"root"
>
RadPdfViewer pdfViewer =
new
RadPdfViewer();
pdfViewer.DocumentSource =
new
PdfDocumentSource(str);
this
.root.Children.Add(pdfViewer);
Grid.SetRow(pdfViewer, 1);
An alternative approach is to create a separate window in your application that contains a RadPdfViewer. Every time you need to show a PDF document just instantiate the window and call its Show() method. There is an example of that approach in this MSDN tutorial.
I hope this helps.
Regards,
Petya
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Thanks,
Bindu
Are you having troubles binding the DocumentSource property of the control? You can check this section of the Showing a File article for a reference on the approach. If you are experiencing concrete issues with this, let me know.
Regards,
Petya
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Using usercontrol and calling the usercontrol from mainwindow, as i need to open and view multiple PDF documents.
Now I need to save PDF document from RADPDFViewer codebehind without using any inbuilt Commands
Thanks in Advance
Bindu
RadPdfViewer is a component allowing to show PDF documents. The only way to save the document shown in the control is by using an approach similar to the demo discussed previously in this thread. This, however, requires to use the custom OpenCommand so that the stream to the document can be preserved in memory and I am unable to advise you on another approach.
Regards,
Petya
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
I have opened a PDF file and rotated the document, but after saving the document as in the previous discussion the updated rotated document is not saved instead the file i have opened is saving as it is without rotating.
Identified that the above SaveCommand works with the stream that is passed while opening, please let me know the possibility of passing the updated document to the stream and saving the updated document.
Thanks in advance,
Bindu
private Stream documentStream;
private void RadButtonsave_Click(object sender, RoutedEventArgs e)
{
var provider = new PdfFormatProvider();
MemoryStream memoryStream = new MemoryStream();
memoryStream.Flush();
provider.Export(this.pdfViewer.Document, memoryStream);
this.pdfViewer.DocumentSource = new PdfDocumentSource(memoryStream);
this.documentStream = memoryStream;
SaveFileDialog saveFileDialog = new SaveFileDialog();
if (saveFileDialog.ShowDialog() == true)
{
using (Stream saveStream = saveFileDialog.OpenFile())
{
documentStream.Seek(0, SeekOrigin.Begin);
documentStream.CopyTo(saveStream);
documentStream.Flush();
saveStream.Flush();
}
}
}
But the problem here i was facing is, it is saving but not displaying content in the saved document, it is also displaying no.of pages and thumbnails.
I think content is not binding in memory stream.
Can anyone please help me out in this
Thanks
Bindu
private Stream documentStream;
private void RadButtonsave_Click(object sender, RoutedEventArgs e)
{
var provider = new PdfFormatProvider();
MemoryStream memoryStream = new MemoryStream();
memoryStream.Flush();
provider.Export(this.pdfViewer.Document, memoryStream);
this.pdfViewer.DocumentSource = new PdfDocumentSource(memoryStream);
this.documentStream = memoryStream;
SaveFileDialog saveFileDialog = new SaveFileDialog();
if (saveFileDialog.ShowDialog() == true)
{
using (Stream saveStream = saveFileDialog.OpenFile())
{
documentStream.Seek(0, SeekOrigin.Begin);
documentStream.CopyTo(saveStream);
documentStream.Flush();
saveStream.Flush();
}
}
}
But the problem here i was facing is, it is saving but not displaying content in the saved document, it is also displaying no.of pages and thumbnails without content.
I think content is not binding in memory stream.
Can anyone please help me out in this
Like I mentioned before, RadPdfViewer is an UI control that allows showing of PDF files. All features the control exposes are related to the way the document is shown and cannot be preserved. The save command you are working with is merely a workaround that allows users to save the PDF to a file, but as you noticed this PDF is the same one imported in the control and preserved in a stream. That said, there isn't a way for you to save the file rotated or with any other modifications.
Regards,
Petya
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
I want to use the SDK samples browser to get some ideas on how to display PDF byte array from SQL Server using RadPDFViewer, but the install fails. Can I get the executable from an alternate location?
Install log is attached.
I noticed you have opened another forum thread with same questions. I have already replied you there - could you please check my answer and I will ask you to continue the conversation in the other thread.
Regards,
Kalin
Telerik by Progress