Search code examples
asp.net-mvcfile-conversionleadtools-sdk

using LEADTOOLS to convert doc to pdf


I am playing around with Leadtools to see how it might benefit me but i am a little frustrated with their documentation regarding how the process works. I am creating a library with methods that take an input file, convert it to pdf, add a qrcode to the file and save it and then reading the qrcode again.

  1. Does a pdf have to be converted to an image before leadtools is able to read the qrcode?

  2. Does leadtools allow converting from doc to pdf and then adding the qrcode or do i have to convert it to an image as well?

  3. Is there anywhere I could look at code samples of how I can go about doing what I talked about other than the leadtools site itself?


Solution

  • I am sorry to hear that you are having difficulties, but I will do my best to get you pointed in the right direction.

    To answer your questions:
    A1.) Yes, the PDF will need to be rasterized before the LEADTOOLS barcode engine can be used. Our barcode engine will only work with raw image data. Once the file is decompressed into raw data, we will not access the file any further.

    A2.) Yes, you can rasterize Microsoft Word documents using either our file I/O methods or with the LEADTOOLS Virtual Printer. Once you have the raw image data, you can pass it to the barcode engine to write the QR code into the data. Once the barcode is written, you can then compress the image into any supported format, including (raster) PDF. You can also create a searchable PDF by running the resultant image through an OCR engine & outputting to PDF.

    A3.) The LEADTOOLS SDK has a main barcode demo that should illustrate the ability of the SDK to handle the features you describe here. There are also tutorials in the help file, and various projects on our support forums. We have also created a couple different CodeProject articles here:
    Multi-Platform Barcode with LEADTOOLS 18
    How to Read Barcodes from Images using LEADTOOLS

    You haven't mentioned here what programming language you are developing with or what the specific problem are that you have encountered. Without knowing either of those, it's difficult to get more specific into any methods or other resources to check out. For a simple raster conversion of a Microsoft Word Doc to PDF and writing a barcode, I think this would probably take between 10-15 lines of code.

    If you have not already, I would highly recommend sending an email to [email protected] or open a live chat with the LEADTOOLS Support team from LEADTOOLS.com. We can get into more specifics there and help you more directly with any issues you are encountering.

    Walter Bates
    LEADTOOLS Developer Support