I am working on a Silverlight web application that creates PDF documents. We want our clients to print these PDF documents but we do not want them to see it or save it locally.
Is there a way to send PDF data directly to client's printer without opening it in client's browser?
Please advice.
No -- Silverlight 3 does not support printing natively.
You can usually get some things done in the browser using Javascript, but that won't let you directly send a PDF the way you're discribing.
It's possible to write a seperate app that lives on the client machine and then integrate with that... For an internal line-of-business app that could be a good solution, but the obvious drawback is that you're stepping outside of Silverlight's multi-platform bubble.
Here's an article that might be worth looking at: http://jonas.follesoe.no/PrintingInSilverlight2UsingCSSAndASPNETAJAX4.aspx (the comments are also interesting, and some of them talk about working with PDFs)
Update: Silverlight 4 now supports this.
No. Silverlight does not have access to any printer resources directly, only via javascript print functions.
Related
I created web application using ASP.NET CORE 2 and used DinkToPdf to create and download the PDF to target directory. It is working really well to create and save PDFs. Now I want to use server side and print the PDF to target printer in the office. I couldn't find any solution to do this. Please help me.
Are you looking to integrate this functionality into your software? If so, there are several PDF libraries on the market with printing capabilities, some more reliable and full-featured than others.
If you're looking for a Windows command line utility to print PDFs to a target printer, you may be interested in PDF2PRINT, which allows you to do exactly that, as well as set optional parameters like duplex, collation, custom page ranges, number of copies, etc.
For future reference, questions like these should be posted in the Software Recommendations forum.
I have a project that requires me to create a webpage that would allow users to fill-in information in a web page, create a pdf of the information( could be the whole HTML ), and email the pdf to someone.
I'm using c# and .Net. Does anyone know of a way to do this or could point me in the right direction.
easy stuff: you need to configure your SMTP to send emails. Then use ASPOSE. This program does exactly that: creates PDFs and joins them together.
Unfortunately, I have searched for a way to do this for myself and have not been able to find a way directly in .Net without the use of a 3rd party library.
Right now I am using a library called iTextSharp with pretty good success. http://sourceforge.net/projects/itextsharp/
Another one I have used in Classic ASP applications (that does have a .Net component, but is not free), that was really good is Web Super Goo's ABCPdf http://www.websupergoo.com/abcpdf-1.htm
Good luck.
I need to get some contact detail and print it to PDF. Is there any way to do this in Windows Phone 7?
Even if you create a PDF in your application, it will not be accessible by other apps or your computer. The solution is emailing that file. Thus, you should send the details to a server and get it converted to a PDF then download it on the phone or, the server may email it for you.
There are many web services which will do this for you. See this: http://blog.nitropdf.com/2008/01/free-online-web-services-to-create-view-share-and-edit-pdf-files/
There's a branch of the SharpPDF project called PdfSharp for WP7. It states that it is not fully featured. It may/may not provide you with enough functionality for what you need. I haven't personally looked at the library, so you may wish to download it and see what features it provides.
Other than that, one of the most common ways to generate a PDF document using C# is iTextSharp. This most likely uses advanced features in the .NET framework and probably won't recompile for the Windows Phone. You could code up your own converter service that could also dispatch the newly created PDF via email once done. The app would usually be hosted somewhere (on a server or in the cloud) and would be accessible via WCF.
I would like to develop an app for printing service in Windows Phone 7. In the app, the users can select file to print out. Is there any way to open docx, xlsx, etc. in WP7 programmatically? I know in iPhone the WebView supports to view many file types. Is there anything similar in WP7?
If you are looking to open the document in Office, try using the WebBrowserTask to navigate to the document. There's a good chance it will open with Office.
If you want to render the document yourself, you are very much out of luck. You could try navigating to the document in a WebBrowser control, but I don't think it's supported.
Besides, there are no printing APIs so there would be no way to print it. If this is an enterprise application (ie. internal to your company), you might consider writing a web service on a local server that can accept DOCX files and print them. You could then call that service from your app to print the docs.
You will not be able to open these types of files from the isolated storage. There is no way for third-party applications to launch the external application required for viewing these file types. All of the files which you have listed in your question are XML-based open source file formats. Depending on how much time you want to spend on this, you could write your own parser or possibly utilize an open-source or commercial one.
With C#, how can I print a PDF document (without any dialog boxes in the background) to an indicated printer?
I have used the following PDF library in the past to perform batch printing of PDF documents from a C# Windows Service.
http://www.quickpdflibrary.com/
It's a pretty decent library and if I remember correctly it only took a few lines of code to print the document. It worked very well and saved me a consider amount of time.
Also, the recommended link that discusses using DDE to launch a desktop application on a server to perform the printing is a bad idea. Adobe Reader probably doesn't support this and since it is a desktop application running in a windowless session you may run into problems with message boxes and dialog boxes. That solution just doesn't scale in my humble opinion.
here we go
Disclaimer: I work for Atalasoft
If you don't want to depend on Acrobat being on the server, you need to rasterize the PDF pages yourself and send them to the printer using the normal .NET printing API. We have a product that can rasterize PDF that uses the Foxit engine underneath. It deploys as a normal .NET assembly and doesn't require any other software to be installed.