FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
excel_pdf/JavaTPCProject/src/Project04_D.java at master · TypeP/excel_pdf · GitHub
TypeP
excel_pdf
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
excel_pdf
/
JavaTPCProject
/
src
/
Project04_D.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (33 loc) · 1.09 KB
Breadcrumbs
excel_pdf
/
JavaTPCProject
/
src
/
Project04_D.java
Copy path
File metadata and controls
43 lines (33 loc) · 1.09 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import
java
.
io
.
FileOutputStream
;
import
com
.
itextpdf
.
text
.
Document
;
import
com
.
itextpdf
.
text
.
Image
;
import
com
.
itextpdf
.
text
.
pdf
.
PdfWriter
;
public
class
Project04_D
{
public
static
void
main
(
String
[]
args
) {
//https://www.google.co.kr/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png
Document
doc
=
new
Document
();
try
{
PdfWriter
.
getInstance
(
doc
,
new
FileOutputStream
(
"ImageScaling.pdf"
));
doc
.
open
();
String
fileName
=
"googlelogo.png"
;
Image
image
=
Image
.
getInstance
(
fileName
);
doc
.
add
(
image
);
fileName
=
"googlelogo.png"
;
image
=
Image
.
getInstance
(
fileName
);
image
.
scaleAbsolute
(
200f
,
200f
);
doc
.
add
(
image
);
String
url
=
"https://www.google.co.kr/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"
;
image
=
Image
.
getInstance
(
url
);
image
.
scalePercent
(
200f
);
doc
.
add
(
image
);
image
=
Image
.
getInstance
(
url
);
image
.
scaleToFit
(
100f
,
200f
);
doc
.
add
(
image
);
System
.
out
.
println
(
"크기 조절 성공"
);
}
catch
(
Exception
e
) {
e
.
printStackTrace
();
}
finally
{
doc
.
close
();
}
}
}
Back
|
FazBrowse Home
|
New Git URL