Comments (17)
Please include your file.
from pdfbox-android.
PdfBox-Android D No valid object at given location 9409516 - ignoring
java.io.IOException: Error: Expected a long type at offset 9409516, instead got ''
at com.tom_roush.pdfbox.pdfparser.BaseParser.readLong(BaseParser.java:1345)
at com.tom_roush.pdfbox.pdfparser.BaseParser.readObjectNumber(BaseParser.java:1270)
at com.tom_roush.pdfbox.pdfparser.COSParser.findObjectKey(COSParser.java:1595)
at com.tom_roush.pdfbox.pdfparser.COSParser.validateXrefOffsets(COSParser.java:1472)
at com.tom_roush.pdfbox.pdfparser.COSParser.checkXrefOffsets(COSParser.java:1524)
at com.tom_roush.pdfbox.pdfparser.COSParser.parseXref(COSParser.java:409)
at com.tom_roush.pdfbox.pdfparser.COSParser.retrieveTrailer(COSParser.java:254)
at com.tom_roush.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:169)
at com.tom_roush.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:222)
at com.tom_roush.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1096)
at com.tom_roush.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1079)
at com.tom_roush.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1020)
at com.shelter.sciencebookdecrypt.MainActivity$DecryptPdfTask.doInBackground(MainActivity.java:250)
at com.shelter.sciencebookdecrypt.MainActivity$DecryptPdfTask.doInBackground(MainActivity.java:87)
at android.os.AsyncTask$3.call(AsyncTask.java:378)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.lang.NumberFormatException: For input string: ""
at java.lang.Long.parseLong(Long.java:606)
at java.lang.Long.parseLong(Long.java:636)
at com.tom_roush.pdfbox.pdfparser.BaseParser.readLong(BaseParser.java:1339)
at com.tom_roush.pdfbox.pdfparser.BaseParser.readObjectNumber(BaseParser.java:1270)
at com.tom_roush.pdfbox.pdfparser.COSParser.findObjectKey(COSParser.java:1595)
at com.tom_roush.pdfbox.pdfparser.COSParser.validateXrefOffsets(COSParser.java:1472)
at com.tom_roush.pdfbox.pdfparser.COSParser.checkXrefOffsets(COSParser.java:1524)
at com.tom_roush.pdfbox.pdfparser.COSParser.parseXref(COSParser.java:409)
at com.tom_roush.pdfbox.pdfparser.COSParser.retrieveTrailer(COSParser.java:254)
at com.tom_roush.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:169)
at com.tom_roush.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:222)
at com.tom_roush.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1096)
at com.tom_roush.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1079)
at com.tom_roush.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1020)
at com.shelter.sciencebookdecrypt.MainActivity$DecryptPdfTask.doInBackground(MainActivity.java:250)
at com.shelter.sciencebookdecrypt.MainActivity$DecryptPdfTask.doInBackground(MainActivity.java:87)
at android.os.AsyncTask$3.call(AsyncTask.java:378)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Main: D onActivityResult: com.tom_roush.pdfbox.pdmodel.encryption.InvalidPasswordException: Cannot decrypt PDF, the password is incorrect
from pdfbox-android.
the kind of password is hex :9E21C2E741A4910AE284888670DABD7A
from pdfbox-android.
I am certain that this key is correct because it was successfully decrypted using the pikepdf library in Python
from pdfbox-android.
The source code for Python is
from pikepdf import Pdf
out = open("11.pdf", "wb")
file_key = "9E21C2E741A4910AE284888670DABD7A"
Pdf.open("bb.pdf", password=file_key, hex_password=True).save(out)
out.close()
from pdfbox-android.
PDFBox for desktop also fails to open this file: "IOException: No security handler for filter TTKN.PubSec".
from pdfbox-android.
I'm not with this project, I'm with the desktop PDF project, I just hang around in other PDF projects too.
tilman at snafu dot de
from pdfbox-android.
I'm just trying to work this out with you, and it has very little to do with desktop or mobile
from pdfbox-android.
I'm extremely sorry, the format of the PDF file I provided you above is not fixed. I will upload the file named output.pdf again. Could you please try decrypting this PDF file for me again
from pdfbox-android.
from pdfbox-android.
I can't open it with PDFBox for desktop or PDF.js because this is a binary password. According to a converter the password is "!ÂçA¤�
��pڽz" which isn't really helpful.
from pdfbox-android.
The key I provided is a hexadecimal key, can't pdfbox decrypt pdf files using a hexadecimal key
from pdfbox-android.
I didn't try because PDFDebugger doesn't support it and I didn't want to write code just for that. What would a person do that has to enter the key in Adobe Reader? If you are the one generating this file, why not generate it with a readable password?
from pdfbox-android.
This key is an RSA key and is not the key you need to enter to open the file using adobe pdf. In addition, this file is not generated by me, it is now an ordinary RSA encrypted file, the previous filter problem has been solved by me, if possible, please help to try to use the pdfbox library and AES decryption related api to decrypt the file, thank you very much
from pdfbox-android.
Lets say I'm an ordinary user who knows only Adobe Reader. What would I do with that file?
from pdfbox-android.
According to the PDF specification "Algorithm 2: Computing an encryption key in order to encrypt a document (revision 4 and earlier)":
"The password string is generated from host system codepage characters (or system scripts) by first converting the string to PDFDocEncoding. If the input is Unicode, first convert to a codepage encoding, and then to PDFDocEncoding for backward compatibility."
Your "password" doesn't look like "host system codepage characters (or system scripts)".
(Your PDF uses revision 4. It gets more complex with later revisions, then SASLPrep is needed)
from pdfbox-android.
Anyway, I only have this one key, and I'm 100% sure that this key is viable and correct, right
from pdfbox-android.
Related Issues (20)
- I think I fixed a text rendering bug. HOT 2
- The Problem of Password Parameter in Load Method
- Bengali broken word. How to solve?
- How to modify the text size in PDF files
- free doc viewer support view word excel ppt pdf txt image in sdcard & uri & assets & url download here https://github.com/Victor2018/DocViewer
- Can't build and run after AGP upgrade
- draw text in a "box"
- PdfBox broke my tests HOT 1
- PDF preview image generate is not working well with pre-filled generated PDF files
- pdf render error HOT 14
- I have my pdf file in assets, Error in rendering [pageImage = renderer.renderImage(0, 1, ImageType.RGB);] HOT 1
- Create PDF from a file(Images) doesn't support HEIC, HEIF, AVIF format
- Blur all objects or Blur page
- pdf convert *.docx Format error (font, color, line break)
- All color are inverted HOT 1
- Bump org.bouncycastle:bcprov-jdk15to18 from 1.72 to 1.78.1
- 在Android 6设备中还是有StackOverflowError问题 HOT 2
- Image is not getting inserted in a existing PDF HOT 1
- Could not initialize class com.tom_roush.pdfbox.pdmodel.font.PDType1Font
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdfbox-android.