Is there any way to convert text to image without using pictureBox in vb6?

3

Introduction

I have a DLL in VB6 that is generating an array of javascript commands that will be executed in an asp page to generate a PDF dynamically. Until then, all right! In this PDF I need to generate a barcode, the old system would do it through a font that has the characters in bar code, but the PDF generator does not accept custom fonts.

Imagined solution

The pdf generator (jspdf) supports base64 images, so I thought of creating a routine that would generate a barcode image using the source and then encode that base64 image to be displayed in the PDF

Progress

  • I was able to create the routine to transform an image path (eg c: \ image.jpg) into a base64 string and it works correctly.
  • The javascript code generator is already working correctly.
  • Difficulties

  • I can only generate an image from a pictureBox;
  • As a DLL I can not create the pictureBox
  • Questions

  • Is there any way to transform the text using the barcode font without using the pictureBox?
  • asked by anonymous 26.10.2016 / 21:01

    1 answer

    1

    Due to the time that this question remained unanswered, it was necessary to solve the problem as much as possible and within the time allowed.

    Solution:

    • The DLL generates the barcode number;

    • The javascript after page load takes this image and transforms it to base64;

    • javascript then uses this base64 code in the making of the PDF;

    I advise those with a similar problem, who manage the pdf on the server, using some backend and then make it available to the client, is one of the ways we do here and is the most current one here. There are several ways to solve a problem, although this is not indicated and difficult to maintain was the appropriate solution at the time, but should be revised to avoid future problems.

        
    30.05.2017 / 15:46