1. Sim Joo Pee
  2. PowerBuilder
  3. Tuesday, 25 October 2022 00:51 AM UTC

Hi Sir or Madam,

I am having issue that when i use Native PDF!  , it takes some amount of time to generate. But when i fallback to old way/distill method, it generate pretty fast.  It is big different, times taken was from 7 minutes(use distill!) to 30 minutes(use nativePDF!). 

Please advice anything that i missed or overlooked? Thank you.

I am using PB2019 R3 Build2779

Sim Joo Pee Accepted Answer Pending Moderation
  1. Thursday, 27 October 2022 07:08 AM UTC
  2. PowerBuilder
  3. # 1

Hi All,

Thanks a lot for so much input. I doubt that saving to network drive caused it, i have slow symptoms when i save to local too .Please see below for comparison between Distilled (GS) vs NativePDF

Distill + Ghostscript :

Report

  1. (14:04 -> 14:06 = 2 minutes) File size = 15,611KB

==>(Row retrieve = 57200 + Pages created = 10868)

  1. (14:06 -> 14:07 = 1 minutes) File size = 9018KB

==>(Row retrieve = 58242 + Pages created = 7423)

NATIVEPDF :

Report

  1. (11:13 -> 11:18 = 5 minutes) File size = 14620KB

==>(Row retrieve = 57200 + Pages created = 10868)

  1. (11:18 - > 11:21 = 3 minutes) File size = 9488KB

==>(Row retrieve = 58242 + Pages created = 7423)

The above is testing data.  If production data, the total rows and size is bigger and time spent is 20 minutes at least. See attachment for details.

Thanks. Please advice.

Attachments (1)
Comment
There are no comments made yet.
Ronnie Po Accepted Answer Pending Moderation
  1. Wednesday, 26 October 2022 23:30 PM UTC
  2. PowerBuilder
  3. # 2

How about saving first to a local scratch directory, then copying the resulting file to the network location?

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 26 October 2022 15:00 PM UTC
  2. PowerBuilder
  3. # 3

Wow.

To summarize: Your app is being used to create a nearly 5,000 page PDF on a network drive that is roughly 9.5GB in size, and it takes 30 minutes using the NativePDF in PB. Each page contains a graphics logo in bitmap format.

I have some observations/suggestions:

1. Use a .jpg for the logo instead of a .bmp in the DataWindnow. A JPEG is a compressed image format whereas a bitmap is not, and this may significantly reduce the size of the PDF file. In addition, set dw_control.Object.DataWindow.Export.PDF.NativePDF.ImageFormat = '1'. Look in PB Help for "Export.PDF.NativePDF.ImageFormat" for more information.

2. Don't save a to network drive, if possible. Latency and data transfer speeds to and from network drives can be significantly slower than local drives, and network performance can vary significantly. I'm not greatly surprised it takes 30 minutes to write a 9.5GB file from an application to a network drive.

3. Consider the continued use of GhostScript. If it gives you more acceptable performance for your needs, use it. Using a distiller such as GhostScript is dramatically different technology than a native PDF solution, so I'm not surprised there is a performance difference. Is the difference disappointing??? Yes, of course it is. I don't believe anybody claims Native PDF will perform as good or better... It is simply more convenient, since a third-party distiller does not need to be used.

4. Reduce the amount of data. I'm unsure there is value in creating a report of this size, in any format. I'm not asking for an explanation of the purpose or need for creating this report, but I cannot help but question how or even if it is usable... I know I would not want to open/view/use it.

5. In PB, open the Application object, click the Additional Properties button to open the "Application" dialog window. Navigate to the last tab, named "PDF Export". See if the 2nd checkbox "Packaging custom fonts in the generated PDF files" is unchecked. The inclusion of custom fonts in a PDF increases the size of the file, but in this case the increase in size is probably negligible. Still, something to check/try.

Best regards, John

Comment
  1. Mark Lee @Appeon
  2. Monday, 31 October 2022 05:09 AM UTC
Hi Sim,



I agree with John,

Please verify John’s suggestion, maybe it will work better for you.



Regards,

  1. Helpful
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Tuesday, 25 October 2022 09:43 AM UTC
  2. PowerBuilder
  3. # 4

Hi.

ls_filename is located on your local drive or in a network location?

I did a test with a grid datawindow and 60.000 lines. I produced a pdf using NativePDF in < 6 minutes (9.135 pages, 19.860 KB). I did saved the file to my local drive.

Andreas.

Comment
  1. Sim Joo Pee
  2. Wednesday, 26 October 2022 09:08 AM UTC
Hi ,

