pdf viewer in asp net c# : Add jpg to pdf file software SDK project winforms wpf azure UWP postgresql-9.4-A430-part2946

Chapter 9. Functions and Operators
statement (more specifically, the time of receipt of the latest command message from the
client).
statement_timestamp()
and
transaction_timestamp()
return the same value
during the first command of a transaction, but might differ during subsequent commands.
clock_timestamp()
returns the actual current time, and therefore its value changes even
within a single SQL command.
timeofday()
is a historical PostgreSQL function. Like
clock_timestamp()
, it returns the actual current time, but as a formatted
text
string rather
than a
timestamp with time zone
value.
now()
is a traditional PostgreSQL equivalent to
transaction_timestamp()
.
All the date/time data types also accept the special literal value
now
to specify the current date and
time (again, interpreted as the transaction start time). Thus, the following three all return the same
result:
SELECT CURRENT_TIMESTAMP;
SELECT now();
SELECT TIMESTAMP ’now’;
-- incorrect for use with DEFAULT
Tip: You do not want to use the third form when specifying a
DEFAULT
clause while creating a
table. The system will convert
now
to a
timestamp
as soon as the constant is parsed, so that
when the default value is needed, the time of the table creation would be used! The first two
forms will not be evaluated until the default value is used, because they are function calls. Thus
they will give the desired behavior of defaulting to the time of row insertion.
9.9.5. Delaying Execution
The following functions are available to delay execution of the server process:
pg_sleep(
seconds
)
pg_sleep_for(
interval
)
pg_sleep_until(
timestamp with time zone
)
pg_sleep
makes the current session’s process sleep until
seconds
seconds have elapsed.
seconds
is a valueof type
double precision
,so fractional-second delays canbe specified.
pg_sleep_for
is a convenience function for larger sleep times specified as an
interval
.
pg_sleep_until
is a
convenience function for when a specific wake-up time is desired. For example:
SELECT pg_sleep(1.5);
SELECT pg_sleep_for(’5 minutes’);
SELECT pg_sleep_until(’tomorrow 03:00’);
Note:The effective resolutionof the sleepinterval is platform-specific; 0.01 seconds is acommon
value. The sleep delay willbeat least aslong as specified. It might belonger depending on factors
such as server load. In particular,
pg_sleep_until
is not guaranteed to wake up exactly at the
specified time, but it will not wake up any earlier.
228
Add jpg to pdf file - insert images into PDF in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Sample C# code to add image, picture, logo or digital photo into PDF document page using PDF page editor control
add image to pdf preview; add image to pdf form
Add jpg to pdf file - VB.NET PDF insert image library: insert images into PDF in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Guide VB.NET Programmers How to Add Images in PDF Document
adding an image to a pdf file; add picture to pdf
Chapter 9. Functions and Operators
Warning
Make sure that your session does not hold more locks than necessary when
calling
pg_sleep
or its variants. Otherwise other sessions might have to wait
for your sleeping process, slowing down the entire system.
9.10. Enum Support Functions
For enum types (describedinSection8.7), there are severalfunctions thatallowcleaner programming
without hard-coding particular values of an enum type. These are listed in Table 9-30. The examples
assume an enum type created as:
CREATE TYPE rainbow AS ENUM (’red’, ’orange’, ’yellow’, ’green’, ’blue’, ’purple’);
Table 9-30. Enum Support Functions
Function
Description
Example
Example Result
enum_first(anyenum)
Returns the first value
of the input enum type
enum_first(null::rainbow)
red
enum_last(anyenum)
Returns the last value
of the input enum type
enum_last(null::rainbow)
purple
enum_range(anyenum)
Returns all values of
the input enum type in
an ordered array
enum_range(null::rainbow)
{red,orange,yellow,green,blue,purple}
enum_range(anyenum,
anyenum)
Returns the range
between the two given
enum values, as an
ordered array. The
values must be from
the same enum type. If
the first parameter is
null, the result will
start with the first value
of the enum type. If the
second parameter is
null, the result will end
with the last value of
the enum type.
enum_range(’orange’::rainbow,
’green’::rainbow)
{orange,yellow,green}
enum_range(NULL,
’green’::rainbow)
{red,orange,yellow,green}
enum_range(’orange’::rainbow,
NULL)
{orange,yellow,green,blue,purple}
Notice that except for the two-argument form of
enum_range
,these functions disregard the specific
value passed to them; they care only about its declared data type. Either null or a specific value of
the type can be passed, with the same result. It is more common to apply these functions to a table
column or function argument than to a hardwired type name as suggested by the examples.
229
VB.NET PDF Convert to Jpeg SDK: Convert PDF to JPEG images in vb.
Add necessary references page As PDFPage = doc.GetPage(0) ' Convert the first PDF page to page.ConvertToImage(ImageType.JPEG, Program.RootPath + "\\Output.jpg").
add a picture to a pdf file; how to add image to pdf reader
C# PDF Convert to Jpeg SDK: Convert PDF to JPEG images in C#.net
example, this C#.NET PDF to JPEG converter library will name the converted JPEG image file Output.jpg. Convert PDF to JPEG Using C#.NET. Add necessary references
adding images to pdf; how to add a jpeg to a pdf
Chapter 9. Functions and Operators
9.11. Geometric Functions and Operators
The geometric types
point
,
box
,
lseg
,
line
,
path
,
polygon
,and
circle
havea large setof native
support functions and operators, shown in Table 9-31, Table 9-32, and Table 9-33.
Caution
Note that the “same as” operator,
~=
,represents theusual notionof equality for
the
point
,
box
,
polygon
,and
circle
types. Some of these types also have an
=
operator, but
=
compares for equal areas only. The other scalar comparison
operators (
<=
and so on) likewise compare areas for these types.
Table 9-31. Geometric Operators
Operator
Description
Example
+
Translation
box ’((0,0),(1,1))’ +
point ’(2.0,0)’
-
Translation
box ’((0,0),(1,1))’ -
point ’(2.0,0)’
*
Scaling/rotation
box ’((0,0),(1,1))’
*
point ’(2.0,0)’
/
Scaling/rotation
box ’((0,0),(2,2))’ /
point ’(2.0,0)’
#
Point or box of intersection
’((1,-1),(-1,1))’ #
’((1,1),(-1,-1))’
#
Number of points in path or
polygon
#
’((1,0),(0,1),(-1,0))’
@-@
Length or circumference
@-@ path
’((0,0),(1,0))’
@@
Center
@@ circle ’((0,0),10)’
##
Closest point to first operand on
second operand
point ’(0,0)’ ## lseg
’((2,0),(0,2))’
<->
Distance between
circle ’((0,0),1)’ <->
circle ’((5,0),1)’
&&
Overlaps? (One point in
common makes this true.)
box ’((0,0),(1,1))’ &&
box ’((0,0),(2,2))’
<<
Is strictly left of?
circle ’((0,0),1)’ <<
circle ’((5,0),1)’
>>
Is strictly right of?
circle ’((5,0),1)’ >>
circle ’((0,0),1)’
&<
Does not extend to the rightof?
box ’((0,0),(1,1))’ &<
box ’((0,0),(2,2))’
&>
Does not extendto the left of?
box ’((0,0),(3,3))’ &>
box ’((0,0),(2,2))’
<<|
Is strictly below?
box ’((0,0),(3,3))’ <<|
box ’((3,4),(5,5))’
|>>
Is strictly above?
box ’((3,4),(5,5))’ |>>
box ’((0,0),(3,3))’
230
C# Image Convert: How to Convert Adobe PDF to Jpeg, Png, Bmp, &
C# DLLs for PDF Conversion to Images. Add necessary references to your C# project: This demo code convert PDF file all pages to jpg images.
add an image to a pdf acrobat; add image to pdf in preview
C# Image Convert: How to Convert Dicom Image File to Raster Images
Add necessary references to your C# project RasterEdge.XDoc.PDF.dll. inputFilePath = @"C:\input.dcm"; String outputFilePath = @"C:\output.jpg"; // Convert dicom
how to add jpg to pdf file; add image to pdf reader
Chapter 9. Functions and Operators
Operator
Description
Example
&<|
Does not extendabove?
box ’((0,0),(1,1))’ &<|
box ’((0,0),(2,2))’
|&>
Does not extendbelow?
box ’((0,0),(3,3))’ |&>
box ’((0,0),(2,2))’
<^
Is below (allows touching)?
circle ’((0,0),1)’ <^
circle ’((0,5),1)’
>^
Is above (allows touching)?
circle ’((0,5),1)’ >^
circle ’((0,0),1)’
?#
Intersects?
lseg ’((-1,0),(1,0))’
?# box
’((-2,-2),(2,2))’
?-
Is horizontal?
?- lseg
’((-1,0),(1,0))’
?-
Are horizontally aligned?
point ’(1,0)’ ?- point
’(0,0)’
?|
Is vertical?
?| lseg
’((-1,0),(1,0))’
?|
Are vertically aligned?
point ’(0,1)’ ?| point
’(0,0)’
?-|
Is perpendicular?
lseg ’((0,0),(0,1))’
?-| lseg
’((0,0),(1,0))’
?||
Are parallel?
lseg ’((-1,0),(1,0))’
?|| lseg
’((-1,2),(1,2))’
@>
Contains?
circle ’((0,0),2)’ @>
point ’(1,1)’
<@
Contained in or on?
point ’(1,1)’ <@ circle
’((0,0),2)’
~=
Same as?
polygon ’((0,0),(1,1))’
~= polygon
’((1,1),(0,0))’
Note: Before PostgreSQL 8.2, the containment operators
@>
and
<@
were respectively called
~
and
@
.These names are still available, but are deprecated and will eventually be removed.
Table 9-32. Geometric Functions
Function
Return Type
Description
Example
area(
object
)
double precision
area
area(box
’((0,0),(1,1))’)
center(
object
)
point
center
center(box
’((0,0),(1,2))’)
diameter(
circle
)
double precision
diameter of circle
diameter(circle
’((0,0),2.0)’)
231
C# Create PDF from images Library to convert Jpeg, png images to
images.Add(new Bitmap(Program.RootPath + "\\" 1.jpg")); images.Add(new Bitmap(Program.RootPath + "\\" 1.png")); / Build a PDF document with
add picture to pdf form; how to add image to pdf acrobat
C# WPF PDF Viewer SDK to convert and export PDF document to other
Highlight Text. Add Text. Add Text Box. Drawing Markups. Add Stamp Annotation. image file formats with high quality, support converting PDF to PNG, JPG, BMP and
add png to pdf preview; adding images to pdf forms
Chapter 9. Functions and Operators
Function
Return Type
Description
Example
height(
box
)
double precision
vertical size of box
height(box
’((0,0),(1,1))’)
isclosed(
path
)
boolean
aclosed path?
isclosed(path
’((0,0),(1,1),(2,0))’)
isopen(
path
)
boolean
an open path?
isopen(path
’[(0,0),(1,1),(2,0)]’)
length(
object
)
double precision
length
length(path
’((-1,0),(1,0))’)
npoints(
path
)
int
number of points
npoints(path
’[(0,0),(1,1),(2,0)]’)
npoints(
polygon
)
int
number of points
npoints(polygon
’((1,1),(0,0))’)
pclose(
path
)
path
convert path to closed
pclose(path
’[(0,0),(1,1),(2,0)]’)
popen(
path
)
path
convert path to open
popen(path
’((0,0),(1,1),(2,0))’)
radius(
circle
)
double precision
radius of circle
radius(circle
’((0,0),2.0)’)
width(
box
)
double precision
horizontal size of box
width(box
’((0,0),(1,1))’)
Table 9-33. Geometric Type Conversion Functions
Function
Return Type
Description
Example
box(
circle
)
box
circle to box
box(circle
’((0,0),2.0)’)
box(
point
,
point
)
box
points to box
box(point
’(0,0)’, point
’(1,1)’)
box(
polygon
)
box
polygon to box
box(polygon
’((0,0),(1,1),(2,0))’)
circle(
box
)
circle
box to circle
circle(box
’((0,0),(1,1))’)
circle(
point
,
double
precision
)
circle
center and radius to
circle
circle(point
’(0,0)’, 2.0)
circle(
polygon
)
circle
polygon to circle
circle(polygon
’((0,0),(1,1),(2,0))’)
232
C# PDF File Merge Library: Merge, append PDF files in C#.net, ASP.
Combine scanned images to PDF, such as tiff, jpg, png, gif, bmp, etc. Add necessary references: In addition, C# users can append a PDF file to the end of a
how to add jpg to pdf file; add an image to a pdf
VB.NET PDF File Merge Library: Merge, append PDF files in vb.net
to combine various scanned images to PDF, such as tiff, jpg, png, gif Add necessary references: In addition, VB.NET users can append a PDF file to the end of a
add an image to a pdf with acrobat; attach image to pdf form
Chapter 9. Functions and Operators
Function
Return Type
Description
Example
line(
point
,
point
)
line
points to line
line(point
’(-1,0)’, point
’(1,0)’)
lseg(
box
)
lseg
box diagonal to line
segment
lseg(box
’((-1,0),(1,0))’)
lseg(
point
,
point
)
lseg
points to line segment
lseg(point
’(-1,0)’, point
’(1,0)’)
path(
polygon
)
path
polygon to path
path(polygon
’((0,0),(1,1),(2,0))’)
point
(
double
precision
,
double
precision
)
point
construct point
point(23.4,
-44.5)
point(
box
)
point
center of box
point(box
’((-1,0),(1,0))’)
point(
circle
)
point
center of circle
point(circle
’((0,0),2.0)’)
point(
lseg
)
point
center of line segment
point(lseg
’((-1,0),(1,0))’)
point(
polygon
)
point
center of polygon
point(polygon
’((0,0),(1,1),(2,0))’)
polygon(
box
)
polygon
box to 4-point polygon
polygon(box
’((0,0),(1,1))’)
polygon(
circle
)
polygon
circle to 12-point
polygon
polygon(circle
’((0,0),2.0)’)
polygon(
npts
,
circle
)
polygon
circle to
npts
-point
polygon
polygon(12,
circle
’((0,0),2.0)’)
polygon(
path
)
polygon
path to polygon
polygon(path
’((0,0),(1,1),(2,0))’)
Itis possible toaccess the two component numbers of a
point
as thoughthe point were anarraywith
indexes 0 and 1. For example, if
t.p
is a
point
column then
SELECT p[0] FROM t
retrieves the X
coordinate and
UPDATE t SET p[1] = ...
changes the Y coordinate. In the same way, a value of
type
box
or
lseg
can be treated as an array of two
point
values.
The
area
function works for the types
box
,
circle
, and
path
. The
area
function only
works on the
path
data type if the points in the
path
are non-intersecting. For example,
the
path
’((0,0),(0,1),(2,1),(2,2),(1,2),(1,0),(0,0))’::PATH
will
not
work;
however,
the
following
visually
identical
path
’((0,0),(0,1),(1,1),(1,2),(2,2),(2,1),(1,1),(1,0),(0,0))’::PATH
will work. If
the concept of an intersecting versus non-intersecting
path
is confusing, draw both of the above
path
sside by side on a piece of graph paper.
233
Chapter 9. Functions and Operators
9.12. Network Address Functions and Operators
Table 9-34shows the operators available for the
cidr
and
inet
types. The operators
<<
,
<<=
,
>>
,
>>=
,and
&&
test for subnet inclusion. They consider only the network parts of the two addresses
(ignoring anyhost part) and determine whether one network is identical to or a subnet of the other.
Table 9-34.
cidr
and
inet
Operators
Operator
Description
Example
<
is less than
inet ’192.168.1.5’ <
inet ’192.168.1.6’
<=
is less than or equal
inet ’192.168.1.5’ <=
inet ’192.168.1.5’
=
equals
inet ’192.168.1.5’ =
inet ’192.168.1.5’
>=
is greater or equal
inet ’192.168.1.5’ >=
inet ’192.168.1.5’
>
is greater than
inet ’192.168.1.5’ >
inet ’192.168.1.4’
<>
is not equal
inet ’192.168.1.5’ <>
inet ’192.168.1.4’
<<
is contained by
inet ’192.168.1.5’ <<
inet ’192.168.1/24’
<<=
is contained by or equals
inet ’192.168.1/24’ <<=
inet ’192.168.1/24’
>>
contains
inet ’192.168.1/24’ >>
inet ’192.168.1.5’
>>=
contains or equals
inet ’192.168.1/24’ >>=
inet ’192.168.1/24’
&&
contains or is contained by
inet ’192.168.1/24’ &&
inet ’192.168.1.80/28’
~
bitwise NOT
~ inet ’192.168.1.6’
&
bitwise AND
inet ’192.168.1.6’ &
inet ’0.0.0.255’
|
bitwise OR
inet ’192.168.1.6’ |
inet ’0.0.0.255’
+
addition
inet ’192.168.1.6’ + 25
-
subtraction
inet ’192.168.1.43’ -
36
-
subtraction
inet ’192.168.1.43’ -
inet ’192.168.1.19’
Table 9-35 shows the functions available for use with the
cidr
and
inet
types. The
abbrev
,
host
,
and
text
functions are primarily intended to offer alternative display formats.
Table 9-35.
cidr
and
inet
Functions
Function
Return Type
Description
Example
Result
234
Chapter 9. Functions and Operators
Function
Return Type
Description
Example
Result
abbrev(
inet
)
text
abbreviated
display format as
text
abbrev(inet
’10.1.0.0/16’)
10.1.0.0/16
abbrev(
cidr
)
text
abbreviated
display format as
text
abbrev(cidr
’10.1.0.0/16’)
10.1/16
broadcast(
inet
)
inet
broadcast address
for network
broadcast(’192.168.1.5/24’)
192.168.1.255/24
family(
inet
)
int
extract family of
address;
4
for
IPv4,
6
for IPv6
family(’::1’)
6
host(
inet
)
text
extract IP address
as text
host(’192.168.1.5/24’)
192.168.1.5
hostmask(
inet
)
inet
construct host
mask for network
hostmask(’192.168.23.20/30’)
0.0.0.3
masklen(
inet
)
int
extract netmask
length
masklen(’192.168.1.5/24’)
24
netmask(
inet
)
inet
construct netmask
for network
netmask(’192.168.1.5/24’)
255.255.255.0
network(
inet
)
cidr
extract network
part of address
network(’192.168.1.5/24’)
192.168.1.0/24
set_masklen(
inet
,
int
)
inet
set netmask length
for
inet
value
set_masklen(’192.168.1.5/24’,
16)
192.168.1.5/16
set_masklen(
cidr
,
int
)
cidr
set netmask length
for
cidr
value
set_masklen(’192.168.1.0/24’::cidr,
16)
192.168.0.0/16
text(
inet
)
text
extract IP address
and netmask
length as text
text(inet
’192.168.1.5’)
192.168.1.5/32
Any
cidr
value can be cast to
inet
implicitly or explicitly; therefore, the functions shown above
as operating on
inet
also work on
cidr
values. (Where there are separate functions for
inet
and
cidr
,it is because the behavior should be different for the two cases.) Also, it is permitted to cast
an
inet
value to
cidr
.When this is done, any bits to the right of the netmask are silently zeroed to
create a valid
cidr
value. In addition, you cancast a text value to
inet
or
cidr
using normalcasting
syntax: for example,
inet(
expression
)
or
colname
::cidr
.
Table9-36shows thefunctionsavailablefor use withthe
macaddr
type. Thefunction
trunc(
macaddr
)
returns a MAC address with the last 3 bytes set to zero. This can be used to associate the remaining
prefix with a manufacturer.
Table 9-36.
macaddr
Functions
Function
Return Type
Description
Example
Result
trunc(
macaddr
)
macaddr
set last 3 bytes to
zero
trunc(macaddr
’12:34:56:78:90:ab’)
12:34:56:00:00:00
235
Chapter 9. Functions and Operators
The
macaddr
type also supports the standard relational operators (
>
,
<=
,etc.) for lexicographical
ordering, and the bitwise arithmetic operators (
~
,
&
and
|
)for NOT, AND and OR.
9.13. Text Search Functions and Operators
Table 9-37, Table 9-38 and Table 9-39 summarize the functions and operators that are provided for
full text searching. See Chapter 12 for a detailed explanation of PostgreSQL’s text search facility.
Table 9-37. Text Search Operators
Operator
Description
Example
Result
@@
tsvector
matches
tsquery
?
to_tsvector(’fat
cats ate rats’)
@@
to_tsquery(’cat &
rat’)
t
@@@
deprecated synonym
for
@@
to_tsvector(’fat
cats ate rats’)
@@@
to_tsquery(’cat &
rat’)
t
||
concatenate
tsvector
s
’a:1
b:2’::tsvector ||
’c:1 d:2
b:3’::tsvector
’a’:1 ’b’:2,5
’c’:3 ’d’:4
&&
AND
tsquery
s
together
’fat |
rat’::tsquery &&
’cat’::tsquery
( ’fat’ | ’rat’ )
& ’cat’
||
OR
tsquery
stogether
’fat |
rat’::tsquery ||
’cat’::tsquery
( ’fat’ | ’rat’ )
| ’cat’
!!
negate a
tsquery
!! ’cat’::tsquery
!’cat’
@>
tsquery
contains
another ?
’cat’::tsquery @>
’cat &
rat’::tsquery
f
<@
tsquery
is contained
in ?
’cat’::tsquery <@
’cat &
rat’::tsquery
t
Note: The
tsquery
containment operators consider only the lexemes listed in the two queries,
ignoring the combining operators.
In addition to the operators shown in the table, the ordinary B-tree comparison operators (
=
,
<
,etc)
are defined for types
tsvector
and
tsquery
.These are notvery useful for text searching butallow,
for example, unique indexes to be built on columns of these types.
236
Chapter 9. Functions and Operators
Table 9-38. Text Search Functions
Function
Return Type
Description
Example
Result
get_current_ts_config()
regconfig
get default text
search
configuration
get_current_ts_config()
english
length(
tsvector
)
integer
number of
lexemes in
tsvector
length(’fat:2,4
cat:3
rat:5A’::tsvector)
3
numnode(
tsquery
)
integer
number of
lexemes plus
operators in
tsquery
numnode(’(fat
& rat) |
cat’::tsquery)
5
plainto_tsquery([
config regconfig
, ]
query text
)
tsquery
produce
tsquery
ignoring
punctuation
plainto_tsquery(’english’,
’The Fat
Rats’)
’fat’ & ’rat’
querytree(
query
tsquery
)
text
get indexable part
of a
tsquery
querytree(’foo
& !
bar’::tsquery)
’foo’
setweight(
tsvector
,
"char"
)
tsvector
assign weight to
each element of
tsvector
setweight(’fat:2,4
cat:3
rat:5B’::tsvector,
’A’)
’cat’:3A
’fat’:2A,4A
’rat’:5A
strip(
tsvector
)
tsvector
remove positions
and weights from
tsvector
strip(’fat:2,4
cat:3
rat:5A’::tsvector)
’cat’ ’fat’
’rat’
to_tsquery([
config regconfig
, ]
query text
)
tsquery
normalize words
and convert to
tsquery
to_tsquery(’english’,
’The & Fat &
Rats’)
’fat’ & ’rat’
to_tsvector([
config regconfig
, ]
document
text
)
tsvector
reduce document
text to
tsvector
to_tsvector(’english’,
’The Fat
Rats’)
’fat’:2
’rat’:3
ts_headline([
config
regconfig
, ]
document text
,
query tsquery
[,
options text
])
text
display a query
match
ts_headline(’x
y z’,
’z’::tsquery)
x y <b>z</b>
237
Documents you may be interested
Documents you may be interested