141
//
The
po
s
iti
on
i
s
m
ea
s
u
r
ed
a
t
de
f
au
lt
96
r
e
s
o
l
u
ti
on
wit
h
r
e
s
pec
t t
o
t
he
po
w
e
r
po
i
n
t
page
r
ende
r
ed
a
s
im
age
.
page
.A
dd
A
nno
t
a
ti
on
(
anno
);
//
s
ave
t
he
m
od
ifi
ed
pp
t
x
back
t
o
fil
e
doc
.
Save
(@
"c
:\
anno
t
a
t
edSa
m
p
l
e
.
pp
t
x"
);
PowerPoint
Rendering
and
Conversions
RasterEdge Document Imaging SDK supports converting PowerPoint document to various image
and document types with customized options. You can convert PowerPoint Document to PNG,
JPEG, BMP, and GIF image formats. You can also convert PowerPoint Document to other
document types including TIFF, PDF and SVG. SVG is a vector image format that is supported by
HTML5 standard and therefore can be viewed at most of the up to date web browsers.
Convert
PPTXDocument
to
Images
You can convert PPTXDocument to raster images collection. This is a batch operation with
customized options.
Related APIs:
void ConvertToImages(ImageType targetType, String directory, String fileName)
These methods will automatically convert every page in PPTXDocument to an image file, with
the page index append to fileName. Note that, the resolution is default to be 96 dpi for monitor
displaying purpose. You can adjust resolution to enlarge or reduce the size of image file. You
can also specify the zoomValue to cause the same effect.
Convert
PPTXPage
to
Image
File
To get full control over the rendering process, you can work with PPTXPage object. First get
specific PPTXPage object from ppt document by BasePage GetPage(int index),and then you can
render PPTXPage object to REImage or other common n image formats with customized d
parameters.
Related APIs:
REImage CropImage(Rectangle sourceRegion, Size targetSize)
REImage ConvertToImage()
void ConvertToImage(ImageType toType,String filePath)
void ConvertToImage(ImageType toType,int resolution, String filePath)
227
If you want to zoom in page with a large factor, say 8x and generate an image out of the whole
page. This will cost not only a very high usage of memory resource but also a considerable
amount of time to proceed. The common practice is to show part of page with a zoom in factor
(usually fit to your screen) at a time. And the CropImage API is designed for this purpose.
Convert
PPTXPage
to
Bitmap
In .Net framework Bitmap is a frequently used class in image processing. RasterEdge provide you
with APIs to directly convert PPTXPage to Bitmap objects which then can be drew on graphics of
for example win form controls. These APIs returning a Bitmap object are faster than those
returning a REImage object taking into account that additional operations are needed with
REImage.
Bitmap GetBitmap()
Bitmap GetBitmap(float zoomValue)
Bitmap GetBitmap(Rectangle sourceRectangle, Size targetSize)
Note that the resulting Bitmap cannot be too big to handle due to the restriction of system
memory. Typically if a resulting Bitmap zoomed or not has a dimension product over
3000*3000, we recommend you deal with it in partitions. The API Bitmap
GetBitmap(Rectangle sourceRectangle, Size targetSize) is a good choose.
You can also draw the page directly onto a graphics using the following APIs
Draw(Graphics g, PointF loaction)
void Draw(Graphics g, PointF loaction, Size targetSize )
Convert
PPTXDocument
to
PDF
or
TIFF
File
Sample code:
pub
li
c
s
t
a
ti
c
vo
i
d
Te
s
tC
onve
rt
PPT
X
ToP
D
F
(s
tri
ng
s
ou
r
ceF
il
ePa
t
h
,
s
tri
ng
t
a
r
ge
t
F
il
ePa
t
h
)
{
// l
oad
po
w
e
r
po
i
n
t
docu
m
en
t
PPT
XD
ocu
m
en
t
doc
=
ne
w
PPT
XD
ocu
m
en
t(s
ou
r
ceF
il
ePa
t
h
);
//
conve
rt
pp
t
x
t
o
pd
f
and
s
ave
t
o
t
a
r
ge
t fil
e
pa
t
h
doc
.
C
onve
rt
To
D
ocu
m
en
t(D
ocu
m
en
t
Type
.
P
D
F
, t
a
r
ge
t
F
il
ePa
t
h
);
////
conve
rt
pp
t
x
t
o
tiff
and
s
ave
t
o
t
a
r
ge
t fil
e
pa
t
h
//
doc
.
C
onve
rt
To
D
ocu
m
en
t(D
ocu
m
en
t
Type
.
T
I
FF
, t
a
r
ge
t
F
il
ePa
t
h
);
245
}
If
you
need
gene
r
a
t
e
t
he
tiff fil
e
wit
h
a
g
r
ea
t
e
r r
e
s
o
l
u
ti
on
(
o
r
b
i
gge
r
s
i
ze
)
you
can
u
s
e
t
he
f
o
ll
o
wi
ng
code
t
o
gene
r
a
t
e
an
x2
r
e
s
o
l
u
ti
on
tiff.
doc
.
C
onve
rt
To
D
ocu
m
en
t(D
ocu
m
en
t
Type
.
T
I
FF
,
2
.
0
f, @
"
C:\
x2
.tif
"
);
Convert
PPTX
To
SVG
SVG part of HTML5 standard, therefore it can viewed directly using most of the modern
browsers without installing additional plugin or add-on on the end user’s computer.
Related APIs:
DOCXDocument.ConvertToVectorImages(ContextType targetType, String directory, String
fileName,RelativeType type);
DOCXPage.ConvertToVectorImage(ContextType targetType, String directory, String
fileName,RelativeType type);
SVG file generated can be used in one of the two ways:
1. Svg file can be used as a stand-alone external resource of a web page. In this case the
resources such as font and image files referenced by svg file are mapped by a relative
path with respect to the svg file itself. Choose RelativeType.SVG as input parameter
when you use svg file as an external resource.
2. The content of svg file may be extracted from it and embedded into html code in a web
application. If this is the case the resources referenced is mapped through a relative
path to the web project working directory. Choose RelativeType.ASP as input parameter
in this situation.
C# sample code
s
tri
ng
fil
ePa
t
h
=
@
"c
\
s
a
m
p
l
e
.
pp
t
x"
;
//
d
ir
ec
t
o
r
y
t
o
s
t
o
r
e
t
he
s
vg
fil
e
and
r
e
s
ou
r
ce
s
s
tri
ng
s
vg
fil
e
Dir
ec
t
o
r
y
=
@
"c
\
s
a
m
p
l
e
\
"
;
// l
oad
w
o
r
d
fil
e
t
o
c
r
ea
t
PPT
XD
ocu
m
en
t
ob
j
ec
t
PPT
XD
ocu
m
en
t
doc
=
ne
w
PPT
XD
ocu
m
en
t (fil
ePa
t
h
);
619
//
you
can
conve
rt t
he
w
ho
l
e
docu
m
en
t t
o
a
li
s
t
o
f
s
vg
fil
e
s
//
each
page
o
f t
he
docu
m
en
t i
s
r
ende
r
d
t
o
a
s
vg
fil
e
wit
h
page
i
ndex
//
appended
//t
o
t
he
fil
e
na
m
e
doc
.
C
onve
rt
To
V
ec
t
o
rIm
age
s(C
on
t
ex
t
Type
.
S
VG,
s
vg
fil
e
Dir
ec
t
o
r
y
,
"Sa
m
p
l
eS
VG
"
,
R
e
l
a
ti
veType
.
S
VG);
//
o
r
you
can
conve
rt
s
pec
ifi
c
page
t
o
s
vg
fil
e
// G
e
t t
he
firs
t
page
o
f
docu
m
en
t
and
conve
rt it t
o
s
vg
fil
e
PPT
X
Page
page
=
(
PPT
X
Page
)
doc
.G
e
t
Page
(
0
);
page
.
C
onve
rt
To
V
ec
t
o
rIm
age
(C
on
t
ex
t
Type
.
S
VG,
s
vg
fil
e
Dir
ec
t
o
r
y
,
"Sa
m
p
l
eS
VG
"
,
R
e
l
a
ti
veType
.
S
VG);
// if
you
w
an
t t
o
e
m
bed
t
he
s
vg
con
t
en
t i
n
t
o
h
tml
code
i
n
you
r w
eb
app
li
ca
ti
on
// t
he
r
e
l
a
ti
ve
pa
t
h
i
s
t
o
you
r w
eb
p
r
o
j
ec
t w
o
r
k
i
ng
d
ir
ec
t
o
r
y
,
change
t
he
//
pa
r
a
mt
e
r li
ke
t
h
i
s
doc
.
C
onve
rt
To
V
ec
t
o
rIm
age
s(C
on
t
ex
t
Type
.
S
VG,
s
vg
fil
e
Dir
ec
t
o
r
y
,
"Sa
m
p
l
eS
VG
"
,
R
e
l
a
ti
veType
.A
SP
);
}
Create
Barcode
in
PowerPoint
RasterEdge Barcode processing dll offers comprehensive functions for developers to generate
and design both 1d & 2d barcode images on power point file.
Sample Code:
//
gene
r
a
t
e
a
code39
ba
r
code
L
i
nea
r li
nea
rB
a
r
code
=
ne
w
L
i
nea
r();
li
nea
rB
a
r
code
.
Type
=
R
a
s
t
e
r
Edge
.Im
ag
i
ng
.
B
a
r
code
.
Cr
ea
t
o
r.
B
a
r
codeType
.
COD
E39
;
li
nea
rB
a
r
code
.D
a
t
a
=
"123456789"
;
li
nea
rB
a
r
code
.
R
e
s
o
l
u
ti
on
=
96
;
li
nea
rB
a
r
code
.
R
o
t
a
t
e
=
R
o
t
a
t
e
.
R
o
t
a
t
e0
;
// l
oad
pp
t
docu
m
en
t,
you
can
a
l
s
o
l
oad
docu
m
en
t li
ke
tiff, w
o
r
d
,
exce
l,
pd
f
PPT
XD
ocu
m
en
t
doc
=
ne
w
PPT
XD
ocu
m
en
t(@
"c
:\
s
a
m
p
l
e
.
pp
t
x"
);
//
ge
t t
he
firs
t
page
B
a
s
ePage
page
=
doc
.G
e
t
Page
(
0
);
//
gene
r
a
t
e
r
e
im
age
o
f t
h
i
s
ba
r
code
R
E
Im
age
ba
r
code
Im
age
=
li
nea
rB
a
r
code
.
To
Im
age
();
//
add
ba
r
code
im
age
t
o
t
he
firs
t
page
455
page
.A
dd
Im
age
(
ba
r
code
Im
age
,
ne
w
Sy
s
t
e
m.Dr
a
wi
ng
.
Po
i
n
t
F
(
100
f,
100
f));
//
s
ave
change
s
t
o
t
he
po
w
e
r
po
i
n
t
doc
.
Save
(@
"c
:\
s
a
m
p
l
e
.
pp
t
x"
);
See Also Barcode Create
Read
Barcode
from
PowerPoint
You can read barcode information from powerpoint document.
Sample code:
pub
li
c
s
t
a
ti
c
vo
i
d
R
ead
B
a
r
codeF
r
o
m
PPT
(s
tri
ng
fil
ena
m
e
, i
n
t
page
I
ndex
)
{
//
gene
r
a
t
e
po
w
e
r
po
i
n
t
docu
m
en
t
PPT
XD
ocu
m
en
t
doc
=
ne
w
PPT
XD
ocu
m
en
t(fil
ena
m
e
);
//
ge
t t
he
page
you
w
an
t t
o
r
ead
ba
r
code
fr
o
m
B
a
s
ePage
page
=
doc
.G
e
t
Page
(
page
I
ndex
);
//
s
e
t r
eade
r
s
e
tti
ng
R
eade
r
Se
tti
ng
s
s
e
tti
ng
=
ne
w
R
eade
r
Se
tti
ng
s();
s
e
tti
ng
.A
ddType
s
To
R
ead
(R
a
s
t
e
r
Edge
.Im
ag
i
ng
.
B
a
r
code
.
Scanne
r.
B
a
r
codeType
.
C
ode39
);
// r
ead
ou
t
ba
r
code
i
n
f
o
rm
a
ti
on
B
a
r
code
[]
ba
r
code
s
=
B
a
r
code
R
eade
r.
R
ead
B
a
r
code
s(s
e
tti
ng
,
page
);
//
ou
t
pu
t
ba
r
code
i
n
f
o
rm
a
ti
on
f
o
r
each
(B
a
r
code
ba
r
code
i
n
ba
r
code
s)
{
C
on
s
o
l
e
.Writ
eL
i
ne
(
ba
r
code
.D
a
t
aS
tri
ng
);
}
}
See also Barcode read
How
to’s
How
to:
Create
Thumbnail
of
PowerPoint
Document
You can convert powerpoint document to image files with a zoom factor suitable for thumbnail
image.
// l
oad
Po
w
e
r
Po
i
n
t
docu
m
en
t
PPT
XD
ocu
m
en
t
doc
=
ne
w
PPT
XD
ocu
m
en
t(@
"c
:\
s
a
m
p
l
e
.
pp
t
x"
);
//
co
m
pu
t
e
zoo
m
ou
t f
ac
t
o
r
//
ge
t t
he
firs
t
page
a
s
s
a
m
p
l
e
page
PPT
X
Page
page
=
(
PPT
X
Page
)
doc
.G
e
t
Page
(
0
);
230
// t
he
o
ri
g
i
na
l
he
i
gh
t
and
wi
d
t
h
a
r
e
m
ea
s
u
r
ed
a
t
96
dp
i
fl
oa
t
o
ri
g
i
na
lWi
d
t
h
=
page
.G
e
tWi
d
t
h
()
*
96
;
//
a
ss
u
m
e
you
w
an
t
a
t
hu
m
bna
il
s
i
ze
o
f
100
p
i
xe
l i
n
wi
d
t
h
and
co
m
pu
t
e
t
he
zoo
mf
ac
t
o
r
fl
oa
t
zoo
m
Fac
t
o
r
=
100
f /
o
ri
g
i
na
lWi
d
t
h
;
s
tri
ng
d
ir
ec
t
o
r
y
=
@
"c
:\
Thu
m
bna
il
"
;
//
con
s
tr
uc
t t
hu
m
bna
il im
age
unde
r t
he
d
ir
ec
t
o
r
y
wit
h
fil
e
s
na
m
e
o
f t
he
pa
tt
e
r
n
t
hu
m
a
il
01
.
png
, t
hu
m
na
il
02
.
png
doc
.
C
onve
rt
To
Im
age
s(Im
ageType
.
P
NG,
zoo
m
Fac
t
o
r,
d
ir
ec
t
o
r
y
,
"
t
hu
m
bna
il
"
);
133
DICOM
DICOM
Overview
DICOM (Digital imaging and Communications in Medicine) is an international standard (ISO
12052) respective to medical imaging and its related workflow & data management. It defines
the file format that can be used for data exchange in clinical circumstances demand. Among
tens of thousands of medical imaging devices, DICOM is one of the most widely used medical
information standards. In 1993, ACR-NEMA Joint Commission released the third version of
DICOM standard (DICOM 3.0) which is regarded as the international standard in the field of
medical imaging informatics. It covers almost all information exchange protocols for medical
digital image, like image acquisition, archiving, communication, display and search. The
implementation of DICOM standard greatly simplifies the exchange of medical image
information and promotes the research and development of teleradiology system and image
management and communication system (PACS). In addition, openness and connectivity of
DICOM makes it possible to be integrated with other medical application systems (HIS, RIS).
Programming
with
DICOM
There are two important classes in DICOM programming, DCMDocument and DCMPage. Every
Dicom file is represented as a DCMDocument object, and the images and related information is
represented as DCMPage object.
Load
DICOM
File
You can load a file, stream or byte[] containing a Dicom document as a DCMDocument object.
DCMD
ocu
m
en
t
doc
=
ne
w DCMD
ocu
m
en
t(@
"c
:\
a
.
dc
m
"
);
Convert
DICOM
to
Image
files
You can convert Dicom document with one or multiple pages to images collection and save it to
file.
Sample code:
//i
nvoke
t
h
i
s
m
e
t
hod
on
l
y
once
a
t t
he
beg
i
nn
i
ng
o
f
you
r
code
t
o
r
eg
i
s
t
e
r
a
ll
a
ss
e
m
b
li
e
s
you
r
e
f
e
r
enced
t
o
you
r
p
r
o
j
ec
t
W
o
r
k
R
eg
i
s
tr
y
.
R
e
s
e
t();
Documents you may be interested
Documents you may be interested