FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Java/itext-java-html-pdf/src/main/java/com/hmkcode/App.java at master · windGao/Java · GitHub
windGao
Java
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Java
/
itext-java-html-pdf
/
src
/
main
/
java
/
com
/
hmkcode
/
App.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (26 loc) · 835 Bytes
Breadcrumbs
Java
/
itext-java-html-pdf
/
src
/
main
/
java
/
com
/
hmkcode
/
App.java
Copy path
File metadata and controls
29 lines (26 loc) · 835 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package
com
.
hmkcode
;
import
java
.
io
.
FileInputStream
;
import
java
.
io
.
FileOutputStream
;
import
java
.
io
.
IOException
;
import
com
.
itextpdf
.
text
.
Document
;
import
com
.
itextpdf
.
text
.
DocumentException
;
import
com
.
itextpdf
.
text
.
pdf
.
PdfWriter
;
import
com
.
itextpdf
.
tool
.
xml
.
XMLWorkerHelper
;
public
class
App
{
public
static
void
main
(
String
[]
args
)
throws
DocumentException
,
IOException
{
// step 1
Document
document
=
new
Document
();
// step 2
PdfWriter
writer
=
PdfWriter
.
getInstance
(
document
,
new
FileOutputStream
(
"pdf.pdf"
));
// step 3
document
.
open
();
// step 4
XMLWorkerHelper
.
getInstance
().
parseXHtml
(
writer
,
document
,
new
FileInputStream
(
"index.html"
));
//step 5
document
.
close
();
System
.
out
.
println
(
"PDF Created!"
);
}
}
Back
|
FazBrowse Home
|
New Git URL