Tips For Success

Having the best tools for document imaging is only half of the equation. Our Tech Tips are designed to provide you with valuable information to help succeed by achieving faster results with RasterMaster SDKs or FlexSnap viewers. New time-saving tips are added monthly - you can receive them through Imaging News or our Tech Tips RSS feed.

Converting a File to Vector PDF Format

This Tech Tip first appeared in Imaging News May 2006.

Vector graphics describe objects according to their geometrical characteristics including points, lines, curves, and polygons to represent images in computer graphics. Vector graphics differ from raster graphics, in that a raster graphic is the representation of the image as a collection of pixels (dots). You can move, resize, or change the color of a vector graphic without losing the quality of the graphic. Since vector graphics allow you to scale them without losing any quality, you may want to convert a file to a vector PDF. RasterMaster for Windows SDK (DLL) allows you to convert your file to a vector PDF.

The code sample below shows how to convert a file to a vector PDF in RasterMaster for Windows imaging SDK (DLL). This code sample supports the following formats: MS Word, MS Excel, PCL, and AFP.

#include "imglib.h"

 

int ExtractText( CString filename, int currentPage )

{

int textLength = 0;

int status = 0;

char* textBuffer = NULL;

CString pdfName = fileName + ".pdf";

 

/* extract text from currentPage of file and put in textBuffer */

status = IMGLOW_extract_text( (char*)(LPCTSTR)(fileName), &textBuffer, &textLength, currentPage );

 

if ( 0 < textLength )

{

// convert and save textBuffer as vector pdf file

IMG_save_document( (char*)(LPCTSTR)(pdfName), textBuffer, PDF );

}

/* free textBuffer memory allocated in call to IMGLOW_extract_text() */

if ( NULL != textBuffer )

{

long temp = (long)GlobalHandle((HANDLE)textBuffer);

if ( temp )

{

GlobalUnlock((HANDLE)temp);

GlobalFree((HANDLE)temp);

}

textBuffer = NULL;

}

return status;

}

Learn More About PDF Conversion

  • PDF to TIFF - Streamline workflow and standardize how images are viewed across your organization.
  • PDF to JPEG - Convert PDF to JPEG directly and rapidly, without having to invoke a print driver or any other external application.
  • AFP to PDF - Create applications that directly convert IBM ImagePlus MO:DCA (AFP, IOCA and PTOCA) documents to searchable PDF.
  • MS Word to PDF - quickly and efficiently convert and standardize their documents from MS Word to PDF files for easy archiving and display