Hello all,
I would like to hear any suggestions how to export the silverlight ArcGIS datagrid to Adobe PDF file. Thanks for your inputs.
What I did is : downloaded silverPDF.dll, it worked for me.
What I did is as the following, it mighe not a good way, but it really solved my problems.
#1. Create a grid or panel to hold the data:
<ScrollViewer x:Name="ImageScrollviewer" Visibility="Collapsed" Width="2" Height="2" HorizontalScrollBarVisibility="Auto" HorizontalAlignment="Left" VerticalAlignment="Bottom" VerticalScrollBarVisibility="Auto">
<Image x:Name="TestPdf" /> or <Stackpanel /> or <Grid /> you have to customize here according to the print page you like </ScrollViewer>
Since this scrollviewer's size is small, they are under some other controls, just set visibility to visble when you decide to convert to pdf or image. It will not affect your interfacce.
#2. convert "TestPdf" : WriteableBitmap bitmap = new WriteableBitmap(TestPdf, new TranslateTransform()) ......
#3. Use SilverPDF : PdfDocument pdfDoc = new PdfDocument();
ExportToPdf.AddPdfMapPage(bitmap, pdfDoc);
you can add as many pages on the same pdf doc.
Hope it helps.
Actually I used SilverPDF.dll and ESRI print sample together for my work, I can export the map ( cross domain resources, graphics layers) and query result together as PDF, if you like, I can extract some code as a complied sample for you , but probably the size will be too big to post here.
I posted my issues couple of week ago to looking for helps from ArcGIS API for Silverlight expertise, but still waiting for detailed solutions. I am newbie to work on ArcGIS API for Silverlight, so I am still learning on ArcGIS. What I need help to export the data in QueryNoMap example(http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#QueryWithoutMap) to PDF and Excel. I could not find any similar codes to get them done. If possible please send the codes to my personal email at avt2K8@gmail.com. I really appreciate it. Thanks for experience sharing.
Sorry, I could not get any chance to extract the code as a sample application for you today, but I put some code in a zip file, please see if it can give you some clue to work out.
Again, I used ESRI print sample and SilverPDF.dll.