Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I'm looking for a library that I can use in a C# windows application for comparing PDF files. There are a lot of tools that I have seen for doing page-wise pdf comparison (e.g., http://www.inetsoftware.de/other-products/pdf-content-comparer). However, I want content-wise comparison. That means that if content is added or removed that will cause everything after the change to be shiffted, then I do not want the shifted content to be considered as changed.
One option is to extract the text from the pdf files and then doing a text comparison using an algorithm like the one proposed by Eugene W. Myers in his paper "An O(ND) Difference Algorithm and its Variation". However, I wonder if there is a tool or library that I can use in C# to do this? Ideally, the tool will show the entire original document and highlight the changes. The tool will also detect other content changes like image changes.
Thanks.
A commercial option is DocsCorp compareDocs SDK (also known as DocuComp) http://www.docscorp.com/public/products/publicProductsDocuCompServer.cfm
It is a content based comparison solution. For example shifting of content due to insertion of a new paragraph will not cause all subsequent text to be considered 'changed'. The inserted paragraph will be marked as 'inserted' while the subsequent text will still be considered 'same'.
PDF to PDF comparison with output as single PDF. Changes are shown as annotations (insertions shown as underlined text, deletes are represented by PDF comments (yellow sticky notes) anchored to the point the deletion took place). Output can be a single PDF illustrating the changes. This is based on the modified PDF OR it can show a side by side view representing both PDF's in one PDF.
The comparison is text based only. It does not currently attempt to show changes in images or other graphical elements in PDF's.
For full disclosure I am employed and part own this company. My position is R&D VP.
Regards
Shane
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 days ago.
Improve this question
I would like to ask for your advice. I need a converter that will create an A4 PDF documents from HTML - I need it to be possible to define the margins of the document and I need the css rendering to work - (css code defined in HTML string). I don't need to save anything to a file - I need a converter to which I send html as a string and it returns a pdf as byte array. My requirement is for it to work as fast as possible - to be able to convert 5000 html strings to pdf documents - each one or two-page long, in a reasonable time. I need the converter to work with a C# ASP .NET Core application.
So far I have tried these converters:
Tuespechkin
Dink
Both work well but very slowly. The convert method takes a very long time. Unfortunately it can't even be called in parallel, even if I create multiple threads the method is always executed serially.
HtmlRenderer.PdfSharp
It works very fast (several times faster than tuespechkin and dink) and is executed in parallel, but the rendered pdf looks bad - some important css styles are ignored and even if I choose the A4 format - some text is beyond the edge of the document.
I also read this entire thread but found nothing helpful to solve my problem: Convert HTML to PDF in .NET
Thanks for every reply
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Does the anyone know a .Net component to convert PDF to Word or RTF programatically? I don't want to use OCR and Adobe dependent solutions.
I tried several libraries:
PDF Focus .NET: https://sautinsoft.com/products/pdf-focus/index.php
Aspose.PDF: https://products.aspose.com/pdf/net
Gembox: https://www.gemboxsoftware.com/document
Spire.PDF: https://www.e-iceblue.com/Introduce/pdf-for-net-introduce.html
considered also using Word via COM automation to open and save to pdf programmatically.
Among all of them I liked PDF Focus .NET best of all, and I will explain why:
They try to keep the structure of the document EDITABLE, so that
when I will try to continue editing the text, the paragraph will be
smoothly prolonged. Other libraries are trying to do a
"minimalistic" approach by inserting absolute positioned shapes, so
that if you continue editing the text, it will overlap with the next
piece of text.
They do all their best to recognize tables, so
that tables in the output document will be REAL TABLES, but not a
collection of shapes and texts with absolute positioning (as
produced by other libraries).
A customer of ours is evaluating now different libraries, and I will recommend PDF Focus .NET first of all.
P.S. I AM NOT INVOLVED IN ANY KIND OF RELATIONSHIP WITH THIS SOFTWARE PRODUCER. As a former .NET developer I simply see a high quality components which really work fine.
Use PDF Focus.
Nice and easy.
EDIT: And also
How to convert DOC into other formats using C#
http://dotnetf1.blogspot.com/2008/07/convert-word-doc-into-pdf-using-c-code.html
You need something like GemBox.Document. It's a simple .NET component that enables you to manipulate and convert all kinds of document files.
You should have read this: C# and PDF. There are methods to convert, like beforementioned PDF Focus but be warned: it is buggy, and crashy process. PDF is not intended to be PC-readable.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I have been tasked with evaluating our current system that we use for creating and outputing reports.
Currently we are using Crystal Reports 2008, (I know that this is and old version.), which has a custom commandline app that we wrote in C# to execute the report for a given parameter passed through the command line.
We like Crystal becuase it's easy to setup and design the report. It's also easy to print and create a PDF file from crystal using our custom commandline program.
One of the problems/complaints that we have is that Crystal does not appear to have a method that will allow us to create a PDF file with a vector images, such as our company logo. Crystal Reports always converts an image into a bitmap. When the PDF is printed, the results are less than flattering, and the PDF file size is increased.
Does anyone have any recomendadtions for a reporting product that we should consider?
iTextSharp supports importing WMF as vector image. Maybe other formats too.
See sample here. N.B.: it seems, it's a bit outdated... you'll need to replace 'getInstance' with 'GetInstance'.
www.hagridsolutions.com/xtraction
Offers easier use than Crystal and a rich export that can cater for exporting data into a MS Word template (that could contain vector images, headers, table of contents) and also export this into PDF or HTML format.
Design is drag-and-drop with no coding or dependence on specialized staff whatsoever.
You can define the reports once and have them scheduled to output to PDF, saved to the system to be viewed online or to a file system.
The dates can be rolling (as in Last Week, Last Month) and so always deliver based on what you need.
The design is drag-and-drop, the dashboards are interactive, the reports are available when you need them, and there is security to lock down access to the dashboards/reports and control of who can design dashboards/reports. The flexibility is surely there for whatever combination is needed.
I think that Combit's List and LAbel will fit this requirement.
www.combit.de
however the support for EMFs is not perfect, it works good for small and medium complexity.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I've a requirement to be able to generate PDF's within our (ASP.net) application. We need to meet the following requirements:
The text will be largely dynamic and must be added programatically.
Ideally we'd like to base these generated documents off PDF templates provided by our designers.
Some of the sections/pages may or may not be visible depending on certain conditions - ideally we'd like the content to 'flow' upwards to fill the space when something is removed.
Some of the pages may need to repeat, depending on certain conditions.
Some of the PDF templates will be out of our control (we're populating application forms supplied by third parties), so being able to read in a blank PDF and populate it would be good.
I've looked at iTextSharp and it seems to do most of these things (i.e. I can take a PDF, edit it to include form fields where we need to fill data and then use iTextSharp to read that in as a template and populate the data), however, I'm not sure how then to go about potentially hiding whole sections and/or repeating pages.
What I'm looking for here is a little advice from anybody who's been in a similar situation.
Small update here, we went with iTextSharp - it's a powerful tool, but does take a bit of learning, however it's quick, light, and does precisely what we want it to do.
However...
I would point out that the latest version is no longer really free (as in beer) - the license does not permit commercial usage. As a result, we now have a licensed version, but it's not shockingly cheap (and they don't publish a price list).
I would use iTextSharp. I create all kinds of PDF files based on different templates and iText has worked the best for me. It is a very powerful control and can manipulate pdf files in just about any way.
I'm not sure that iText can handle your third requirement. I know that it can create a pdf from a html file. Maybe use what Tomas posted and create the pdf with iText.
There are various commercial components to do this. Look at: PDFLib (http://www.pdflib.com/), Tall Components (http://www.tallcomponents.com/) etc
I have use products from Tall components and can recommend them.
Some others are a lot more expensive.
ITextSharp as you've mentioned is quite good and can be used to add/remove external pages, in this can you could hide full pages by ommiting them, or replacing them with placeholder pages. iText can use existing PDF files or create blank pages.
From my personal experience, I have just dropped in images and text onto existing pages and added pages generated by a reporting tool when tabular data is required.
HTH
Why need the template files in the pdf format? With the dynamic that you want it is a bad format for reporting template. Use a reporting software that also output as pdf. Your designers can create the templates very easy with a GUI. You will find many reporting solutions here on stackoverflow.
We've used http://www.dynamicpdf.com/, for projects like this and have been pleased with the outcome. They have a PDF WYSIWYG designer tool that you can use to build out the layout template of your PDF, along with the tool to merge the template with your data based on field to column mapping. This saves hours of hand coding each element of a given PDF. It supports page headers and footers and deals with the complexities of page breaks.
I would consider using creating HTML files from templates and turn them into PDF with Prince. Prince is very flexible and crating HTML files from templates is much easier then creating PDF files directly.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Is there a library that has a class to extract the text from a pdf file in c#.net? I've tried a few but documentation is terrible, so I haven't been able to get it off the ground. Also if it provides a class to extract images that would be a plus. Any suggestions? Thx in advance.
Also I need to be able to implement it into an existing application.
Have you tried PDFKit.NET? It has reasonable docs and some good examples. It is designed for a server environment, so it is a little expensive.
EDIT Here is an open source library on SourceForge called iTextSharp. It is free for open source projects. I haven't used it, but it looks promising. Here is a tutorial for it that has lots of code examples.
There are a couple of ways you can go here -- a lot of it will depend on whether you want to retain the formattting (i.e., paragraphs and other layout elements) of the original PDF.
If you're considering commercial solutions, we do offer two products that might meet your requirements. One is EasyPDF SDK which has single shot ExtractText() and ExtractText2() calls that pull text out of your PDFs as plain text.
Note that the output from these calls is pretty simplistic and you will lose a lot of the original layout elements. They're nice for simple text extraction but might not be great if your PDF contains tabular data.
If you're dealing with tables, a nicer alternative could be to pull it out as rich text instead. We a have a tool called EasyConverter SDK geared for business documents which does just that using a single function call.
With EasyConverter SDK, the layout of your original PDF will be retained.
Both support C# so feel free to check out the eval versions at www.pdfonline.com if you're interested. I do work for the vendor so do take this suggestion as kind of a mother loving her own child :-) I've been browsing stackoverflow.com for code snippets for a long time, but have only recently started posting, so if you have any questions with either API just let me know and I can help. Cheers!
Docotic.Pdf library can extract text and images from PDF files.
You can extract text from whole document of from some pages only. The library can extract plain text and also text chunks with coordinates.
You can extracted images from PDFs (as JPEG and TIFF files).
Here is a couple of samples for your task:
Extract text from PDFs
Extract images from a PDF
Disclaimer: I work for Bit Miracle, vendor of the library.
we've used snowbound software at work for image conversion. it apparently supports text extraction too. however, it's not free.