Convert TXT to PDF in C#, VB, and Java

We recently posted “Convert PDF to TXT in C#, VB, and Java” that uses the LEADTOOLS Document Converter class. Now, we are going to go the other way around and convert TXT to PDF. The main difference is that conversion from text to PDF is less complicated because the source TXT file is always text based. On the other hand, PDF files can be text or image based. Converting an image to text requires OCR. Converting Text to PDF does not matter if the resulting PDF is image- or text-based.

Continue reading
Posted in Document Converter | Tagged , , , , , , | Leave a comment

Convert and Base64 Encode Images and PDFs in C#

Base64 encoding is used to encode binary data, such as a PDF file, into an ASCII string format that is compatible with systems that can only handle text. For example, email attachments and binary uploads in HTML forms are converted and transmitted as Base64 encoded data.

The C# code snippet below shows how easy it is to save as any LEADTOOLS image format, including PDF, with Base64 encoding.

Continue reading
Posted in Document Converter | Tagged , , , , | Leave a comment

Microsoft Build May 25-27 & Wrap Up Show Friday, May 28!

The countdown is on! The Microsoft Build virtual event will be held next week, May 25-27th. We look forward to hearing the latest in developer tools and techniques that Microsoft is sure to announce! Since we had such a great time last year recapping the event with @CSharpFritz, we’re doing it again! Join us on May 28th for a Build Wrap Up Show. During the show, we will recap all of the highlights from Microsoft Build, hear the latest and greatest from various Microsoft speakers, and – of course – you can enter to win awesome prizes!

Continue reading
Posted in News | Tagged , , , , , , | Leave a comment

Convert PDF to JPEG Using C#, VB, and Java Code

Our support department recently responded to a request for a code sample to convert PDF to JPEG. The customer needed to leverage LEADTOOLS to split and convert thousands of PDF files into single page JPEGs.

JPEG images are universal and can be loaded by practically any client on any operating system. If the PDF files are photos, JPEG is the perfect universal image format for conversion. JPEG is designed specifically for photo images, supporting 24 bits per pixel color and 8 bits per pixel grayscale data.

If the PDF files are text based and need to be converted to a universal image format, PNG and GIF are more appropriate. PNG and GIF support fewer bits per pixel, including 1- and 4-bits and leverage lossless compressions. These factors result in less data to be compressed and clearer images of text and clip art. Typically, PNG results in smaller file sizes when compared to GIF.

Continue reading
Posted in PDF | Tagged , , | Leave a comment

Convert Multi-page TIFF to Searchable PDF in C#, Java, and C

It is tax season in the US. My CPA wants all of my supporting documentation to be saved as PDF, but I saved all as one multi-page TIFF when I scanned them. Fortunately, I have access to LEADTOOLS OCR.

In terms of functionality and platform support, LEADTOOLS OCR is the most flexible OCR engine available. It makes converting more than 200 image types to PDF and other document formats an easy task. The resulting PDF can be an image-based or text-searchable PDF. It can even be a combination of image over text so the resulting PDF has the text, but looks exactly like the TIFF.

Continue reading
Posted in Document Converter | Tagged , , , , | Leave a comment