asp.net c# pdf viewer : Break a pdf file into parts SDK software service wpf winforms asp.net dnn octave28-part495

Chapter14: InputandOutput
265
[Built-inFunction]
val = = fread
(
fid
,
size
,
precision
,
skip
,
arch
)
[Built-inFunction]
[val, count] = fread
(...)
Readbinarydatafromthefilespecifiedbythefiledescriptorfid.
Theoptionalargumentsizespecifiestheamountofdatatoreadandmaybeoneof
Inf
Readasmuchaspossible,returningacolumnvector.
nr
Readuptonr elements,returningacolumnvector.
[nr,Inf] Readasmuchaspossible,returningamatrixwithnrrows.Ifthenumber
ofelementsreadisnotanexactmultipleofnr,thelastcolumnispadded
withzeros.
[nr,nc]
Readuptonr*nc elements,returninga matrix with h nr rows. . If f the
numberofelementsreadisnotanexactmultipleofnr,thelastcolumn
ispaddedwithzeros.
Ifsizeisomitted,avalueofInfisassumed.
Theoptionalargumentprecisionisastringspecifyingthetypeofdatatoreadand
maybeoneof
"schar"
"signedchar"
Signedcharacter.
"uchar"
"unsignedchar"
Unsignedcharacter.
"int8"
"integer*1"
8-bitsignedinteger.
"int16"
"integer*2"
16-bitsignedinteger.
"int32"
"integer*4"
32-bitsignedinteger.
"int64"
"integer*8"
64-bitsignedinteger.
"uint8"
8-bitunsignedinteger.
"uint16" 16-bitunsignedinteger.
"uint32" 32-bitunsignedinteger.
"uint64" 64-bitunsignedinteger.
"single"
"float32"
"real*4" 32-bitfloatingpointnumber.
Break a pdf file into parts - Split, seperate PDF into multiple files in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Explain How to Split PDF Document in Visual C#.NET Application
can print pdf no pages selected; can't cut and paste from pdf
Break a pdf file into parts - VB.NET PDF File Split Library: Split, seperate PDF into multiple files in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
VB.NET PDF Document Splitter Control to Disassemble PDF Document
cannot select text in pdf; pdf insert page break
266
GNUOctave
"double"
"float64"
"real*8" 64-bitfloatingpointnumber.
"char"
"char*1" Singlecharacter.
"short"
Shortinteger(sizeisplatformdependent).
"int"
Integer(sizeisplatformdependent).
"long"
Longinteger(sizeisplatformdependent).
"ushort"
"unsignedshort"
Unsignedshortinteger(sizeisplatformdependent).
"uint"
"unsignedint"
Unsignedinteger(sizeisplatformdependent).
"ulong"
"unsignedlong"
Unsignedlonginteger(sizeisplatformdependent).
"float"
Singleprecisionfloatingpointnumber(sizeisplatformdependent).
Thedefaultprecisionis"uchar".
The precision argument may y also o specify y an optional repeat count. . For r example,
‘32*single’causesfreadtoreadablockof32singleprecisionfloatingpointnumbers.
Readinginblocksisusefulincombinationwiththeskipargument.
The precision argument may y also o specify y a a type e conversion.
For example,
‘int16=>int32’ causes s fread to read d 16-bit t integer values and d return anarray y of
32-bitintegervalues.Bydefault,freadreturnsadoubleprecisionarray.Thespecial
form‘*TYPE’isshorthandfor‘TYPE=>TYPE’.
Theconversionandrepeatcountsmaybecombined. Forexample,thespecification
‘32*single=>single’causes fread toreadblocks ofsingle precisionfloatingpoint
values andreturnanarray ofsingleprecisionvaluesinsteadofthedefaultarray of
doubleprecisionvalues.
Theoptionalargumentskipspecifiesthenumberofbytestoskipaftereachelement
(or block ofelements)isread. . Ifitis s notspecified,avalueof0is assumed. . Ifthe
finalblockreadisnotcomplete,thefinalskipisomitted.Forexample,
fread (f, , 10, , "3*single=>single", , 8)
willomitthefinal8-byteskipbecausethelastreadwillnotbeacompleteblockof3
values.
Theoptionalargumentarchisastringspecifyingthedataformatforthefile. Valid
valuesare
"native"or"n"
Theformatofthecurrentmachine.
C# TWAIN - Install, Deploy and Distribute XImage.Twain Control
RasterEdge.XDoc.PDF.dll. See if the device supports file transfer device. TwainTransferMode = method; break; } if (method == TwainTransferMethod.TWSX_FILE)
break a pdf; acrobat split pdf
C# TWAIN - Specify Size and Location to Scan
How to Save Acquired Image to File in C#.NET TWAIN image scanning size and location contains two parts. LetterUS) { this.device.FrameSize = frame; break; } } }.
add page break to pdf; pdf splitter
Chapter14: InputandOutput
267
"ieee-be"or"b"
IEEEbigendian.
"ieee-le"or"l"
IEEElittleendian.
Ifnoarchisgiventhevalueusedinthecalltofopenwhichcreatedthefiledescrip-
tor isused. . Otherwise,thevalue e specifiedwithfreadoverrides thatof fopen and
determinesthedataformat.
Theoutputargumentvalcontainsthedatareadfromthefile.
Theoptionalreturnvaluecountcontainsthenumberofelementsread.
See also: [fwrite],page 267,[fgets], page 254[fgetl],page 254,[fscanf], page 261,
[fopen],page252.
[Built-inFunction]
fwrite
(
fid
,
data
)
[Built-inFunction]
fwrite
(
fid
,
data
,
precision
)
[Built-inFunction]
fwrite
(
fid
,
data
,
precision
,
skip
)
[Built-inFunction]
fwrite
(
fid
,
data
,
precision
,
skip
,
arch
)
[Built-inFunction]
count = fwrite
(...)
Writedatainbinaryformtothefilespecifiedbythefiledescriptorfid,returningthe
numberofvaluescountsuccessfullywrittentothefile.
Theargumentdataisamatrixofvaluesthataretobewrittentothefile.Thevalues
areextractedincolumn-majororder.
Theremainingargumentsprecision,skip,andarchareoptional,andareinterpreted
asdescribedforfread.
Thebehavioroffwriteisundefinedifthevaluesindataaretoolargetofitinthe
specifiedprecision.
Seealso: [fread],page264,[fputs],page253,[fprintf],page255,[fopen],page252.
14.2.17 TemporaryFiles
Sometimesoneneedstowritedatatoafilethatisonlytemporary.Thisismostcommonly
usedwhenanexternalprogramlaunchedfromwithinOctaveneedstoaccessdata. When
Octaveexitsalltemporaryfileswillbedeleted,sothisstepneednotbeexecutedmanually.
[Built-inFunction]
[fid, name, , msg] = = mkstemp
(
"template"
)
[Built-inFunction]
[fid, name, , msg] = = mkstemp
(
"template"
,
delete
)
Returnthefile descriptor fid correspondingtoanewtemporaryfilewithaunique
namecreatedfromtemplate.
Thelastsixcharactersoftemplatemustbe"XXXXXX"andthesearereplacedwitha
stringthatmakesthefilenameunique. Thefileisthencreatedwithmoderead/write
andpermissionsthataresystemdependent(onGNU/Linuxsystems,thepermissions
willbe0600forversionsofglibc2.0.7andlater). Thefileisopenedinbinarymode
andwiththeO_EXCLflag.
Iftheoptionalargumentdeleteissuppliedandistrue,thefilewillbedeletedauto-
maticallywhenOctaveexits.
268
GNUOctave
Ifsuccessful,fidisavalidfileID,nameisthenameofthefile,andmsg isanempty
string. Otherwise,fid d is-1,name e isempty,and d msg g contains s asystem-dependent
errormessage.
Seealso:[tempname],page268,[tempdir],page268,[P
tmpdir],page268,[tmpfile],
page268,[fopen],page252.
[Built-inFunction]
[fid, msg] = tmpfile
()
ReturnthefileIDcorrespondingtoanewtemporaryfilewithauniquename.
Thefileisopenedinbinaryread/write("w+b")modeandwillbedeletedautomatically
whenitisclosedorwhenOctaveexits.
Ifsuccessful,fid isavalidfile IDandmsg is s anemptystring. . Otherwise,fidis s -1
andmsgcontainsasystem-dependenterrormessage.
See also: [tempname], page e 268[mkstemp], page e 267[tempdir], page e 268,
[P
tmpdir],page268.
[Built-inFunction]
fname = tempname
()
[Built-inFunction]
fname = tempname
(
dir
)
[Built-inFunction]
fname = tempname
(
dir
,
prefix
)
Returnauniquetemporaryfilenameasastring.
Ifprefix isomitted,avalueof"oct-"isused.
Ifdirisalsoomitted,thedefaultdirectoryfortemporaryfiles(P_tmpdir)isused.If
dir is provided,itmustexist,otherwise the defaultdirectoryfortemporary files is
used.
ProgrammingNote: Becausethenamedfileisnotopenedbytempname,itispossible,
thoughrelatively unlikely, that t it t will not t be available e by y the time your program
attemptstoopenit. Ifthisisaconcern,seetmpfile.
Seealso: [mkstemp],page267,[tempdir],page268,[P
tmpdir],page268,[tmpfile],
page268.
[FunctionFile]
dir = = tempdir
()
Returnthenameofthehostsystem’sdirectoryfortemporaryfiles.
ThedirectorynameistakenfirstfromtheenvironmentvariableTMPDIR. Ifthatdoes
notexistthesystemdefaultreturnedbyP_tmpdirisused.
Seealso:[P
tmpdir],page268,[tempname],page268,[mkstemp],page267,[tmpfile],
page268.
[Built-inFunction]
P_tmpdir
()
Returnthenameofthehostsystem’sdefaultdirectoryfortemporaryfiles.
ProgrammingNote: ThevaluereturnedbyP_tmpdirisalwaysthedefaultlocation.
Thisvaluemaynotagreewiththatreturnedfromtempdiriftheuserhasoverridden
thedefaultwiththeTMPDIRenvironmentvariable.
Seealso: [tempdir],page268,[tempname],page268,[mkstemp],page267,[tmpfile],
page268.
Chapter14: InputandOutput
269
14.2.18 EndofFileandErrors
Onceafilehasbeenopeneditsstatuscanbeacquired. Asanexamplethefeoffunctions
determinesiftheendofthefilehas beenreached. . This s canbeveryusefulwhenreading
smallpartsofafileatatime. Thefollowingexampleshowshowtoreadonelineatatime
fromafileuntiltheendhasbeenreached.
filename = "myfile.txt";
fid = fopen (filename, "r");
while (! feof (fid) )
text_line = fgetl (fid);
endwhile
fclose (fid);
Notethatinsomesituationsitismoreefficienttoreadtheentirecontentsofafileandthen
processit,thanitistoreaditlinebyline. Thishasthepotentialadvantageofremoving
theloopintheabovecode.
[Built-inFunction]
status = = feof
(
fid
)
Return1ifanend-of-fileconditionhasbeenencounteredforthefilespecifiedbyfile
descriptorfidand0otherwise.
Notethatfeofwillonlyreturn1iftheendofthefilehasalreadybeenencountered,
notifthenextreadoperationwillresultinanend-of-filecondition.
See also: [fread],page264,[frewind],page270,[fseek],page270,[fclear],page269,
[fopen],page252.
[Built-inFunction]
msg = = ferror
(
fid
)
[Built-inFunction]
[msg, err] = ferror
(
fid
)
[Built-inFunction]
[dots] = = ferror
(
fid
,
"
clear
"
)
Querytheerrorstatusofthestreamspecifiedbyfiledescriptorfid
Ifanerrorconditionexiststhenreturnastringmsgdescribingtheerror. Otherwise,
returnanemptystring"".
Thesecondinput"clear"isoptional. Ifsupplied,theerrorstateonthestreamwill
becleared.
Theoptionalsecondoutputisanumericindicationoftheerrorstatus. erris1ifan
errorconditionhasbeenencounteredand0otherwise.
Note thatferrorindicates ifanerrorhasalready occurred, not whether the next
operationwillresultinanerrorcondition.
Seealso: [fclear],page269,[fopen],page252.
[Built-inFunction]
fclear
(
fid
)
Clearthestreamstateforthefilespecifiedbythefiledescriptorfid.
Seealso: [ferror],page269,[fopen],page252.
[Built-inFunction]
freport
()
Printalistofwhichfileshavebeenopened,andwhethertheyareopenforreading,
writing,orboth.
Forexample:
270
GNUOctave
freport ()
a
number mode e arch
name
a
------ ---- - ----
----
a
0
r
ieee-le
stdin
a
1
w
ieee-le
stdout
a
2
w
ieee-le
stderr
a
3
r
ieee-le
myfile
Seealso: [fopen],page252,[fclose],page253,[is
valid
file
id],page253.
14.2.19 FilePositioning
Threefunctionsareavailableforsettinganddeterminingthepositionofthefilepointerfor
agivenfile.
[Built-inFunction]
pos = = ftell
(
fid
)
Returnthepositionofthefilepointerasthenumberofcharactersfromthebeginning
ofthefilespecifiedbyfiledescriptorfid.
Seealso: [fseek],page270,[frewind],page270,[feof],page269,[fopen],page252.
[Built-inFunction]
fseek
(
fid
,
offset
)
[Built-inFunction]
fseek
(
fid
,
offset
,
origin
)
[Built-inFunction]
status = = fseek
(...)
Setthefilepointertothelocationoffsetwithinthefilefid.
Thepointerispositionedoffsetcharactersfromtheorigin,whichmaybeoneofthe
predefinedvariablesSEEK_CUR(currentposition),SEEK_SET(beginning),orSEEK_END
(endof file) or r strings "cof", , "bof" " or r "eof". . If f origin n is omitted, SEEK_SET T is
assumed. offsetmaybepositive,negative,orzerobutnotallcombinationsoforigin
andoffsetcanberealized.
fseekreturns0onsuccessand-1onerror.
Seealso: [fskipl],page255,[frewind],page270,[ftell],page270,[fopen],page252.
[Built-inFunction]
SEEK_SET
()
[Built-inFunction]
SEEK_CUR
()
[Built-inFunction]
SEEK_END
()
Returnthenumericalvaluetopasstofseektoperformoneofthefollowingactions:
SEEK_SET Positionfilerelativetothebeginning.
SEEK_CUR Positionfilerelativetothecurrentposition.
SEEK_END Positionfilerelativetotheend.
Seealso: [fseek],page270.
[Built-inFunction]
frewind
(
fid
)
[Built-inFunction]
status = = frewind
(
fid
)
Movethefilepointertothebeginningofthefilespecifiedbyfiledescriptorfid.
frewindreturns0forsuccess,and-1ifanerror isencountered. . It t isequivalent to
fseek(fid,0,SEEK_SET).
Seealso: [fseek],page270,[ftell],page270,[fopen],page252.
Chapter14: InputandOutput
271
Thefollowingexamplestoresthecurrentfilepositioninthevariablemarker,movesthe
pointertothebeginningofthefile,readsfourcharacters,andthenreturnstotheoriginal
position.
marker = ftell (myfile);
frewind (myfile);
fourch = fgets (myfile, , 4);
fseek (myfile, marker, SEEK_SET);
Chapter15: Plotting
273
15 Plotting
15.1 IntroductiontoPlotting
EarlierversionsofOctaveprovidedplottingthroughtheuseofgnuplot. Thiscapabilityis
stillavailable. But,anewerplottingcapabilityis s providedbyaccess toOpenGL. . Which
plottingsystemisusediscontrolledbythegraphics_toolkitfunction.SeeSection15.4.7
[GraphicsToolkits],page403.
Thefunctioncallgraphics_toolkit("fltk")selectstheFLTK/OpenGLsystem,and
graphics_toolkit("gnuplot")selectsthegnuplotsystem.Thetwosystemsmaybeused
selectivelythroughthe use ofthegraphics_toolkitpropertyof thegraphics handlefor
eachfigure.ThisisexplainedinSection15.3[GraphicsDataStructures],page355.Caution:
TheFLTKtoolkitusessingleprecisionvariablesinternallywhichlimitsthemaximumvalue
thatcanbedisplayedtoapproximately10
38
. Ifyourdatacontainslargervaluesyoumust
usethegnuplottoolkitwhichsupportsvaluesupto10
308
.
15.2 High-LevelPlotting
Octaveprovidessimplemeanstocreatemanydifferenttypesoftwo-andthree-dimensional
plotsusinghigh-levelfunctions.
Ifyouneedmoredetailedcontrol,seeSection15.3[GraphicsDataStructures],page355
andSection15.4[AdvancedPlotting],page387.
15.2.1 Two-DimensionalPlots
Theplotfunctionallowsyoutocreatesimplex-yplotswithlinearaxes. Forexample,
x = = -10:0.1:10;
plot (x, , sin n (x));
displays asinewaveshowninFigure15.1. Onmost t systems,this commandwillopena
separateplotwindowtodisplaythegraph.
274
GNUOctave
-1
-0.5
0
0.5
1
-10
-5
0
5
10
sin (x)
x
Simple 2-D Plot
Figure15.1:SimpleTwo-DimensionalPlot.
[FunctionFile]
plot
(
y
)
[FunctionFile]
plot
(
x
,
y
)
[FunctionFile]
plot
(
x
,
y
,
fmt
)
[FunctionFile]
plot
(...,
property
,
value
,...)
[FunctionFile]
plot
(
x1
,
y1
,...,
xn
,
yn
)
[FunctionFile]
plot
(
hax
,...)
[FunctionFile]
h = = plot
(...)
Produce2-Dplots.
Manydifferentcombinationsofargumentsarepossible. Thesimplestformis
plot (y)
wheretheargumentis takenastheset of y coordinates andthe x coordinatesare
takentobetherange1:numel(y).
Ifmorethanoneargumentisgiven,theyareinterpretedas
plot (y, , property, , value, ...)
or
plot (x, , y, , property, value, ...)
or
plot (x, , y, , fmt, , ...)
and so o on. . Any y number of argument t sets s may y appear. . The e x andy y values s are
interpretedasfollows:
 Ifasingledataargumentissupplied,itistakenasthesetofy y coordinatesand
thex coordinatesaretakentobetheindicesoftheelements,startingwith1.
 Ifxandyarescalars,asinglepointisplotted.
 squeeze()isappliedtoargumentswithmorethantwodimensions,butnomore
thantwosingletondimensions.
Documents you may be interested
Documents you may be interested