PDF printing very slow

Hi all,

Hope all is well.

I just have a query about printing to pdf. 

Basically, we moved from Net Express to Visual Studio 2010 a short while ago. Some of our programs stayed as native code. One of these prints to an Adobe pdf file using Courier New font but with mixed font sizes. The program worked fine in Net Express but is terribly slow to run in Visual Studio. What took a minute or two on the old system is taking 20 minutes in Visual Studio.

The issue is definitely due to the font size as changing everything to print the same font size means the Visual Studio program runs fine. It's not ideal if we have to do that which is why I was wondering if anyone knows of a solution? Many thanks if you can help!

Another thing I noticed with pdf printing in Visual Studio is blank line spacing seems to be greater than in Net Express, causing our report lines to "creep" down the page. It meant I had to adjust the page overflow lines. Again, I didn't expect to have to do that after porting the code to Visual Studio. 

The lines below are an example of the native code we are using to handle printing. The first part is where we are setting the font size and family. We are printing to Adobe Acrobat 8.

                                          BY REFERENCE WS-FONT-FAMILY
                                          BY VALUE WS-FONT-SIZE
                                          BY VALUE WS-FONT-STYLE
                                          RETURNING WS-STATUS-CODE.
           IF WS-STATUS-CODE NOT = 0
               GO TO PX999.
                                         BY REFERENCE WS-PRINT-BUFFER
                                         BY VALUE WS-PRINT-BUFFER-LEN
                                         RETURNING WS-STATUS-CODE.

Many thanks if you have any ideas of what to do. I tried looking at whether a Namespace needs to be added (or COM object), plus searched high and low on Google without any hits.



  • Verified Answer

    When you are comparing the Net Express compiled program to the Visual COBOL compiled program are you running on the same computer? I am just wondering if the difference in speed is actually caused by moving to Visual COBOL or by moving to a new computer or OS?

    If you can provide a demo program that works under Net Express but runs slowly under VC for the same code then please open up a support incident with Customer Care so that we can test the behavior and try to find a resolution for you.

    What version of Visual COBOL are you running?

    This is compiled as native code in Visual COBOL as well correct?


  • Many thanks for the quick reply Chris.

    I am using the same PC and OS for both Net Express and Visual Cobol (version is 2.1 but am planning to install Cobol Server in the next week or so). The program is compiled as native code.

    The interesting thing is the slow printing problem only arises with mixed font sizes (the font family doesn't change). The program first prints an address on a statement in Courier New font 14-point then the rest of the statement lines in Courier New 10-point.  

    I'll load up a demo program to the Customer Care site either this afternoon or tomorrow morning.  

    Thanks again,