1. Roland Smith
  2. PowerBuilder
  3. Monday, 13 May 2019 21:05 PM UTC

At one time there was a problem where when running on a server, the temporary work files were not unique which caused issues.

I am pretty sure this was fixed but I want to know how the fix works.

We are moving to 2017-R3 Build 1880 soon and part of our app is a server side PDF generator that is used by our ASP.Net application.

Thanks!

 

 

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 14 May 2019 14:18 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Roland;

1)  Using either the SaveAs() or SaveNativePDFToBlob() commands will cause the PB run-time to allocate a folder structure within your MS-Windows "TEMP" folder, as follows:

TEMP => Appeon => NativePDF => Log

                                              => Temp

2) In the case of the SaveNativePDFToBlob() command, the PB run-time will create the image file in memory and also the resulting PDF. It can write to the "TEMP => Appeon => NativePDF => Log" folder though during this process.

3) In the case of the SaveAs() command, the PB run-time will create the image file in the "TEMP => Appeon => NativePDF => Temp" folder then use that to render the resulting PDF. It can write to the "TEMP => Appeon => NativePDF => Log" folder though during this process. In PB2019R3, the native PDF feature was updated to check for exiting temporary file and if present, then create a new work file name for each PDF thread. Once a PDF is actually rendered for the temporary file, the temporary image file is deleted.

Note: For #3 - If the users PC memory is limited, you can run out of Windows memory when producing very large PDF renderings. If your App is planning on building super large PDF's .. then using the SaveAs() method is recommended instead.

HTH

Regards ... Chris

 

 

 

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 13 May 2019 22:23 PM UTC
  2. PowerBuilder
  3. # 1

SaveNativePDFToBlob is great in that I don't need a PDF file to be created.

What about the work files? It sounds like you are saying that SaveAs creates temp files but SaveNativePDFToBlob does not.

If I have a desktop app on a server run by several users via Remote Apps, what happens if they all create PDF files at the same time? If there are still temp files, are they uniquely named?

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 13 May 2019 21:20 PM UTC
  2. PowerBuilder
  3. # 2

Hi Roland;

  Yes, that temporary file fix was introduced in the R3 release back in the summer of 2018 (build 1858). So you should be good to go in build 1880.

  The fix was to allocate the temporary image work file for building the PDF, in the O/S "Temp" folder and not the PB App's folder (which was the original default). Of course, as long as you installed your PB App EXE's in your own root folder's (off the primary drive) with proper privileges, this was not an issue. However, as soon as you installed the PB App.exe under the "C:\Program Files (x86)" folder  ... that is where the write access was normally blocked.  so using the O'S "temp" folder negates that.

Note: In PB build 1880 - you cam also use the new "SaveNativePDFToBlob" function and negate any temporary file allocation in the PDF preparation process.

HTH

Regards ... Chris

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.