FoxPro Programming
Printing letters from FoxPro conversion from PCL5 to HTML or ????
Gravatar is a globally recognized avatar based on your email address. Printing letters from FoxPro conversion from PCL5 to HTML or ????
  Jeff L
  All
  Mar 13, 2024 @ 08:41am

Currently, we send out critical letters and we use PCL5 for formatting (e.g. bold, margins, etc.) We have customized templates that include the PCL5 and merge fields that VFP can replace items like name, address, etc.

But, PCL5 is a PITA and not all printers support PCL5.

In the past at a different shop I used West-Wind and GhostScript to create PDF files. But that was using the VFP report writer. What we have now is straight up text that is kind of marked up if you will. I think that we are stuck with the text and won't be able to use VFP report writer.

One solution was a .NET dll from SelectPDF which turns HTML into PDF. Of course, that would mean we would need HTML template files for out letters. And we could use Rick's DotNetBridge for that.

So, I'm wondering if anyone has any suggestions and whether West Wind has any tools for this?

Gravatar is a globally recognized avatar based on your email address. re: Printing letters from FoxPro conversion from PCL5 to HTML or ????
  Rick Strahl
  Jeff L
  Mar 13, 2024 @ 12:46pm

Depending on the complexity of your HTML you can look into wkHtmlToPdf which is a (large) standalone EXE that can convert HTML to PDF. Works reasonably well, but it breaks with very large documents (couldn't use it in Help Builder as it broke on large help files for example). I use in Markdown Monster as one of the PDF export solution - the other is using PrintToPdf using the Browser built in tools, but that doesn't work under program control and is also dependent on the WebView runtimes.

I've not found a reasonably priced commercial solution for HTML to PDF conversion that works well frankly - they all have quirks and there are complexities of how to translate long documents into pages.

Any .NET solution can be adapted in FoxPro using wwDotnetBridge either directly or via a small wrapper. If you find something that works for you please post - I'm interested to hear about solutions I might have missed in my search.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Printing letters from FoxPro conversion from PCL5 to HTML or ????
  Harvey Mushman
  Jeff L
  Mar 14, 2024 @ 04:47am

I have used a program called Win2PDF for many years. It is basically a PDF printer driver that just works on any page format including my AutoCAD "D" size prints. Not sure if it will help you out or not but might be worth looking at.

Gravatar is a globally recognized avatar based on your email address. re: Printing letters from FoxPro conversion from PCL5 to HTML or ????
  Rick Strahl
  Harvey Mushman
  Mar 14, 2024 @ 09:43am

You shouldn't need to use a special driver if you're using a recent version of Windows as Microsoft ships a Microsoft PDF Printer driver. Web Connection tries to install it when you install Web Connection.

You can just print to that driver to produce a PDF and you can use it from FoxPro as a regular printer.

+++ Rick ---

© 1996-2024