Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
lab-4
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
9731073
lab-4
Commits
b0cd68a6
Commit
b0cd68a6
authored
Mar 10, 2019
by
9731073
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial commit
parent
113bb265
Pipeline
#328
failed with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
Main.java
src/com/company/Main.java
+3
-5
No files found.
src/com/company/Main.java
View file @
b0cd68a6
...
...
@@ -16,8 +16,7 @@ public class Main {
Document
document
=
new
Document
();
//Create OutputStream instance.
OutputStream
outputStream
=
new
FileOutputStream
(
new
File
(
"C:\\TestFile.pdf"
));
OutputStream
outputStream
=
new
FileOutputStream
(
new
File
(
"TestFile.pdf"
));
//Create PDFWriter instance.
PdfWriter
.
getInstance
(
document
,
outputStream
);
...
...
@@ -26,8 +25,7 @@ public class Main {
document
.
open
();
//Add content to the document.
document
.
add
(
new
Paragraph
(
"Hello world, "
+
"this is a test pdf file."
));
document
.
add
(
new
Paragraph
(
"Hello world, "
+
"this is a test pdf file."
));
//Close document and outputStream.
document
.
close
();
...
...
@@ -36,7 +34,7 @@ public class Main {
System
.
out
.
println
(
"Pdf created successfully."
);
PdfReader
pdfReader
=
new
PdfReader
(
"C:\\Users\\Surface\\IdeaProjects\\lab4\\src\\com\\company\\Lab-4.pdf"
);
int
pages
=
pdfReader
.
getNumberOfPages
();
//
PdfTextExtractor(pdfReader.getNumberOfPages());
//
PdfTextExtractor(pdfReader.getNumberOfPages());
for
(
int
i
=
1
;
i
<=
pages
;
i
++)
{
String
pageContent
=
PdfTextExtractor
.
getTextFromPage
(
pdfReader
,
i
);
System
.
out
.
println
(
"Content on Page "
+
i
+
": "
+
pageContent
);
...
...
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