A Alex_197 Well-Known Member Licensed User Longtime User Mar 10, 2024 #1 Hi all. Is there any option to validate a PDF to make sure that the file isn't corrupted? Let's say a user has a pdf on his phone. In my app he needs to select a pdf, view it and if it's Ok click a button Send and send it to the server. But what if the PDF on his phone is corrupted or damaged and can't ve opened? I want to check it and if it the case notify the user about it. Thanks.
Hi all. Is there any option to validate a PDF to make sure that the file isn't corrupted? Let's say a user has a pdf on his phone. In my app he needs to select a pdf, view it and if it's Ok click a button Send and send it to the server. But what if the PDF on his phone is corrupted or damaged and can't ve opened? I want to check it and if it the case notify the user about it. Thanks.
Erel B4X founder Staff member Licensed User Longtime User Mar 11, 2024 #2 You can try to open it with Canvas (https://www.b4x.com/android/forum/threads/reading-and-writing-pdf-documents.48308/#content) and catch errors if they happen. I haven't checked it with corrupt files. Upvote 0
You can try to open it with Canvas (https://www.b4x.com/android/forum/threads/reading-and-writing-pdf-documents.48308/#content) and catch errors if they happen. I haven't checked it with corrupt files.
A Alex_197 Well-Known Member Licensed User Longtime User Mar 11, 2024 #3 Erel said: You can try to open it with Canvas (https://www.b4x.com/android/forum/threads/reading-and-writing-pdf-documents.48308/#content) and catch errors if they happen. I haven't checked it with corrupt files. Click to expand... I tried it - no errors, just a blank screen Upvote 0
Erel said: You can try to open it with Canvas (https://www.b4x.com/android/forum/threads/reading-and-writing-pdf-documents.48308/#content) and catch errors if they happen. I haven't checked it with corrupt files. Click to expand... I tried it - no errors, just a blank screen
Erel B4X founder Staff member Licensed User Longtime User Mar 11, 2024 #4 What is the value of PDFDocument.NumberOfPages? Upvote 0
A Alex_197 Well-Known Member Licensed User Longtime User Mar 11, 2024 #5 Erel said: What is the value of PDFDocument.NumberOfPages? Click to expand... [CODE lang="b4x" highlight="4"]Copying updated assets files (3) Application_Start Application_Active pdf.NumberOfPages=0 Application_Inactive Application_Active [/CODE] Upvote 0
Erel said: What is the value of PDFDocument.NumberOfPages? Click to expand... [CODE lang="b4x" highlight="4"]Copying updated assets files (3) Application_Start Application_Active pdf.NumberOfPages=0 Application_Inactive Application_Active [/CODE]
Erel B4X founder Staff member Licensed User Longtime User Mar 11, 2024 #6 Looks like the solution you are looking for. Upvote 0
A Alex_197 Well-Known Member Licensed User Longtime User Mar 11, 2024 #7 Erel said: Looks like the solution you are looking for. Click to expand... yes it is. Now I'm looking for the same solution for Android Upvote 0
Erel said: Looks like the solution you are looking for. Click to expand... yes it is. Now I'm looking for the same solution for Android