Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

SaveAs method not working creating empty PDF file

More
IP: 192.168.0.71 8 years 10 months ago #13142 by alecrugar
I want to open a pdf file, add some annotations and save it to a new pdf file.
Everything goes fine until I save it:
Code:
isSaved = pdfLayoutView.PDFGetDoc().SaveAs("myPath/filename.pdf", true);
the method returns TRUE (so it is saved) but when I try to open the newly created pdf file its size is 0 KB, it's empty.

It used to work using the deprecated class PDFReader (provided in the example project)
Any ideas?
Thanks.
More
IP: 192.168.0.71 8 years 10 months ago #13143 by Davide
Hi,
I have checked it with the last version of the library and it works properly.
Can you reproduce that issue with the last version? With all the pdfs? Can you please send us one of them?
More
IP: 192.168.0.71 8 years 10 months ago #13144 by alecrugar
Hey,
which is the latest version? I'm using version 3.14.4
The weird thing is that I almost copied the PDFReader class from the example test, and the SaveAs method used to work.
Now I'm using the PDFLayoutView, with the same pdf files, and the SaveAs method does not work,
This is weird because this method is part of Document, which has nothing to do with PDFReader or PDFLayoutView.
:S
More
IP: 192.168.0.71 8 years 10 months ago #13145 by support
What Android version are you testing on?
On a physical device or an emulated one?
Where are you writing the file? Application space? external storage?
May you confirm that you're naming the file with new filename?
More
IP: 192.168.0.71 8 years 10 months ago #13149 by Davide
Hi,
I have checked it with the stable version 3.14.4, with different pdfs and no problem found.
I used this code :
Code:
boolean isSaved = m_view.PDFGetDoc().SaveAs("sdcard/filename.pdf", true); Log.w("---test---", "isSaved " + isSaved);
More
IP: 192.168.0.71 8 years 10 months ago #13151 by alecrugar
Hey,
thanks for your support.
I've realised that it works for me on Android 7.0 and Android 8.0, but not on Android 6.0 or Android 6.0.1
Could you maybe check that it works for you on Android 6.x, please?
Thanks a lot..
Time to create page: 0.414 seconds
Powered by Kunena Forum