Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners read restricted pdf file
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Rohit G
read restricted pdf file
0 Answer(s)      2 years and 11 months ago
Posted in : Java Beginners


i have restricted file.

package Encryption;

import java.io.*; import java.util.*; import com.lowagie.text.*; import com.lowagie.text.pdf.*;

public class EncryptionWithCertificate { public static void main(String[] args) throws IOException { try { Document document = new Document(); document.open(); PdfReader reader = new PdfReader("C://ApplyRestriction.pdf"); PdfDictionary dictionary = reader.getPageN(1); PRIndirectReference reference = (PRIndirectReference) dictionary .get(PdfName.CONTENTS); PRStream stream = (PRStream) PdfReader.getPdfObject(reference); byte[] bytes = PdfReader.getStreamBytes(stream); PRTokeniser tokenizer = new PRTokeniser(bytes); StringBuffer buffer = new StringBuffer(); while (tokenizer.nextToken()) { if (tokenizer.getTokenType() == PRTokeniser.TK_STRING) { buffer.append(tokenizer.getStringValue()); } } String test = buffer.toString(); System.out.println(test); } catch (Exception e) {System.out.println("exception"+e.getStackTrace()); } } }

pdf given to code is in marathi

it gives following output

!"#"$%&!'()+,-,.,!-/.,0102/3..31145'44'5%67"89:;,<<$=>?@27A<"B":$AC@D#9"E7FGH!""#$%&"'"("#$)"+,$"-,./$%)"#)01"2!!345""-60$%$"7,.$8"9$:$."#$%6;$%"-,./$%)"#)01"<""""""#60=,1"2!!345'>+>3??45@4A81=.,%<;"B$C1"!89:"BEB<8BI#A"!#;#<8BJD$./1%<;"B$C17,);1"B,E"K:HHG1H"IIII+#?$!89:"B!#;#<8BJ#/,.,"FJ$68$K814>+>3??454!A81=.,%<;"B$C1"!89:"BE$$?$=#EB<8BI#A"7);K$0<;"B$C17,);1"B,EF:1"K:*HHM(G1H"IIIIN$=#?$!8

i want a correct output is it possible or not ?how?


Advertisement
View Answers

Related Tutorials/Questions & Answers:
read restricted pdf file
read restricted pdf file  i have restricted file. package Encryption; import java.io.*; import java.util.*; import com.lowagie.text.*; import...()); } } } pdf given to code is in marathi it gives following output
read restricted pdf file
read restricted pdf file  i have restricted file. package Encryption; import java.io.*; import java.util.*; import com.lowagie.text...."+e.getStackTrace()); } } } pdf given to code
Advertisements
Read PDF file
Read PDF file Java provides itext api to perform read and write operations with pdf file. Here we are going to read a pdf file. For this, we have used PDFReader class. The data is first converted into bytes and then with the use
pdf file measurement
pdf file measurement      ... on a pdf file,. To make the program for changing the pdf version firstly we have... in the document. In this example we need iText.jar file, without the jar file we
Download PDF file
Download PDF file  How to download PDF file with JSF
read a file
read a file  read a file byte by byte   import java.io.File... static void main(String[] args) { File file = new File("D://Try.txt"); try { FileInputStream fin = new FileInputStream(file); byte
pdf file in jsp
pdf file in jsp  i have a pdf, which has to be displayed in a jsp page along with some html tags, the pdf which is to be displayed shold be readonly and wont allow the uer to save too
about pdf file handeling
about pdf file handeling  can i apend something in pdf file using... to handle pdf files. You can find the related examples from the given link: Handling PDF files
about pdf file handeling
about pdf file handeling  i have downloaded a jar file containing packages for writing in pdf files . in which folder i should copy it ? i'm using windowsXP os.pls give whole path
file read
file read  hi i am reaing from a file which has punjabi words. can some one help with me some code
How to read PDF files created from Java thru VB Script
How to read PDF files created from Java thru VB Script  We have created the PDF file thru APache FOP but when we are unable to read the data thru... to read the FOP pdf? Is their any tool which convert the Apache FOP to Adobe PDF
Convert Text File to PDF file
Convert Text File to PDF file  Here is the way how to covert your Text file to PDF File, public class TextFileToPDF { private static void...(inLine); System.out.println("Text is inserted into pdf file
Java code to convert pdf file to word file
Java code to convert pdf file to word file  How to convert pdf file to word file using Java
Uploading and download pdf or .txt file.
Uploading and download pdf or .txt file.  I want admin user to upload pdf file into database and the users can download those pdf format from database
Convert Text File to PDF file
Convert Text File to PDF file  import java.io.BufferedReader; import...); System.out.println("Text is inserted into pdf file"); document.close... FileReader( Input File)); String inLine = null
how to dispaly pdf file on browser
how to dispaly pdf file on browser  In my project i have created one pdf file(by pdfwriter) into my local mechine . after that it need to display in browser as a pdf file . but in jsp i can't display by tag can anyone give me
convert an pdf file to html in Java
convert an pdf file to html in Java  Hi all, How to convert an pdf file to html in Java? Currently all my data is generated into a report in pdf and i want to be able to generate it to html page as well. How to go about
upload the pdf file only - Struts
upload the pdf file only  plz tell me,in my web application i want to upload only pdf file.but i m getting the problem when anyone change the extesion of EXE or TEXT with .pdf its also upload.plz give me response ASAP plz
converting html file into pdf - Struts
converting html file into pdf  i want to convert html file into pdf file using java code please help me
Read file in java
Read file in java  Hi, How to Read file in java? Thanks   Hi, Read complete tutorial with example at Read file in java. Thanks
java read file
java read file  Hello i need some help... i want to read an MS Excel file in java so how to read that file
how to display pdf file on browser
how to display pdf file on browser   In my project i have created one pdf file(by pdfwriter) into my local mechine . after that it need to display in browser as a pdf file . but in jsp i can't display by iframe tag can anyone
convert data from pdf to text file - Java Beginners
convert data from pdf to text file   how to read the data from pdf file and put it into text file(.txt
Read and write file
Read and write file  HI, How to read and write file from Java program? Thanks   Hi, See the following tutorials: Java Write To File Read File Thanks
Generate pdf file - JSP-Servlet
Generate pdf file   Hi Friends, How to generate the pdf file for the jsp page or in servets  Hi Friend, You need to download itext api. After that set the classpath and try the following code
Read external file in PHP
Read external file in PHP  How to read external files in PHP in particular time duration and save that file with the latest date. How is it possible? Please explain with an example. Thanks
Read from file java
Read from file java  How to Read from file java? What is the best method for a text file having a size of 10GB. Since i have to process the file one line at a time so tell me the very best method. Thank you
how to generate pdf file in struts
how to generate pdf file in struts  I am developing a struts application.I am having one registration form when i am submitting the form the values... be shown as pdf or excel format
how to generate pdf file in struts
how to generate pdf file in struts  I am developing a struts application.I am having one registration form when i am submitting the form the values... be shown as pdf or excel format
Java read binary file
Java read binary file  I want Java read binary file example code that is easy to read and learn. Thanks   Hi, Please see the code at Reading binary file into byte array in Java. Thanks   Hi, There is many
Read Video File
Read Video File  how to read a video file, after that i want to encrypt and decrypt it. please help me and if u can send me some hint or source code on swarit.it@gmail.com Thanks & Regards Swarit Agarwal
 

 

 

DMCA.com