It is network drive. But all the while it was saved to network drive. And there is no delayed/slow like now, which has upgrade to used Native PDF. It is a huge impact for them because it was 2 to 3 minutes earlier. But, now, it took about 20 minutes. These 20 minutes is based o production data, which is 60MB size of the pdf file output. What i told you earlier (Distilled = 1 minutes ++, Native = 5minutes), it was using test data. Please kindly advice. Thank you again.
  1. Helpful
  1. Andreas Mykonios
  2. Wednesday, 26 October 2022 11:00 AM UTC
I think there is a difference in the way ghostscript creates the pdf: I believe it is rendered using a temp file and when it's ready it places it to the final location... If I am correct in that, then it is possible to see differences in speed while saving to a network place using nativepdf which writes directly to the final location.

Andreas.
  1. Helpful
There are no comments made yet.
Sim Joo Pee Accepted Answer Pending Moderation
  1. Tuesday, 25 October 2022 06:51 AM UTC
  2. PowerBuilder
  3. # 5

*** Please ignore earlier quoted number(it was for few reports in total).  As such, I retest it with one report first. So, the below result was taken on one report.

How many rows are in the DataWindow that is being printed when it takes 30 minutes?

[Replied] 60K

How many pages are being generated when this 30-minute long printout/PDF is generated?

[Replied] 4949 pages

How large are the PDF files that are generated using the Distill! and the NativePDF! methods?

[Replied] Distill = 9645KB  , Native = 9692MB

What style (grid, tabular, group, rich text, crosstab, composite, etc.) is the DataWindow?

[Replied] Freeform

Does the print times you quoted include data retrieval?

[Replied] Ignored my earlier quoted number. Those are for few reports in totals. I re-test with my test data, with only 1 reports, retrieval is fast. Save as PDF took longer time. Distilled = 1 minutes ++,  Native = 5minutes

Are graphics (logos, pictures, etc.) being printed? If so, what graphics format(s) (.bmp, .png, .jpg, etc.)?

[Replied] one logo only, in bmp

What NativePDF settings/options are in effect?

[Replied]    

        ll_ret=dw_2.retrieve(id_input_date)
        IF ll_ret  = -1  THEN
            gnv_app.inv_error.of_Message(n_enable.translate("ERROR!",''),"dw_2 - Retrieve error")
            RETURN -1
        END IF
    
        ll_ret=dw_2.SaveAs(ls_filename,PDF!,true)
        
        dw_2.object.datawindow.print.documentname = ls_filename
        dw_2.object.datawindow.print.documentname = ''

         IF ll_ret < 1 THEN
            FileWriteEx(li_FileNum, ls_id+' creation FAILED '+ "   Print Time : " + String(Now( ), "ddmmmyyyy hh:mm:ss"))
        ELSE
            FileWriteEx(li_FileNum, ls_id+' created SUCCESSFULLY '+"   Print Time : " + String(Now( ), "ddmmmyyyy hh:mm:ss"))
            dw_1.SetItem(n, "report_dw", "N")
        END IF

What paper size is being used?

[Replied]     dw_2.Modify("DataWindow.Print.Orientation='1'")
        dw_2.Modify("DataWindow.Print.Paper.Size='9'")

How long does a modest DW Print operation (say, five pages) take to generate? How big is the PDF file in this case?

[Replied]? Dnt understand

Are custom fonts being imbedded in the PDF?

[Replied] dnt think so? Any specific section I need to check?

What version of Windows is being used?

[Replied]  Window 10 Pro. I also test using window 7, time taken was Distill = 2 minutes, Native = 7 minutes.

Are you running on a VM (virtual machine)?

[Replied] Not VM.

Is the app running from within the PB IDE or as a compiled/deployed application?

[Replied] as compiled exe/application

Is the app being run remotely (Citrix or Remote Desktop, for example)?

[Replied] No.

 

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Tuesday, 25 October 2022 02:44 AM UTC
  2. PowerBuilder
  3. # 6

I've used NativePDF for several years and have had no issues. I think you need to provide us with more information about this comparison and some context. For example:

How many rows are in the DataWindow that is being printed when it takes 30 minutes?

How many pages are being generated when this 30-minute long printout/PDF is generated?

How large are the PDF files that are generated using the Distill! and the NativePDF! methods?

What style (grid, tabular, group, rich text, crosstab, composite, etc.) is the DataWindow?

Does the print times you quoted include data retrieval?

Are graphics (logos, pictures, etc.) being printed? If so, what graphics format(s) (.bmp, .png, .jpg, etc.)?

What NativePDF settings/options are in effect?

What paper size is being used?

How long does a modest DW Print operation (say, five pages) take to generate? How big is the PDF file in this case?

Are custom fonts being imbedded in the PDF?

What version of Windows is being used?

Are you running on a VM (virtual machine)?

Is the app running from within the PB IDE or as a compiled/deployed application?

Is the app being run remotely (Citrix or Remote Desktop, for example)?

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.