Highlighted
Visitor.
1347 views

PDF printing very slow

Jump to solution

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.

               CALL "PC_PRINTER_SET_FONT" USING BY REFERENCE WS-HANDLE
                                          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
               MOVE "UNABLE TO SET PRINTER FONT" TO LINK-MESSAGE
               GO TO PX999.
       PX300.
           CALL "PC_PRINTER_WRITE" USING BY REFERENCE WS-HANDLE
                                         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.

John

   

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: PDF printing very slow

Jump to solution

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?

Thanks.

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: PDF printing very slow

Jump to solution

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?

Thanks.

View solution in original post

0 Likes
Highlighted
Visitor.

RE: PDF printing very slow

Jump to solution

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,

John

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.