Converting and Displaying a LaTeX Document within a WPF Application - c#

I have a couple questions related to using LaTeX within a C#/WPF application.
The application I'm developing writes reports using LaTeX. I'll then need to convert those LaTeX documents into something I can display to the screen. This is where my first question comes in: I know I have two choices for converting the LaTeX document -- conversion to .dvi or conversion to .pdf -- what I wonder is which format would be the best speed-wise and for displaying? I'm unsure how to display a .pdf or a .dvi file within a WPF application -- is there some way to put them into a Canvas control or any other WPF control?
Thanks for your time and help!

You can easily display pdf's using the acrobat control (or if you're feeling lazy, with the Internet Explorer control). Just put one in a Winform Hosting Control and call its loading method.

Related

Opening Word (.docx) files on a Windows Form C#

I'm trying to make my program have the ability to display a Microsoft Word file on a form but not having any luck in doing so. I want to be able to open the file and display it on the form as a Read-Only. So basically just display it's contents. Various users on the web have recommended displaying files in the WebBrowser control (under toolbox). I have tried this but failed to get it working. My end goal is to be able to annotate on top of the web browser (or something of similar manner) and subsequently save the annotations along with the opened file.
I'm not that experienced in the C# language too so any help on how to achieve my problem would be greatly appreciated.
You need a DOCX viewer control. My company recently gave away our multi-format WinForms viewer control as a free product - XtremeDocumentStudio .NET Free. It can display DOCX and is available on NuGet. It does not require a Web Browser control for embedding an online viewer or Word software installed locally.
http://www.nuget.org/packages/XtremeDocumentStudio.NETFree/
There are some good links that might help you.
First, you will find a closely related or similar question here
And in that conversation someone posted the following link which is about how to build a user control for displaying Word documents in a webbrowser control.
I also found another article here about how to integrate Excel in a Windows Form application using WebBrowser. But Excel is used as an example and you may be able to adapt it to Word.

Editing parts of document in WPF to print

I am making WPF application in C#.
I want to make users to fill up some fields in program and after clicking Save it will save document (XPS or PDF) from template with filled fields.
I started learning Net and C# about 2 weeks ago and don't know what is the best way in this application to make a filled document from template and user input.
You can use Report Viewer Control for that. It will allow you to create a template in .rdlc format and then fill in parameters during run-time.
Check out official page here

How do I print a text file to the default printer a line at a time in WPF / C#?

This seemed such a simple task until I put all the requirements in my question together. In fact it's an upgrade of a Visual Basic 6 program so I know the methodology is sound (although I'm open to any alternative suggestions).
I am a long-time programmer (30+ years) but new to WPF and C#. I have a plain-text file containing some placeholders, e.g. {StockCode}, and my program will read the file a line at a time and substitute values from a selected row in a WPF (4.5) DataGrid for any placeholders before sending that line to the printer. I don't want a Printer Settings dialog to appear as the output will always go to the default printer.
Through much reading on the web I found several references to Microsoft's RawPrinterHelper class at http://support.microsoft.com/kb/322091 but upon trying to implement that I found it appeared to be geared towards Windows Forms (it is a 2006 article after all). I also found reference to PrinterSettings.IsDefaultPrinter but again that appears to be old functionality.
Further reading indicated I should be using System.Printing for WPF but that seems to point to the PrintDialog Class and PrintDocument Method which are contrary to my requirements. It did occur to me as I was typing this that a workaround would be to read the text file and write the contents with substituted values out to a temporary text file and then print that, but I'm sure there's a way to do what I want that I'm just not seeing.
Thanks
Wayne Ivory

Quick & Easy PDF Viewer Ideas

This question has been asked several times but my situation is a little different.
I have a web application written in C# where I get a string value passed to this page I'm working on. This string value represents a filename of a PDF file I need to display on this page. I'm supposed to have a left panel where I have some information displayed, and a right panel showing the contents of a PDF file. I'm using a simple table here to separate the panels. All PCs should already have Acrobat Reader installed.
My question is simple. How can I display the contents of the PDF file within this table? I don't need anything fancy. It has to be free and simple enough for a newbie like me to set up. It could even be written in jQuery/AJAX, if there even is a way.
I've looked at a Webbrowser control within an ASP.NET page, but it looks way too complicated for a simple viewer. I looked at Webparts, but I'm not sure if that's doable in a non-Sharepoint environment. Suggestions?
Have you tried the object tag? More ideas are here Make PDF display inline instead of separate Acrobat Reader window

How to highlight text in Pdf Winforms C#

I have a pdf file which I want to open in a Windows Forms Application and perform following tasks-
View the pdf document
Zoom +/- document
Search Text
Highlight a specific text
Show it in a listbox/dropdown
select those words and highlight in pdf
Remove selection/Highlight.
I have tried using certain libraries like pdfSharp/iTextSharp even Acrobat Reader OCX control.
Its really bugging me..is there any help??
I'd suggest looking at some means of converting the PDF if you don't have a direct need to edit it. Even then, it may be easier to convert to a different form, make changes, and then convert back. PDF is a form of PostScript, which makes it powerful, but also makes it a mess to deal with and my personal preference is to skip that headache. Not always avoidable (had a lot of fun creating Thai support in PDF print#home ticket creation once without bloating the document beyond unusable), but highly recommended where possible.
Anyways, there are a variety of PDF conversion libraries out there, some of which may be available for .NET. Worst case, you may need to create a managed C++ layer to allow your C# code to access them.
Doesn't acrobat reader OCX already have all those features ? What exactly doesnt the OCX do that you need to do in your code ?
You might try contacting Adobe and getting their full SDK for PDF. It might have controls which you can use to solve your problem.
Come to think of it , is there even an SDK for PDF from Adobe ?
You have not mentioned your preference of using Free or Commercial PDF Viewer option. If you are open to use Commercial PSF viewer, you may evaluate SyncFusion PDF Viewer control, Telerik PDF Viewer, Dynamic PDF Viewer or TallComponents. I have checked feature set and all seem to have features you are looking for. I do not represent or promote any of these SDKs, I have used TallComponents and Dynamic PDF for PDF manipulation and both have excellent support, I would say PDF Veterans in .NET space.

Categories