Hello,
When I try to save the changes to a pdf file using the method GdViewer1.SaveDocumentToPDF, I get the error "Cannot Create File" (41). I am trying to save on top of the currently displayed file.
For example, I am displaying the file "c:\temp.pdf" using the method "MyGdPicturePDF.LoadFromFile("c:\temp.pdf", False) and then saving it back using the method GdViewer1.SaveDocumentToPDF(("c:\temp.pdf"). This works fine for TIFF and JPEG files, but not for pdf's.
Any idea how I can save the changes to a pdf file?
Thanks,
Reagan
Cannot Create File Error
-
- Posts: 352
- Joined: Tue Sep 27, 2011 11:47 am
Re: Cannot Create File Error
Hi,
You cannot append an existing pdf file that way. The method you are using is just for saving to a new pdf.
If you want to append an existing pdf file, you need to purchase the managed pdf plugin.
Best Regards,
Sami
You cannot append an existing pdf file that way. The method you are using is just for saving to a new pdf.
If you want to append an existing pdf file, you need to purchase the managed pdf plugin.
Best Regards,
Sami
-
- Posts: 32
- Joined: Sun Jan 30, 2011 8:40 pm
Re: Cannot Create File Error
Thank you for the reply. What I am trying to do is save a rotated pdf file that is being displayed within the GdViewer control so that the changes get reflected the next time that document gets displayed within the viewer. The only way I know to do that is to call SaveDocumentToPDF, which is returning the above error. Is there a better way to do this?
Currently I am using the free trial while I am building GdPicture into my application. I want to make sure it will work correctly before I buy it. I am just about finished with all of the functionality and I will be purchasing the ultimate package in the next couple of days, depending on when I finish.
Thanks,
Reagan
Currently I am using the free trial while I am building GdPicture into my application. I want to make sure it will work correctly before I buy it. I am just about finished with all of the functionality and I will be purchasing the ultimate package in the next couple of days, depending on when I finish.
Thanks,
Reagan
Re: Cannot Create File Error
Reagan the best way is:
- Load the PDF document by using a GdPicturePDF object. Set true to the LoadInMemory parameter.
- Display your PDF on the GdViewer by using the DisplayFromGdPicturePDF() method
- Apply your changes to the PDF, if any
- Save it back by using the SaveToFileInc() method of the GdPicturePDF class. By this way you will be able to overwrite the original document.
The demo "PagesManipulation" provided in C# and VB.NET demonstrate this kind of scenario.
Hope this helps!
Kind regards,
Loïc
- Load the PDF document by using a GdPicturePDF object. Set true to the LoadInMemory parameter.
- Display your PDF on the GdViewer by using the DisplayFromGdPicturePDF() method
- Apply your changes to the PDF, if any
- Save it back by using the SaveToFileInc() method of the GdPicturePDF class. By this way you will be able to overwrite the original document.
The demo "PagesManipulation" provided in C# and VB.NET demonstrate this kind of scenario.
Hope this helps!
Kind regards,
Loïc
Who is online
Users browsing this forum: No registered users and 2 guests