How to recognize barcodes in a PDF file - c#

I have a PDF file with n pages, I need to split it to n files. On each page I have barcode, I need to recognize/read barcode. If I have two files with the same barcode I need to merge them.
Can anyone recommend an .net component or exe or something else that will help me? It can be commercial.
I have tried:
itextsharp - only split and merge files
dotimage/aspose/idautomation - only recognize barcodes and it very expensive
a-pdf - not always recognize the barcode and not merge/split two files.
Thanks

YOu will need at least two and probably even 3 frameworks.
I would use itextsharp to write out the pdf.
You could look at pdfviewernet to read.
And I would look at vintasoft for a cheap(ish) barcodereader.

You may try Aspose.Pdf for .NET along with Aspose.BarCode for .NET in order to achieve your goal quite comfortably:
Split PDF pages
Recognize bar codes
Merge PDF files/pages into a single PDF file
Both of these components work for any .NET Framework version on both 32-bit/64-bit systems. You can use them with any type of .NET application. The APIs are very simple and easy to learn and implement. You might get the idea from the above mentioned samples.
Disclosure: I work as a developer evangelist at Aspose.

Related

How to convert office file to image

I am searching from last two days but did not find any thing.
My requirement is to create a document viewer in my web application (C#.Net) and I don't want to use any third party tool for this. Can I convert the files in image or PDF or in any common formate which can be easly render on web page. I also can not use Introp object.
Any help will be highly appreciated
You mention in one of your comments that you'd like to write all the code yourself but don't know where to start. Here's how I would go about it...
First, you'll need to familiarize yourself with the Microsoft Office Format specification. You can find that here (there's a link to the technical specification). Office documents are actually a .zip file with an XML file inside along with any binary data representing attachments. Just renamed a .docx file as .zip and you'll be able to open it up and see the XML and any other supporting documents inside (same is true for xlsx, etc...).
Then you'll need to become intimately familiar with either PDF or HTML, as your job now will be to convert the various Office document structure into PDF or HTML structure, being sure to respect page layout, margins, order, etc...
As others have said, this is a large task which is why third party tools exist today. Also, each third party toolset has it's limitation as this is really hard to "get right" in all situations and there will be edge cases that work for one document and not another (because maybe they didn't use Microsoft Word to save the .docx, maybe they used OpenOffice and OpenOffice interpreted the standard slightly differently...)
If you cannot use COM/Interop technologies in your solution, you can take a look at the specialized 3rd party options. I see that you prefer not to use them, however, there are no existing built-in solutions in the .NET Framework. Check out my answer in a similar thread that describes how to accomplish exactly the same task using 3rd party libraries (for example, DevExpress, since I have experience with it). In addition, take a look at the Documents demo, where you can see how to create images/thumbnails from different types of MS Office documents.
I believe what you need is an intermediate representation of the documents which can be converted into an image for the viewer to display.
Lets me try to explain with the below diagram:
You can use tools like smallpdf or OfficeToPDF to do that. Just integrate them into your application.
Small PDF(https://smallpdf.com/library-detail)
officetopdf (https://officetopdf.codeplex.com/)

Open PDF and print to PDF programmatically C#

I am developing an application that is able to open and display PDFs after I open them and print them to another PDF using CutePDF, but the originals are not viewable.
I am looking for a way to programmatically open a PDF file, and print to another PDF file (not necessarily using CutePDF, just printing to another PDF is the desired functionality).
This will be integrated into a C# .NET project. Are there any suggestions how to go about doing this?
Thanks.
You could use Office Interop and generate the PDF, when you say "print to another pdf", I imagine you mean just generate? Or are you saying spool them to a pdf print driver that essentially will just create a PDF to be saved.
Use iText, which is available in Java and C# versions. I have used the Java version successfully. I recommend the iText in Action book to help you get up to speed with iText faster. The book discusses only the Java API, but I imagine you will be able to learn the principles of iText from the book and then figure out the minor differences for the C# version.
To implement this you can use PDFFlow library for generating PDF files from C#. It has easy fluent syntax and many features.
Here are many examples of real complex PDF documents: examples
Good luck :)

conversion of jpeg picture to pdf file

I need to convert a set of jpeg images into a pdf file (which should contain all the jpeg).
I want to do it in .Net1.1 and programatically in C#.
You could use iTextSharp to create the pdf and add images to it. Here's a sample.
You could try ImageMagick.NET - it's a wrapper around ImageMagick, which can convert pretty much anything into anything. (I've only used the command line tool.)
If there's a problem with support for older .NET versions, just execute the command line tool yourself - it's the same thing.
Use one of them open source pdf library - http://csharp-source.net/open-source/pdf-libraries
Please try Aspose.Pdf for .NET in order to either convert the images to PDF file or add images to an existing PDF file. This works with .NET 1.1 and above. You can use it in any of your .NET applications using C# or VB.NET. It works on both 32-bit and 64-bit systems alike. Please try the component at your end.
Disclosure: I work as a developer evangelist at Aspose.

How can I programmatically create PDF bookmarks from PDF file?

So, I have used Pdf995's PDF print driver from a web browser to print web pages and eventually use PdfEdit995 to join these various PDF files into one large PDF.
Now I have a lot of large PDF documents that I wish to add bookmarks to, but am hoping there is a relatively easy way of doing this programmatically (using C#, preferably) - basically, I want to find, within each PDF, text that is large enough to qualify as a header, and use that text as the bookmark.
Any tips/advice/direction? Thanks!
It's definitely possible to do this, but I would recommend finding a PDF library that does most of the leg work. Technically you could do it all yourself with the aid of the PDF specification, but that'd probably take more time than it's worth.
The library will need to be able to let you find text in a document and then return the page and size, font, etc, of the text and create bookmarks (also known as outlines) based on that information programmatically.
My companies product, Quick PDF Library, can help you do this and so can PDFKit.NET. I'm sure there are other libraries out there that support this functionality too. As far as free libraries go, from what I've seen I don't believe that PDFSharp or iText will meet all of your requirements in this case, but I'm sure someone will correct me if I'm wrong.
If you'd prefer to develop a solution for this entirely yourself, then the PDF reference is available online for free.

HTML Printing

I am too cheap to buy crystal reports so i built the report in asp.net, the only problem I'm facing is printing the report and making it look professional. On different printer's the report looks diff, i want to be able to control the final output and make the report print standard across all printers. You guys have any suggestions on how to achieve this properly?
Why not just use Reporting Services? It's free and easy to integrate with both WebForms and WinForms apps. Supports export to PDF, Excel, etc.
Mabye a stylesheet? Google it, good luck
You could try implementing a print stylesheet (you'll find many examples Googling the term), but that can be laborious if you're not familiar with css.
If you're checking out pdf solutions, I've used iTextSharp to create pdfs. It's relatively easy, open source and mature and used by many corporations.
You could try printing to a PDF. Not sure what your budget is, but ExpertPDF is a good option I'm using now.
You could create the report as a PDF using a C# library such as PDFsharp (Open-Source).
This approach allows you to:
Serve PDF files to your user, giving them the option to:
print it now
archive it for later use
Automatically email reports to your users using a scheduled task
Store generated PDFs in a database or on the file system
cutePDF is a free PDF writer and should work for what you need

Categories