40
static Bitmap GetPreviewImage(string file
ˈ
Size targetSize)
static Bitmap GetPreviewImage(byte[] data,Size targetSize)
static Bitmap GetPreviewImage(Stream s,Size targetSize)
TIFF
Rendering
and
Conversion
RasterEdge Document Imaging SDK supports converting TIFF Document to various image or
document types with customized options. You can convert TIFF Document to PNG, JPEG, BMP,
and GIF image formats. You can also convert TIFF Document to SVG, which is a vector image
format that is supported by HTML5 standard and therefore supported by most of the up to date
web browsers. TIFF document can be converted to PDF file as well.
Convert
TIFF
Document
to
Image
Files
You can convert TIFF Document to a collection of image files with only one function.
void ConvertToImages(ImageType targetType,String directory, String fileName)
This method will automatically convert every page in the TIFF document to 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 to the resolution to enlarge the image dimension.
Convert
TIFFPage
to
Image
File
You can get specific TIFFPage object from tiff document by BasePage GetPage(int index). After
that you can render TIFFPage object to REImage or other common image formats with
customized parameters.
Related APIs:
REImage ConvertToImage()
REImage CropImage(Rectangle sourceRegion, Size targetSize)
void ConvertToImage(ImageType toType,String filePath)
For large TIFF images we recommend you to use CropImage API for methods with a REImage or
Bitamp object to return. It processes tiff images in partition. You can convert the image in parts
and then combine the partitions.
266
Convert
TIFFPage
to
Bitmap
In .Net framework Bitmap is a frequently used class in image processing. RasterEdge provide you
with APIs to directly convert TIFFPage 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 return a
REImage object taking into account that some additional operations 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. You can divide the big page into parts and deal with them separately. Typically if an
original tiff image or the resulting image magnified has a dimension product over 3000*3000,
we recommend you deal with them in partitions.
Bitmap GetBitmap(Rectangle sourceRectangle, Size targetSize) is a good choose.
Draw(Graphics g, PointF loaction)
void Draw(Graphics g, PointF loaction, Size targetSize )
Convert
TIFFDocument
to
PDF
You can convert TIFFDocument to PDF with just a few lines of code:
W
o
r
k
R
eg
i
s
tr
y
.
R
e
s
e
t();// i
nvoke
t
h
i
s
s
t
a
ti
c
m
e
t
hod
on
l
y
once
a
t t
he
beg
i
nn
i
ng
o
f
code
s
//l
oad
s
ou
r
ce
tiff fil
e
T
I
FF
D
ocu
m
en
t tif
=
ne
w
T
I
FF
D
ocu
m
en
t(tif
Pa
t
h
);
//
conve
rt tiff t
o
P
D
F
docu
m
en
t
tif.
C
onve
rt
To
D
ocu
m
en
t(D
ocu
m
en
t
Type
.
P
D
F
,
pd
fs
Ta
r
ge
t
Pa
t
h
);
//
c
l
ea
r t
e
m
p
fil
e
s
f
o
r
p
r
oce
ss
i
ng
t
h
i
s
tiff fil
e
// t
h
i
s
code
s
hou
l
d
be
exec
t
u
t
ed
a
ft
e
r
a
ll
ope
r
a
ti
on
s
on
tiffs
a
r
e
done
.
T
I
FF
D
ocu
m
en
t.
Cl
ea
r
T
m
pF
il
e
s();
Convert Other Document to TIFF Document
You can convert other document types to TIFFDocument object and save it to Tiff file.
Using the default JPEG compression
Sample code:
W
o
r
k
R
eg
i
s
tr
y
.
R
e
s
e
t();// i
nvoke
t
h
i
s
s
t
a
ti
c
m
e
t
hod
on
l
y
once
a
t t
he
beg
i
nn
i
ng
o
f
629
code
s
// l
oad
t
he
pd
f
docu
m
en
t t
o
conve
rt
//
you
can
a
l
s
o
conve
rt
docu
m
en
t
s
i
n
o
t
he
r t
ype
s
s
uch
a
s
w
o
r
d
,
exce
l t
o
T
I
FF
u
s
e
t
he
s
a
m
e
A
P
I
P
D
F
D
ocu
m
en
t
pd
f
=
ne
w
P
D
F
D
ocu
m
en
t(@
"c
:\R
E
Im
age
.
pd
f
"
);
//
conve
rt t
o
tiff fil
e
u
s
i
ng
de
f
au
lt
J
PE
G
co
m
p
r
e
ss
i
on
.
pd
f.
C
onve
rt
To
D
ocu
m
en
t(D
ocu
m
en
t
Type
.
T
I
FF
, @
"c
:\
pd
f
ToT
iff.tiff
"
);
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.
pd
f.
C
onve
rt
To
D
ocu
m
en
t(D
ocu
m
en
t
Type
.
T
I
FF
,
2
.
0
f, @
"
C:\
pd
ft
oT
iff
x1
.tif
"
);
You can specify compression type using the following code. For example you want to generate a
Black and White tiff you should use CCITID compression. Please note that the default JPEG
compression will in most cases produce the best performance in speed
Sample code:
// l
oad
t
he
pd
f
docu
m
en
t t
o
conve
rt
P
D
F
D
ocu
m
en
t
pd
fD
oc
=
ne
w
P
D
F
D
ocu
m
en
t(@
"F
:\
s
a
m
p
l
e
.
pd
f
"
);
i
n
t
page
C
oun
t
=
pd
fD
oc
.G
e
t
Page
C
oun
t();
R
E
Im
age
[] r
e
Im
age
s
=
ne
w
R
E
Im
age
[
page
C
oun
t];
C
o
l
o
rR
educ
ti
on
co
l
o
rR
educ
ti
on
=
ne
w
C
o
l
o
rR
educ
ti
on
();
//Us
e
C
o
l
o
rR
educ
ti
on
u
tilit
y
t
o
r
educe
t
he
im
age’
s
co
l
o
r
dep
t
h
t
o
8bpp
(
co
l
o
rD
ep
t
h
i
s
256
)
ǃ
4bpp
˄
co
l
o
rD
ep
t
h
i
s
16
˅
o
r
1bpp
(
co
l
o
rD
ep
t
h
i
s
2
).
P
l
ea
s
e
no
t
e
, t
o
app
l
y
t
he
co
m
p
r
e
ss
i
on
o
f
CCI
T1
D
ǃ
Gr
oup3Fax
and
Gr
oup4Fax
,t
he
im
age
m
u
s
t
be
a
t
a
co
l
o
r
dep
t
h
o
f
2
f
o
r (i
n
t i
=
0
; i
<
r
e
Im
age
s
.
Leng
t
h
; i
++
)
{
Bitm
ap
b
m
=
pd
fD
oc
.G
e
t
Page
(i).G
e
tBitm
ap
();
r
e
Im
age
s[i]
=
co
l
o
rR
educ
ti
on
.G
e
tR
E
Im
age
(
b
m,
2
);
}
T
I
FF
D
ocu
m
en
t tifD
oc
=
ne
w
T
I
FF
D
ocu
m
en
t(r
e
Im
age
s
,
T
I
FF
C
o
m
p
r
e
ss
i
on
.
CCI
TT1
D);
tifD
oc
.
Save
(@
"F
:\
Te
s
t.tif
"
);
TIFF
Annotation
You can add annotations like text and highlight on TIFF page. For detailed information about
annotation objects, please refer to Annotation section.
You need the following dll(s) to implement this feature.
RasterEdge.Imaging.TIFF.dll
RasterEdge.Imaging.Annotation.dll
RasterEdge.Imaging.Basic.dll
Sample code:
556
//
gene
r
a
t
e
t
he
anno
t
a
ti
on
ob
j
ec
t
A
nno
t
a
ti
on
H
and
l
e
r
anno
=
A
nno
t
a
ti
on
G
ene
r
a
t
o
r.
Cr
ea
t
eL
i
ne
A
nno
t
a
ti
on
(
ne
w
R
a
s
t
e
r
Edge
.Im
ag
i
ng
.A
nno
t
a
ti
on
.
B
a
s
i
c
.
L
i
nePo
i
n
t(
0
,
0
),
ne
w
R
a
s
t
e
r
Edge
.Im
ag
i
ng
.A
nno
t
a
ti
on
.
B
a
s
i
c
.
L
i
nePo
i
n
t(
100
,
100
));
//
c
r
ea
t
e
a
li
ne
anno
t
a
ti
on
s
t
a
rti
ng
a
t
po
i
n
t (
0
.
0
)
and
end
wit
h
po
i
n
t(
100
,
100
)
no
t
e
on
l
y
t
he
r
e
l
a
ti
ve
po
s
iti
on
o
f t
he
s
t
a
rt
and
end
po
i
n
t i
s
u
s
ed
.
T
I
FF
D
ocu
m
en
t
doc
=
ne
w
T
I
FF
D
ocu
m
en
t(@
"c
:\
s
a
m
p
l
e
.tif
"
);
T
I
FFPage
page
=
(
T
I
FFPage
)
doc
.G
e
t
Page
(
0
);
//
add
t
he
li
ne
a
t
po
i
n
t (
100
,
100
)
on
t
he
tiff
page
.
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
tiff im
age
.A
nd
t
he
r
e
f
o
r
e
s
ub
j
ec
t t
o
t
he
change
o
f t
he
s
i
ze
o
f t
he
tiff im
age
page
.A
dd
A
nno
t
a
ti
on
(
anno
);
doc
.
Save
(@
"c
:\
anno
t
a
t
edSa
m
p
l
e
.tif
"
);
See also Annotations
Editing
TIFF
Metadata
You can get the tag collection of the specific tiff page, which is comprised of EXIF Fields, TIFF
Fields and IPTC Fields. Every EXIF and TIFF Field is made up of a “tag”, a “dataType” and a
“values”. The IPTC field is made up of a“ID”, a “Section” and a “value”.
Sample code:
C#
Pub
li
c
Tag
C
o
ll
ec
ti
on
G
e
t
Tag
C
o
ll
ec
ti
on
(i
n
t
page
I
ndex
,
T
I
FF
D
ocu
m
en
t
doc
)
{
r
e
t
u
r
n
tifD
oc
.G
e
t
Tag
C
o
ll
ec
ti
on
(
page
I
ndex
);
}
Get the specific page’s XML information return as a string:
C#
pub
li
c
s
tri
ng
G
e
tXm
pS
tri
ng
(i
n
t
page
I
ndex
,
T
I
FF
D
ocu
m
en
t
doc
)
{
R
e
t
u
r
n
doc
.G
e
tXM
P
M
e
t
ada
t
a
(
0
);//
page
I
ndex
=
0
}
Add,
Delete,
Update
and
Find
ɷ
TIFF
Field
Assume you have retrieved the tag collection already, then you can edit the TIFF Field, we
provide 8 constructors to create a TIFF Field, and you can choose the field’s data type easily.
Note there are some important fields which can’t be removed. Otherwise the tiff file would be
corrupted. The TagID must be a hexadecimal.
C#
T
I
FF
F
i
e
l
d
C
on
s
tr
uc
t
o
r:
pub
li
c
T
I
FFF
i
e
l
d
(i
n
t t
ag
ID,
by
t
e
va
l
ue
);
771
pub
li
c
T
I
FFF
i
e
l
d
(i
n
t t
ag
ID,
by
t
e
[]
va
l
ue
s);
pub
li
c
T
I
FFF
i
e
l
d
(i
n
t t
ag
ID,
s
tri
ng
s
tr);
pub
li
c
T
I
FFF
i
e
l
d
(i
n
t t
ag
ID,
u
i
n
t
va
l
ue
);
pub
li
c
T
I
FFF
i
e
l
d
(i
n
t t
ag
ID,
u
i
n
t[]
va
l
ue
s);
pub
li
c
T
I
FFF
i
e
l
d
(i
n
t t
ag
ID,
u
s
ho
rt
va
l
ue
);
pub
li
c
T
I
FFF
i
e
l
d
(i
n
t t
ag
ID,
u
s
ho
rt[]
va
l
ue
s);
pub
li
c
T
I
FFF
i
e
l
d
(i
n
t t
ag
ID,
u
i
n
t fr
ac
,
u
i
n
t
deno
);
A
dd
T
I
FF
F
i
e
l
d
:
Note: the tagID must be hexadecimal and add a tiff field with an existing id is not permitted
vo
i
d
A
ddT
if
F
i
e
l
d
(i
n
t
page
I
ndex
,
T
I
FF
D
ocu
m
en
t tifD
oc
,
Tag
C
o
ll
ec
ti
on
t
ag
C
o
l)
{
t
ag
C
o
l.A
ddT
if
Tag
(
ne
w
T
I
FFF
i
e
l
d
(
0x1111
,
123
));
t
ag
C
o
l.A
ddT
if
Tag
(
ne
w
T
I
FFF
i
e
l
d
(
0x2222
,
ne
w
by
t
e
[
3
]
{
0
,
1
,
2
}
));
t
ag
C
o
l.A
ddT
if
Tag
(
ne
w
T
I
FFF
i
e
l
d
(
0x3333
,
ne
w
u
s
ho
rt[
3
]
{
0
,
1
,
2
}
));
t
ag
C
o
l.A
ddT
if
Tag
(
ne
w
T
I
FFF
i
e
l
d
(
0x4444
,
3
,
5
));
t
ag
C
o
l.A
ddT
if
Tag
(
ne
w
T
I
FFF
i
e
l
d
((i
n
t)
T
I
FFTag
.Arti
s
t,
"
www.
R
a
s
t
e
r
Edge
.
co
m
"
));
}
D
e
l
e
t
e
T
I
FF
F
i
e
l
d
:
Remove a TIFF Field form the specific page.
Note: there are some significant fields can’t be removed, if so,
the document would be corrupted. The tagID must be a hexadecimal
vo
i
d
D
e
l
e
t
eT
if
F
i
e
l
d
(i
n
t
page
I
ndex
,
T
I
FF
D
ocu
m
en
t tifD
oc
,
Tag
C
o
ll
ec
ti
on
t
ag
C
o
l)
{
t
ag
C
o
l.D
e
l
e
t
eT
if
Tag
(
0x1111
);//
you
can
de
fi
ne
a
t
ag
ID li
ke
t
h
i
s
t
ag
C
o
l.D
e
l
e
t
eT
if
Tag
((i
n
t)
T
I
FFTag
.Arti
s
t);//
o
r
u
s
e
ou
r
T
I
FFTag
Enu
m
}
U
pda
t
e
T
I
FF
F
i
e
l
d
:
Find the field which tagID is 0x1111,and change it’s value to 456, find the field which tagID is
Artist,and change it’s value to”Welcome to RasterEdge”
vo
i
d
U
pda
t
eT
if
F
i
e
l
d
(i
n
t
page
I
ndex
,
T
I
FF
D
ocu
m
en
t tifD
oc
,
Tag
C
o
ll
ec
ti
on
t
ag
C
o
)
{
t
ag
C
o
l.U
pda
t
eT
if
Tag
(
ne
w
T
I
FFF
i
e
l
d
(
0x1111
,
456
));
t
ag
C
o
l.U
pda
t
eT
if
Tag
(
ne
w
T
I
FFF
i
e
l
d
((i
n
t)
T
I
FFTag
.Arti
s
t,
"
W
e
l
co
m
e
t
o
R
a
s
t
e
r
Edge"
));
}
F
i
nd
T
I
FF
F
i
e
l
d
:
If there is a tiff field which tagID is Artist, then it willed be returned
T
I
FFF
i
e
l
d
F
i
ndT
if
F
i
e
l
d
(i
n
t
page
I
ndex
,
T
I
FF
D
ocu
m
en
t tifD
oc
,
Tag
C
o
ll
ec
ti
on
t
ag
C
o
l)
{
r
e
t
u
r
n
t
ag
C
o
l.
F
i
ndT
if
Tag
((i
n
t)
T
I
FFTag
.Arti
s
t);
}
Add
,Delete
,Update
and
Find
ɷ
EXIF
Field
The
m
an
i
pu
l
a
ti
on
o
f
E
XI
F
F
i
e
l
d
s
i
s
j
u
s
t
a
s
s
a
m
e
a
s
T
I
FF
F
i
e
l
d
s
852
Add
,Delete
,Update
and
Find
ɷ
IPTC
Field
C#
I
PT
C
F
i
e
l
d
C
on
s
tr
uc
t
o
r:
pub
li
c
I
PT
C
F
i
e
l
d
(
by
t
e
s
ec
ti
on
,
by
t
e
i
d
,
by
t
e
[]
da
t
a
);
pub
li
c
I
PT
C
F
i
e
l
d
(
by
t
e
s
ec
ti
on
,
by
t
e
i
d
,
s
tri
ng
s
tr);
A
dd
I
PT
C
F
i
e
l
d
:
vo
i
d
A
dd
I
p
t
cF
i
e
l
d
(i
n
t
page
I
ndex
,
T
I
FF
D
ocu
m
en
t tifD
oc
,
Tag
C
o
ll
ec
ti
on
t
ag
C
o
l)
{
t
ag
C
o
l.A
dd
I
PT
C
Tag
(
ne
w I
PT
C
F
i
e
l
d
(
2
,
2
,
ne
w
by
t
e
[
3
]
{
0
,
1
,
2
}
));
t
ag
C
o
l.A
dd
I
PT
C
Tag
(
ne
w I
PT
C
F
i
e
l
d
(
2
,
3
,
"
www.
R
a
s
t
e
r
Edge
.
co
m
"
));
}
D
e
l
e
t
e
I
PT
C
F
i
e
l
d
:
vo
i
d
D
e
l
e
t
e
I
p
t
cF
i
e
l
d
(i
n
t
page
I
ndex
,
T
I
FF
D
ocu
m
en
t tifD
oc
,
Tag
C
o
ll
ec
ti
on
t
ag
C
o
l)
{
t
ag
C
o
l.D
e
l
e
t
e
I
PT
C
Tag
(
ne
w I
PT
C
F
i
e
l
d
(
2
,
2
,
ne
w
by
t
e
[
3
]
{
0
,
1
,
2
}
));
t
ag
C
o
l.D
e
l
e
t
e
I
PT
C
Tag
(
ne
w I
PT
C
F
i
e
l
d
(
2
,
3
,
"
www.
R
a
s
t
e
r
Edge
.
co
m
"
));
}
U
pda
t
a
I
PT
C
F
i
e
l
d
:
vo
i
d
U
pda
t
e
I
p
t
cF
i
e
l
d
(i
n
t
page
I
ndex
,
T
I
FF
D
ocu
m
en
t tifD
oc
,
Tag
C
o
ll
ec
ti
on
t
ag
C
o
l)
{
//fi
nd
t
he
I
PT
C
F
i
e
l
d
, w
h
i
ch
s
ec
ti
on
i
s
2
and
i
d
i
s
2
,t
hen
change
it
’
s
va
l
ue
t
o
by
t
e
[]
{4
,
5
,
6}
//fi
nd
t
he
I
PT
C
F
i
e
l
d
,w
h
i
ch
s
ec
ti
on
i
s
2
and
i
d
i
s
2
,t
hen
change
it
’
s
va
l
ue
t
o
“
W
e
l
co
m
e
t
o
R
a
s
t
e
r
Edge”
t
ag
C
o
l.U
pda
t
e
I
PT
C
Tag
(
ne
w I
PT
C
F
i
e
l
d
(
2
,
2
,
ne
w
by
t
e
[
3
]
{
4
,
5
,
6
}
));
t
ag
C
o
l.U
pda
t
e
I
PT
C
Tag
(
ne
w I
PT
C
F
i
e
l
d
(
2
,
3
,
"
W
e
l
co
m
e
t
o
R
a
s
t
e
r
Edge"
));
}
F
i
nde
I
PT
C
F
i
e
l
d
:
L
i
s
t
<
I
PT
C
F
i
e
l
d>F
i
nd
I
p
t
cF
i
e
l
d
(i
n
t
page
I
ndex
,
T
I
FF
D
ocu
m
en
t tifD
oc
,
Tag
C
o
ll
ec
ti
on
t
ag
C
o
l)
{
//if t
he
r
e
i
s
a
i
p
t
c
fi
e
l
d
,w
h
i
ch
s
ec
ti
on
i
s
2
and
i
d
i
s
3
, t
hen
it will
be
r
e
t
u
r
ned
//
no
t
e
:
a
i
p
t
c
fi
e
l
d
ha
s
t
he
s
a
m
e
s
ec
ti
on
and
i
d
a
s
ano
t
he
r i
s
pe
rmmit
ed
r
e
t
u
r
n
t
ag
C
o
l.
F
i
nd
I
PT
C
Tag
(
2
,
3
);
}
Get
the
XML
Information
The xml information is parsed from the tiff tag named XmpData
C#
S
tri
ng
G
e
tXm
pS
tri
ng
(i
n
t
page
I
ndex
,
T
I
FF
D
ocu
m
en
t tifD
oc
)
{
r
e
t
u
r
n
tifD
oc
.G
e
tXM
P
M
e
t
ada
t
a
(
0
);
}
201
Editing
TIFF
Document
Re-Order
Pages
of
TIFF
File
With TIFF processing dll, it is easy for you to re-order pages of a TIFF document as long as you
provide a new order sequence. See the sample code below:
C#
pub
li
c
vo
i
d
So
rt
Page
s(
S
tri
ng
fil
ePa
t
h
, i
n
t[]
page
Or
de
r)
{
T
I
FF
D
ocu
m
en
t
doc
=
ne
w
T
I
FF
D
ocu
m
en
t(fil
ePa
t
h
);
doc
.
So
rt
Page
(
page
Or
de
r);
}
Swap
two
pages
of
TIFF
File
You can swap two pages of the tiff file, suppose you have a TIFFDocument object already.
C#
Pub
li
cvo
i
d
SwapPages(
i
n
t
pageIdxF,
i
n
t
pageIdxB,
T
I
FF
D
ocu
m
en
t
tifDoc)
{
tifD
oc
.
S
w
apT
w
oPage
s(
page
I
dxF
,
page
I
dx
B);
}
Insert
Pages
to
TIFF
File
You can also insert pages to TIFF document. Suppose you have a TIFFPage class object named
page, you can do something like this,
C#
pub
li
c
vo
i
d
I
n
s
e
rt
PageToF
il
e
(
S
tr
ea
m
s
, i
n
t i
ndex
,
T
I
FFPage
page
)
{
T
I
FF
D
ocu
m
en
t
doc
=
ne
w
T
I
FF
D
ocu
m
en
t(s);
doc
.I
n
s
e
rt
Page
(
page
, i
ndex
);
}
Delete
Pages
from
TIFF
File
Now you can delete pages of the TIFF file, Input is page index list that you want to delete.
Suppose you have a TIFFDocument class object named document.
C#
292
pub
li
c
vo
i
d
D
e
l
e
t
ePageF
r
o
mD
ocu
m
en
t(
T
I
FF
D
ocu
m
en
t
docu
m
en
t, i
n
t
page
I
dx
)
{
docu
m
en
t.D
e
l
e
t
ePage
(
page
I
dx
);
}
pub
li
c
vo
i
d
D
e
l
e
t
ePage
s
F
r
o
mD
ocu
m
en
t(
T
I
FF
D
ocu
m
en
t
docu
m
en
t, i
n
t[]
page
I
dx
s)
{
docu
m
en
t.D
e
l
e
t
ePage
s(
page
I
dx
s);
}
Split
TIFF
File
To split TIFF document, you can use TIFFDocument class. There is a static method called
SplitDocument, which takes either an input Stream or an input path, an input index and a list of
output paths or output Streams. For example, if the target file has eight pages and you input
two as the page index using SplitDocument, then the first three pages(index starts at 0) will be
included in one TIFF document and the rest of five pages will be included in the other TIFF file.
C#
pub
li
c
vo
i
d
s
p
lit
T
I
FF
D
ocu
m
en
t(s
tri
ng
s
ou
r
ceF
il
ePa
t
h
, i
n
t
page
I
dx
,
s
tri
ng
[]
de
s
t
n
s
Pa
t
h
)
{
T
I
FF
D
ocu
m
en
t.
Sp
litD
ocu
m
en
t(s
ou
r
ceF
il
ePa
t
h
,
page
I
dx
,
de
s
t
n
s
Pa
t
h
);
}
Combine
TIFF
File
Using TIFFDocument class, you can also combine TIFF documents. There is a static method
called Combine, which takes either an output Stream or an output path and any number of
input paths or input Streams. The input TIFF documents are combined in order to create one
output TIFF document.
C#
pub
li
c
vo
i
d
C
o
m
b
i
ne
D
ocu
m
en
tA
ndSave
It
ToF
il
e
(s
tri
ng
[]
docL
i
s
t,
s
tri
ng
de
s
t
nF
il
ePa
t
h
)
{
T
I
FF
D
ocu
m
en
t.
C
o
m
b
i
ne
D
ocu
m
en
t(
docL
i
s
t,
de
s
t
nF
il
ePa
t
h
);
}
Generate
Barcode
on
TIFF
RasterEdge Barcode processing dll offers comprehensive functions for developers to generate
and design both 1d & 2d barcode images on TIFF file.
Sample Code:
559
//
gene
r
a
t
e
an
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
=
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
tiff
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,
pp
t
T
I
FF
D
ocu
m
en
t tiff
=
ne
w
T
I
FF
D
ocu
m
en
t(@
"c
:\
s
a
m
p
l
e
.tiff
"
);
//
ge
t t
he
firs
t
page
B
a
s
ePage
page
=
tiff.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
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
tiff
tiff.
Save
(@
"c
:\
s
a
m
p
l
e
.tiff
"
);
Read
Barcode
Information
from
TIFF
You can read barcode information from tiff document.
Sample code:
pub
li
c
s
t
a
ti
c
vo
i
d
R
ead
B
a
r
codeF
r
o
m
T
I
FF
(s
tri
ng
fil
ena
m
e
, i
n
t
page
I
ndex
)
{
//
gene
r
a
t
e
tiff
docu
m
en
t
T
I
FF
D
ocu
m
en
t
doc
=
ne
w
T
I
FF
D
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
(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
);
}
}
How
to
750
How
to
View
Thumbnail
Image
of
ɷ
TIFF
Document
With RasterEdge document Imaging APIs, you can generate image out of document with proper
image size set. To view thumbnail images of a tiff document, you can set a smaller image size.
W
o
r
k
R
eg
i
s
tr
y
.
R
e
s
e
t();// i
nvoke
t
h
i
s
s
t
a
ti
c
m
e
t
hod
on
l
y
once
a
t t
he
beg
i
nn
i
ng
o
f
code
s
T
I
FF
D
ocu
m
en
t
doc
=
ne
w
T
I
FF
D
ocu
m
en
t(@
"c
:\
s
a
m
p
l
e
.tif
"
);
s
tri
ng
t
hu
m
bna
ilDir
ec
t
o
r
y
=
@
"c
:\t
hu
m
bna
il
"
;
i
n
t
page
C
oun
t
=
doc
.G
e
t
Page
C
oun
t();
f
o
r (i
n
t i
=
0
; i
<
page
C
oun
t; i
++
)
{
//
ge
t tiff
page
T
I
FFPage
page
=
(
T
I
FFPage
)
doc
.G
e
t
Page
(i);
//
gene
r
a
t
e
t
hu
m
bna
il im
age
o
f
50
p
i
xe
l wi
de
and
100
p
i
xe
l
h
i
gh
R
E
Im
age
im
g
=
page
.
C
onve
rt
To
Im
age
(
ne
w
S
i
ze
(
50
,
100
));
//
s
ave
t
he
t
hu
m
na
il im
age
unde
r t
he
d
ir
ec
t
o
r
y
im
g
.
Save
(Im
ageType
.
P
NG, t
hu
m
bna
ilDir
ec
t
o
r
y
+
@
"
\
s
a
m
p
l
e"
+
i
+
@
"
.
png"
);
}
How
to
Generate
Magnified
Images
of
TIFFDocument
You can set the zoom factor of the target image.
W
o
r
k
R
eg
i
s
tr
y
.
R
e
s
e
t();// i
nvoke
t
h
i
s
s
t
a
ti
c
m
e
t
hod
on
l
y
once
a
t t
he
beg
i
nn
i
ng
o
f
code
s
//l
oad
T
I
FF
docu
m
en
t
T
I
FF
D
ocu
m
en
t
doc
=
ne
w
T
I
FF
D
ocu
m
en
t(@
"c
:\
s
a
m
p
l
e
.tif
"
);
//
Se
t
d
ir
ec
t
o
r
y
t
o
s
t
o
r
e
t
he
zoo
m
ed
im
age
s
tri
ng
Im
age2
X
=
@
"c
:\
Sa
m
p
l
e2
X
"
;
//
conve
rt
T
I
FF
t
o
png
im
age
s
wit
h
a
zoo
m f
ac
t
o
r
o
f
2
f r
e
m
e
m
be
r t
o
s
e
t t
he
f
ac
t
o
r t
o
be
a
fl
oa
t
nu
m
be
r
doc
.
C
onve
rt
To
Im
age
s(Im
ageType
.
P
NG,
2
f, Im
age2
X,
"
s
a
m
p
l
e"
);
//
o
r if
you
kno
w t
he
de
s
ir
ed
r
e
s
o
l
u
ti
on
t
o
gene
r
a
t
e
t
he
im
age
you
can
s
e
t t
he
r
e
s
o
l
u
ti
on
doc
.
C
onve
rt
To
Im
age
s(Im
ageType
.
P
NG,
192
, Im
age2
X,
"
s
a
m
p
l
e"
);
Because in some cases you only need to show part of the image magnified, we provide you with
API to crop the TIFF image. This API costs fewer resources and less process time.
W
o
r
k
R
eg
i
s
tr
y
.
R
e
s
e
t();// i
nvoke
t
h
i
s
s
t
a
ti
c
m
e
t
hod
on
l
y
once
a
t t
he
beg
i
nn
i
ng
o
f
code
s
//l
oad
tiff
page
T
I
FF
D
ocu
m
en
t
doc
=
ne
w
T
I
FF
D
ocu
m
en
t(@
"c
:\
s
a
m
p
l
e
.tif
"
);
//
ge
t t
he
firs
t
page
o
f t
he
tiff
docu
m
en
t
T
I
FFPage
page
=
(
T
I
FFPage
)
doc
.G
e
t
Page
(
0
);
//
s
e
t t
he
pa
rt
o
f t
he
o
ri
g
i
na
l tiff im
age
t
ha
t
you
w
an
t t
o
c
r
op
.
//
The
s
i
ze
and
po
s
ti
on
i
s
m
ea
s
u
r
ed
a
t
96
r
e
s
o
l
u
ti
on
, w
h
i
ch
i
s
t
he
no
rm
a
l r
e
s
o
l
u
ti
on
Documents you may be interested
Documents you may be interested