display PDF file into WinForms - winforms

I am working on a C# .Net Windows application. Here I create report using Infragistics.Documents.Report and export to .pdf & .xps format. Here I want to bringthose 2 files(.pdf & .xps) into WinForms and display. How to bring saved .pdf & .xps file into win forms.

Put a web browser control in your form and navigate it to the PDF / XPS file. Providing a PDF Reader is installed on your system it should work great.

You can also use:
using System.Diagnostics;
...
Process.Start("Foo.pdf");
This is equivalent to the user double-clicking on a PDF file and will launch whatever PDF reader is installed on the system.

http://blog.paritor.com/SimonBlog_Archive.html
Article, that you need, named "Integrating WPF with Windows Forms". DocumentViewer control is the part of WPF, but you still can embed WPF into your app.

Related

WPF NET5 ClickOnce FileAssociation Get file name command line args

In WPF .NET5 ClickOnce publish I have added an FileAssociation
i.e:
<FileAssociation Include=".text">
<Visible>false</Visible>
<Description>prosjekt text</Description>
<Progid>text</Progid>
<DefaultIcon>icon.ico</DefaultIcon>
</FileAssociation>
When clicking a file in FileExplorer my app launches fine.
Now I need the filepath for the file. Im not able to retrieve the file name in the application. Looking at threads on WPF, clickonce .net framework, they refer to doing this: AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData[0]
But this is not available in .net5? Or maybe im missing a package?
Im not getting the file name via Environment.GetCommandLineArgs() or StartupEventArgs either.

I am unable to drag file from my WPF application to Outlook 2013 Email

I have implemented drag and drop in my WPF application. It is working fine with Explorer. It is copying files in both direction.
But the issue is with Outlook. I am unable to share files with Outlook 2013 or later version. If we drag file from Explorer to new Email in Outlook then it add to Attachments of the email but while dragging from my Application, I can't add it.
But yes, If some file is already added and we drag a file from my WPF application and drop to "Attached: " field area then it copies.
I am using Windows 10 and Outlook 2013. I have researched many websites but in all places they are showing how to drag-n-drop Outlook Emails into WPF or Outlook Email Attachments into WPF - which is not useful for me.
Thanks in Advance.

Aspose PDF viewer

I am using the Aspose PDF tools and have successfully got it to print the pdf which is great, but ideally I want to be able to add a wpf control to display this as well.
I would have assumed that the PdfViewer class would have something, but I can't tell.
So far I have needed to use a different control MoonPdfPanel which is annoying as I would have preferred 1 tool to do both jobs.
Does anyone know of a control I can use to hook into the aspose?
Thanks
We have developed an HTML5 PDF Editor application using Aspose.Pdf for .NET API which you can use in your application as a PDF Viewer as well. You can get the details and complete source code here. You can use the source code to edit the viewer as per your requirement.
P.S. I am working as social media developer at Aspose.
Well, if you are interesting in viewing the PDF file, you may convert the file to HTML and display it using an IFrame in your application. I have developed a sample application which performs different operations including viewing a PDF file in IFrame. Download it and try it at your end. Another option is that you can convert the PDF file to images and display in Imageviewer in your application (Code is available in the above application).
P.S. I am working as social media developer at Aspose.

Silverlight 4: Upload file control?

I'm looking for a simple control that will allow the user to upload an image (or any file, really.) However, I'm not seeing it in the VS 2010 control toolbox. Is there something I'm overlooking? What's the idiomatic way to do file upload?
I am developing a Silverlight app hosted in a ASP.NET page from Windows Azure.
Thanks. I'm new to Silverlight.
The most widely used file upload control suggested by Tim Huer is the sl file uploader. It allows you uploading through wcf or asp.net handler. It supports multiple files, a lite version for single file uploads.
I have developed a control that should help you in your effort: Parallel upload to Azure via Silverlight Control

How to copy image of a chart from Silverlight application to clipboard?

I have a Silverlight 3.0 applications with some custom graphics and some charts. I need to find the best way to transfer these graphics to a PowerPoint presentation.
I've read that Silverlight 4.0 offers a Clipboard API, but there is only support for Unicode-text, not images.
Is there a way to achieve this task without forcing users to manually PrtSc and than paste to other applicatons?
There's no simple way to do this in SL3. My recommendation would be to use a WriteableBitmap and save that to IsolatedStorage and then prompt the user with a FileSave Dialog to save to their box (and then they would have to put it in PowerPoint). The only problem with that Dialog in SL3 is that it doesn't allow you to set the extention type so they would need to type in the PNG or JPG extention. Both this and the PrtSc, Ctrl+P require multi-step user action and that is always a point of failure.
In SL4 there are more choices - you don't even need the Clipboard in an SLOOB. You can just use AutomationFactory to automate PowerPoint.
If True = HtmlPage.IsPopupWindowAllowed Then
HtmlPage.PopupWindow(New Uri("http://www.yourdomain.com/chartgenerator.ashx?param1=value1&param2=value2"), "new", options)
End If
chartgenerator.aspx can either display an image:
' tell the browser to display inline
context.Response.AddHeader("Content-Disposition", "inline; filename=" & FilenameWithExt)
or display an Open, Save, Cancel dialog:
' tell the browser to save rather than display inline
context.Response.AddHeader("Content-Disposition", "attachment; filename=" & FilenameWithExt)
quoted from http://vbcity.com/blogs/mike-mcintyre/archive/2010/02/28/silverlight-3-pop-up-new-browser-window.aspx

Resources