SaveDocumentToPDF Issue
SaveDocumentToPDF Issue
Hello,
I am trying to save the contents of my GdViewer to a new file in my C:\Users\userid\AppData\... folder using SaveDocumentToPDF Method. I am loading a PDF into the GdViewer, Burning annotations, then saving the GdViewer to a new Output file that does not exist yet.
My code: Status = MyGdViewer.SaveDocumentToPDF(FileOut) is aborting with a status code = 9
I have permissions to write to this folder.
Is there a step that I am missing?
Thank you
I am trying to save the contents of my GdViewer to a new file in my C:\Users\userid\AppData\... folder using SaveDocumentToPDF Method. I am loading a PDF into the GdViewer, Burning annotations, then saving the GdViewer to a new Output file that does not exist yet.
My code: Status = MyGdViewer.SaveDocumentToPDF(FileOut) is aborting with a status code = 9
I have permissions to write to this folder.
Is there a step that I am missing?
Thank you
Re: SaveDocumentToPDF Issue
Hello there,
This error is mostly due because of insufficient pre-conditions, so the process is aborted.
Does a file has been properly loaded within the viewer? Does the issue is reproducible with the code snippet provided in our documentation?
Here is the link to the code snippet: https://www.gdpicture.com/guides/gdpict ... ring).html
With best,
Fabio
This error is mostly due because of insufficient pre-conditions, so the process is aborted.
Does a file has been properly loaded within the viewer? Does the issue is reproducible with the code snippet provided in our documentation?
Here is the link to the code snippet: https://www.gdpicture.com/guides/gdpict ... ring).html
With best,
Fabio
Re: SaveDocumentToPDF Issue
Thank you for the suggestion to review your code snippet. Unfortunately, it didn't help me too much.
When I follow my code in VS, The file looks as though it is loaded into the GdViewer. These 2 If statements:
If GdPicturePDF1.LoadFromFile(FileIn, False) = GdPicture14.GdPictureStatus.OK Then
If GdViewer1.DisplayFromGdPicturePDF(GdPicturePDF1) <> GdPicture14.GdPictureStatus.OK Then...
are both OK, so they show that a file is being loaded into the GdViewer.
Is there anything else i need to do before trying to use the GdViewer contents? Will any GdViewer information from my debugger help? I'm not sure what else there is to do or check.
I have included a code snippet below. I appreciate your help and any suggestions you may have.
----------------------------------------------
When I follow my code in VS, The file looks as though it is loaded into the GdViewer. These 2 If statements:
If GdPicturePDF1.LoadFromFile(FileIn, False) = GdPicture14.GdPictureStatus.OK Then
If GdViewer1.DisplayFromGdPicturePDF(GdPicturePDF1) <> GdPicture14.GdPictureStatus.OK Then...
are both OK, so they show that a file is being loaded into the GdViewer.
Is there anything else i need to do before trying to use the GdViewer contents? Will any GdViewer information from my debugger help? I'm not sure what else there is to do or check.
I have included a code snippet below. I appreciate your help and any suggestions you may have.
----------------------------------------------
Code: Select all
Public Class clsProcessPDF
Private GdViewer1 As GdPicture14.GdViewer
Private GDPDocumentFormat1 As GdPicture14.DocumentFormat
Private GdPictureImaging1 As GdPicture14.GdPictureImaging
Private GdPicturePDF1 As GdPicture14.GdPicturePDF
Private GDPImageID1 As Integer
Private FileOut As String
Public Function ProcessGdPicture(ByVal FileIn As String) As Boolean
Dim Status As GdPicture14.GdPictureStatus
GdPictureImaging1 = New GdPicture14.GdPictureImaging
GDPDocumentFormat1 = GdPictureImaging1.GetDocumentFormatFromFile(FileIn)
GdViewer1 = New GdPicture14.GdViewer
If GDPDocumentFormat1 = GdPicture14.DocumentFormat.DocumentFormatPDF Then
GdPicturePDF1 = New GdPicture14.GdPicturePDF
If GdPicturePDF1.LoadFromFile(FileIn, False) = GdPicture14.GdPictureStatus.OK Then
If GdViewer1.DisplayFromGdPicturePDF(GdPicturePDF1) <> GdPicture14.GdPictureStatus.OK Then
MsgBox("Unable to load GdViewer1")
End If
End If
...
FileOut = "C:\Users\user\AppData\Roaming\Product\fileout.pdf"
Status = GdViewer1.SaveDocumentToPDF(FileOut)
If Status <> GdPicture14.GdPictureStatus.OK Then
'executes abort code always with 9 status code
...
Re: SaveDocumentToPDF Issue
Hello,
I tested your code through a sample ad it seems to work well.
Can you try to implement it on a sample (provided in the "Sample" folder in the installation folder) and tell me if the issue remains?
If you, could you sent a minimalistic sample that reproduces the issue? (without the DLL and the bin/packages/obj/.vs folder)
With best,
Fabio
I tested your code through a sample ad it seems to work well.
Can you try to implement it on a sample (provided in the "Sample" folder in the installation folder) and tell me if the issue remains?
If you, could you sent a minimalistic sample that reproduces the issue? (without the DLL and the bin/packages/obj/.vs folder)
With best,
Fabio
Re: SaveDocumentToPDF Issue
thank you. I am out of the office this week, but will work on it next week.
Re: SaveDocumentToPDF Issue
Hello Fabio,
I have attached a small vb.net program that gets the Abort 9 status on line 46 - Status = MyGdViewer.SaveDocumentToPDF(TemporarySavedFile)
To test, I assume you will create a project in VS, copy the GDPicture files to the bin folder, then edit the attached file. The program requires that you create a PDF like the one in line 19 - FileToProcess = "C:\temp\input.pdf"
also attached is the picture of the project application tab.
If it works as expected (does not abort), can you please send me a listing of your bin folder?
I did not see a sample similar to the code I am using.
Thank you and I look forward to hearing from you.
Brian
I have attached a small vb.net program that gets the Abort 9 status on line 46 - Status = MyGdViewer.SaveDocumentToPDF(TemporarySavedFile)
To test, I assume you will create a project in VS, copy the GDPicture files to the bin folder, then edit the attached file. The program requires that you create a PDF like the one in line 19 - FileToProcess = "C:\temp\input.pdf"
also attached is the picture of the project application tab.
If it works as expected (does not abort), can you please send me a listing of your bin folder?
I did not see a sample similar to the code I am using.
Thank you and I look forward to hearing from you.
Brian
- Attachments
-
- testpgm.zip
- (24.25 KiB) Downloaded 610 times
Re: SaveDocumentToPDF Issue
Hello,
I reproduced the issue on my side, thanks for the code snippet.
So I created a ticket for the developers to check what it's going on and to handle this issue.
I will keep you updated through this post!
Have a nice day,
Fabio
I reproduced the issue on my side, thanks for the code snippet.
So I created a ticket for the developers to check what it's going on and to handle this issue.
I will keep you updated through this post!
Have a nice day,
Fabio
Re: SaveDocumentToPDF Issue
Thank you, Fabio.
I look forward to a resolution. This is holding up our project.
I look forward to a resolution. This is holding up our project.
Re: SaveDocumentToPDF Issue
Hello,
The issue has been corrected and will be available on our next minor release. The provided code will work just by updating the SDK.
With best,
Fabio
The issue has been corrected and will be available on our next minor release. The provided code will work just by updating the SDK.
With best,
Fabio
Re: SaveDocumentToPDF Issue
Great and thank you!
Re: SaveDocumentToPDF Issue
Is the build this one? 14.1.134 September 30 2021
Re: SaveDocumentToPDF Issue
Hello,
Yes, it is the 14.1.134!
With best,
Fabio
Yes, it is the 14.1.134!
With best,
Fabio
Re: SaveDocumentToPDF Issue
thanks. I'll start testing it and let you know
Re: SaveDocumentToPDF Issue
Fabio, Could you please test my code snippet against 14.1.134? I am still getting the same error.
I have included screenshots of the Bin Folder contents and my project References.
I have included screenshots of the Bin Folder contents and my project References.
Re: SaveDocumentToPDF Issue
Hello,
I'm really sorry, both, the resolution and the release have been made on the same day. But the correction was right after the release of the new version!
My bad for this mistake.
The correction will be available on our next release then!
Have a nice day,
Fabio
I'm really sorry, both, the resolution and the release have been made on the same day. But the correction was right after the release of the new version!
My bad for this mistake.
The correction will be available on our next release then!
Have a nice day,
Fabio
Who is online
Users browsing this forum: No registered users and 1 guest