1. Jay Madren
  2. Valentina Reports ADK
  3. Вторник, Февраль 27 2018, 10:07 PM
  4.  Подписаться через email
Xojo app on Windows:

When I use PrintToDisk to create a PDF file, I can't open or edit the resultant PDF until I exit the Xojo application. How can I make it close and release the file?
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Hello Jay,

Is it a desktop application?
Комментарий
There are no comments made yet.
Jay Madren Ответ принят
Yes.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
The reference to the file is not kept, there must be something else which prevents access to it.

So you call PrintToDisk and try to open in Acrobat Reader? Edit in Acrobat? What exact message?

How do you get the path to the PDF file - is it constant or does it come from the open file dialogue?
Комментарий
There are no comments made yet.
Jay Madren Ответ принят
Yes, trying to open in Acrobat Reader, or even trying to rename the file is not allowed. The message from Acrobat is "There was an error opening this document. This file is already open or in use by another application." If I try to rename the PDF the resultant error message names the Xojo app as the one that has the file open. All of this goes away when I exit the Xojo app.

Saving the file on a shared volume, I can then see the file locked status which says it's locked for Write.

Doing some more testing I found that this only occurs in 64-bit Windows apps. 32-bit works fine.

The problem does not appear to be Xojo itself, as I can create a file and write to it with BinaryStream, but still access/rename/delete that file without exiting the Xojo app.

Edit: The file comes from the open file dialog.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Thanks for the details, I reproduced this issue in the 64-bit application.
Комментарий
There are no comments made yet.
Sergey Pashkov Ответ принят
Hello Jay,

There will not be a fast fix for this issue - it is even not reproducible in the debug build.
As a workaround PrintToBuffer method should be used with saving to file using Xojo classes.
Комментарий
There are no comments made yet.
Jay Madren Ответ принят
Ok, thanks. I'll try the PrintToBuffer method and see if it works ok.
Комментарий
There are no comments made yet.
Jay Madren Ответ принят
Ok, the PrintToBuffer method works fine. It doesn't take very much code to do it - I just called PrintToBuffer directly in a single BinaryStream.Write call.

Thanks.
Комментарий
There are no comments made yet.
  • Страница :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories