I am looking for a free open source .Net based (prefer C#) pdf driver. Any idea where I can download one?
Pdf Creator
PDFCreator easily creates PDFs from any Windows program. Use it like a printer in Word, StarCalc or any other Windows application.
If you need to use created PDF file inside of your C# application, then the easiest way is to generate PDF inside this application. Then you don't need to monitor a temp folder for a new file created.
To generate PDF inside of your application you will need a PDF-generating library for C#.
For example, PDFFlow library. You can generate all the elements of PDF document (text element, paragraph, image, inline image, line, table, page number, header/footer, etc...), so you can construct "any kind of document", as you said.
Hope, this idea will help.
Related
im needing to create a form in my C# project that just allows the user to view the pdf.
i have a way to open the pdf and read it but i need to disable features like printing, saving, highlighting, copy/pasting while maintaining the ability to search in the document
they should really just be able to open the document, read it,search for words in the document, close it
any help would be great
thanks in advanced
You could use Ghostscript to convert PDF to images and then show the images on your form or you could rasterize your PDF directly to the screen.
To use Ghostscript from .NET you can take a look at the Ghostscript.NET library (managed wrapper around the Ghostscript library).
Ghostscript Viewer C# sample that rasterizes PDF directly to the screen can be found here: https://github.com/jhabjan/Ghostscript.NET/tree/master/Ghostscript.NET.Viewer
To search for the text inside the pdf you can use iTextSharp
(Disclaimer I worked on this component at Software Siglo XXI)
If you don't want to mess with Ghostscript API and need a quick working solution to visualise the documents, you could use ImageZoom Viewer .NET. It's available for both 32 and 64 bit and is very cheap and effective. I'd recommend you to try it since it's a very fancy and fast. You can browse, scroll and print the pages from the viewer.
You can take a look here: http://softwaresigloxxi.com/ImageZoom.html
This is for quick browsing and reading. Then, when you want to use text operations, you could let the user to use Adobe Reader, launching the PDF from there.
I have an ASP.NET WebForms application (written in C#) that allows users to upload files using the FileUpload control.
What'd be great is if I could automatically generate thumbnails from files. Images such as JPG/PNG are trivial of course, but users will often upload .DOC and .PDF files - is there a way I can essentially convert .DOC and .PDF files to images so I can get a thumbnail?
Thanks!
You can use GhostScriptWrapper for generating image thumbnails directly from pdf.You can get ghostScriptWrapper from GitHub or you can include ghostscript.dll from nuget package manager solution.
On paper the most hopeful approach would be to do so server side. So, if the file were uploaded, the server could generate a preview image.
On Windows, there would be a few options.
a) Windows Shell has a way to do it. The path is dangerous though.
b) https://filepreviews.io/ Is a service that does it, but they charge.
c) box is another service that does it.
Now on Linux, or even, perhaps, a Linux in a Windows subsystem, could do it with some command line utilities.
a) Convert the doc to pdf:
Convert DOC to PDF
b) Then, get a bitmap of the first page of the pdf, use ghostscript. ghostscript also exists for .NET and Windows.
Bitmap of PDF First Page
For PDf you can try ABCPDF from websupergoo. With that you should be able to generate a thumbnail,
Documentation link for creating a PNG from a PDF. http://www.websupergoo.com/helppdf8net/source/4-examples/19-rendering.htm
also for Doc, it is a little more complex, you are going to have to install the office application on the server that host the apps and from there manipulate the image.
Look at this article. It lets you extract the thumbnail image that Windows Explorer uses for Office documents and regular images.
http://msdn.microsoft.com/en-us/library/aa289172.aspx
I am working in a desktop project in C# with .net. This project has a function that generates some information and i would like to print this generated info as a document (may be .doc, .pdf, etc). Summarizing, i need:
Get the data generated by a function;
Generate a document containing these information structured with title, texts and tables (things that every document have);
Print it;
I thought generating an .html file (because it's simple to generate this kind of file), but i couldn't find a way to print it directly from my program.
Which extension of file would you recommend to insert this kind of information and print it directly from my program??
Thanks in advance.
Here's an easy way that uses a RichTextBox
http://www.codeproject.com/KB/printing/simpleprintingcs.aspx
It's not trivial to print a PDF, HTML, or a doc unless you are going to use external programs or third-party libraries. ImageMagick/GhostScript could help you print PDF.
Disclaimer: I work at Atalasoft -- If you are willing to use commercial software, my company makes PDF rendering components for .NET. There are companies that do the same for HTML.
Directly? Open printer port...
Or you can do it with framework classes:
How to: Print with a WebBrowser Control
http://msdn.microsoft.com/en-us/library/b0wes9a3.aspx
My web application displays MathML embedded in HTML using the MathPlayer plugin. I need to output to PDF. I have PDF components (Dynamic PDF, ABCpdf), but they don't know how to parse the MathML, of course.
Is there a library that can help me translate the MathML to an image or something that I can feed to the PDF components on the fly in the web application?
Design Science has a command line Windows executable (also available as a DLL) that will convert all of the MathML in a document to EPS for use in PDF. It's the Document Composer, which is part of the MathFlow SDK. Contact us if you're interested in more info or an evaluation.
FYI, I have also found another PDF component that supports MathML called AHFormatter. I have not tried it, but it apparently works very well.
I'm not sure if this is possible but as I was looking for a way to convert docx -> pdf serverside (Aspose is a bit expensive), I wondered if I could do this by printing my document to a Pdf Printer.
Altho, I would need a decent one then, as it shouldn't show dialogs when trying to print ofc.
Does anyone know if:
This is possible
There exists such a printer which can be easily used in a WCF Service
Thanks
Try pdfcreator.
PDFCreator is a free tool to create PDF files from nearly any Windows application.
Key Features:
Create PDFs from any program that is able to print
...
Terminal Server: PDFCreator also runs on Terminal Servers without problems
If you can read DOCX content and print from your WCF service, the pdfcreator printer driver will generate PDF from anything.