Christopher Krause

Christopher Krause

  • NA
  • 24
  • 57.8k

ActiveX: Export the page content as an image in VB6

Aug 4 2011 9:37 AM
ActiveX? Isn't that a dead technology?

You might hear this very often when talking about Visual Basic 6 or ActiveX controls. But we still have a strong client base using our ActiveX version in Visual Basic 6, Delphi, Sybase PowerBuilder or MS Access.

And we have committed to support this technology with the same innovation and developer power. We know that it takes time to port such legacy applications to newer technologies such as Windows Forms or WPF. Therefore, we are supporting our user base as best as possible with new versions, updates and technical support.

Today, I would like to introduce a feature that has been implemented in the latest version 16.0. In TX Text Control ActiveX, the Page Rendering Engine is accessible throught the PageImage property. It returns an image of the specified page which can be used with the Picture property of a Form object, PictureBox control or Image control.

To display a specific page on a PictureBox in VB6, the following code in required:

Picture1.Picture = TXTextControl1.PageImage(1, pcAll)

In order to save the image as an enhanced Metafile, the SavePicture method can be used:

SavePicture TXTextControl1.PageImage(1, pcAll), "test.emf"

More information: TX Text Control ActiveX

About TX Text Control:

TX Text Control was originally released in 1991, since then more than 50,000 copies have been sold. Starting off as a single, small DLL, TX Text Control has made its way through 16-bit DLL and VBX versions to today's Enterprise edition with its .NET and ActiveX components. The recent addition to the family, TX Text Control .NET Server, offers all of TX Text Control advanced word processing functionality in an easy-to-use server-side .NET component. Customers benefit from these years of experience, large user base, and at the same time, appreciate developing with a mature, reliable product.

Contact Informations:

[email protected]

North & South America:
Phone: +1 704-370-0110
Phone: +1 877-462-4772 (toll free)

Europe:
Phone: +49 (0)421 42 70 67 10

Asia Pacific:
Phone: +886 2-2797-8508