First ime export to PDF from TextDynamic OCX

  • I have been trying for a few hours to make work or obtain an example that shows how to export to PDF from TextDynamic PDF. The samples with RICHTEXT.VBP use a method that requires an hwnd, but the OCX does not have one. The samples for the OCX reference an exception due to the PRINT method not being available in VB6, but the dll referenced does not work. Please, all I need are the three lines of code that make this work. I am generating all types of reports and running the TextDynamic wild. However, this is good for me only if I can output to PDF. Upon successful trial of this, we will be purchasing a license and in the coming months thousands of users of our product will be taking advantage of this technology. Thank you so much. If I am issing the obvious, I am willing to be humble.

    Jim Witschger

    • Offizieller Beitrag

    Hi,

    RICHTEXT.VBP shows how to export from a rich edit. It does not use the RTF engine.

    Do You use TextDynamic or TextDynamic Server?

    The "Print" method would actually send a document to the printer, not to the PDF engine. In VB (it somehow hides the Print method) you can use PrintPages for similar functionality.

    For PDF Export use the sub-interface
    PDFCreator, not the main object.


    You can also use Td.wpaProcess("DiaExportToPDF")

    Julian

  • Thank you for your reply, but I am just as confused as ever. I am sitting in the TextDynamic OCX with a perfectly formatted report. This is an OCX on a VB6 form. I want to output this RTF document to a PDF file. I cannot, nor can another programmer find anything that shows how to do this. The workaround in the manual due to the .Print failure does not work as there clear way to make the OCX and the various DLL's work together. I just need a snippet of code that will show how to make that lovely RTF in TextDynamic OCX go into a nice PDF that can be loaded by either your own PDF viewer or Adobe or any other PDF reader. The implication is stated in all of the marketing materials. However, there is no meaningful documentation in how to get there. The little documentation snippet is not clear. Please, please just cut me some code from an example as I have described and I will be very, very happy. You will obtain a customer and many more implementations in the field.

    We have also been trying to do the same thing with an RTF object generated with RTF2PDF. Again the examples to integrate the process are very, very non-specific. We have combed these forums and we have read all of the documentation. We are good users. We lover examples. Please help. We want to use your product and we cannot learn how.

    Jim

  • I was able to run a few more tests to determine what I wanted to know, one item of which was how fast the PDF would actually be created. I set the filename to DOCUMENT.PDF and then displayed the EXPORTtoPDF dialog with a call. I then simply hit ENTER and allowed the DOCUMENT.PDF file to be opened with a WinAPI ShellExecute. Though, limited to three pages from the 50 page sample, the PDF load was quite quick. Good work. Thus, there is clearly the ability to save the PDF from the RTF via a dialog. I am looking foward to a simple direct method to force the same save from the contents of the OCX to the PDF without the dialog. Then I am looking to do the same from a DLL without using the OCX but rather the Server Side engine.

    Can't wait to see a few snippets that we can plug and keep going.

    Thank you,

    Jim

    • Offizieller Beitrag
    Zitat

    I am looking foward to a simple direct method to force the same save from the contents of the OCX to the PDF without the dialog. Then I am looking to do the same from a DLL without using the OCX but rather the Server Side engine.

    TextDynamic will, unless you have the Server license, always display the dialog. (It should not canabilize server edition). You could get a bundle prince if you purchase TextDynamic AND TextDynamic Server.

    Since the 'Print' method is somehow invalidated by VB6 we will add a command to replace it. This has already be done for then TextDynamic Server DLL which uses a similar interface but is othewise built differently. Unlike TextDynamic, the editor, it is not based on a window class and does not require a window handle.

    If you onyl need to export a PDF and not to do much else yocan use it in VB6 without having to use the OCX.

    Regards,

    Julian