Print Page | Close Window

How to Decode text in password protected PDF?

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: [Commercial] Foxit SDK / Foxit Library
Forum Description: High performance PDF libraries to render PDF pages, page objects, annotations, and forms the way they were intended to be viewed: sharp, clear, accurate, and easy to read.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=4110
Printed Date: 15 Nov 2019 at 3:09am
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


Topic: How to Decode text in password protected PDF?
Posted By: YogiYang
Subject: How to Decode text in password protected PDF?
Date Posted: 09 Oct 2019 at 5:52am
Hello,

I am using following code to try to extract text from PDF file. The file in question is password protected.

------------ CODE ----------------
QP := TDebenuPDFLibrary1612.Create;
if QP.LoadFromFile(OpenImageEnDialog1.FileName, UserPass) = 1 then
begin
AllTxt := TStringList.Create;
if AllTxt.Count > 0 then
begin
for I := 0 to AllTxt.Count - 1 do
begin
  if AllTxt <> '' then
    ShowMessage(AllTxt);
end;
end;
end;
------------ CODE ----------------


What I am getting as output from above code is as follows:

/Contents <08AAA42C4BD13A535D0D33EB59ABCBFAD41CFDEC0FD84BA2D612BDBFA7625BD7FC5C3934D8843CC5D64FBBB7820DBEE59D64629DAF062A8FB5D6F58FEA64A708B29C6197DBA205CEA0039FC3A249A7399C155D82529A007481E30897146995656E2319A38E3D6D3759A39FC24BBFCDF5D0B7C23A7FDA5A7E65BA161195D752182A0B68261EA28309087277E5852F70492864F07B1EDCAB50AE3CA3FDC7A8322C26B2D2A8D77D86C33632AA1739CCCE224D86272CB4D43D05F4E300C9141A01FFED2FAC92CC466252AA5DEE7C9197092A57BCA6E4FDA4B232FCA7C50BDCD30255232F5561E80E9B4667D1CAB8AB2E7B55D1F2CCEC9C6A10C9C06118DAC93CEB35BF0204BD>
/Type /Sig
/SubFilter /adbe.x509.rsa_sha1
/Name (DS UNIQUE IDENTIFICATION AUTHORITY OF INDIA 02)
/M (D:20170316122640+05'30')
/ByteRange [ 0 253640 254162 7808 ]
/Cert (0‚…0‚m S[u&0\r\t*†H†÷\r

As you can see the text is encoded,.

How can I decode it?

TIA




-------------
---
Yogi Yang



Replies:
Posted By: gkaiseril
Date Posted: 09 Oct 2019 at 3:01pm
Remove the password protection.

The creator has password protected their work for a reason. Do you work for free?


Posted By: YogiYang
Date Posted: 10 Oct 2019 at 3:29pm
Originally posted by gkaiseril gkaiseril wrote:

Remove the password protection.

The creator has password protected their work for a reason. Do you work for free?

I know that as the file in question is a legal document here in my country. But one can print part of it if and when necessary.

This file in question which is a single page document when rendered comes up properly so there has to be some way to decode the long string.




-------------
---
Yogi Yang


Posted By: BAlheit
Date Posted: 11 Oct 2019 at 8:23am
Study the PDF Reference.


Posted By: YogiYang
Date Posted: 17 Oct 2019 at 6:26am
Originally posted by BAlheit BAlheit wrote:

Study the PDF Reference.

It seem I will have to study the ref material from Adobe. But what is surprising me is that if the file can be loaded and rendered successfully by the SDK why can't we get the content in plain text.




-------------
---
Yogi Yang


Posted By: BAlheit
Date Posted: 17 Oct 2019 at 7:19am
Which SDK?


Posted By: YogiYang
Date Posted: 17 Oct 2019 at 3:12pm
Foxit Quick PDF SDK


-------------
---
Yogi Yang


Posted By: BAlheit
Date Posted: 19 Oct 2019 at 10:02am
I can't help with this.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net