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

Asked

Viewed 209 times

3

Introducing

I have a DLL in VB6 that is generating an array of javascript commands that will be executed on an Asp page to generate a PDF dynamically. So far, so good! In this PDF I need to generate a barcode, the old system made 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) accepts images in Base64, so I thought of creating a routine that would generate a barcode image using the source and then encode this image in Base64 to be displayed in PDF

Progress

  1. I was able to create the routine to transform an image path (e.g.: image.jpg) into a Base64 string and it works correctly.
  2. The javascript code generator also works correctly.

Difficulties

  1. I can only generate an image from a pictureBox;
  2. Being a DLL I can’t create pictureBox

Doubts

  1. Is there any way to transform text using barcode source without using pictureBox?

1 answer

1


Due to the time when this question remained unanswered, it was necessary to solve the problem as it was possible and fitting in the stipulated time.

Solution:

  • The DLL generates the barcode number;

  • Asp takes the number and writes with the barcode source in an invisible div;

  • The javascript after the page load takes this image and turns it to Base64;

  • Javascript then uses this code Base64 in the preparation of PDF;

I advise those who have 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(here). There are several ways to solve a problem, although not indicated and difficult to maintain was the appropriate solution at the time, but should be revised to avoid future problems.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.