Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-awesome-project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9531304
my-awesome-project
Commits
ca6d3bdf
Commit
ca6d3bdf
authored
Mar 10, 2019
by
--global
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding the page reader
parent
920f00c8
Pipeline
#315
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
Main.java
src/Main.java
+5
-1
No files found.
src/Main.java
View file @
ca6d3bdf
import
com.itextpdf.text.pdf.PdfReader
;
import
com.itextpdf.text.pdf.PdfReader
;
import
com.itextpdf.text.pdf.parser.PdfTextExtractor
;
public
class
Main
{
public
class
Main
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
PdfReader
pdfr
;
try
{
try
{
PdfReader
pdfr
=
new
PdfReader
(
"C:\\Users\\lab2\\Desktop\\Hello.pdf"
);
PdfReader
pdfr
=
new
PdfReader
(
"C:\\Users\\lab2\\Desktop\\Hello.pdf"
);
int
k
=
pdfr
.
getNumberOfPages
();
int
k
=
pdfr
.
getNumberOfPages
();
for
(
int
i
=
1
;
i
<=
k
;
i
++){
String
content
=
PdfTextExtractor
.
getTextFromPage
(
pdfr
,
i
);
System
.
out
.
println
(
"the content of page "
+
i
+
" is :\n\n"
+
content
);
}
System
.
out
.
println
(
k
);
System
.
out
.
println
(
k
);
System
.
out
.
println
(
pdfr
.
getNumberOfPages
());
System
.
out
.
println
(
pdfr
.
getNumberOfPages
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment