asp.net c# pdf viewer control : Reader split pdf Library SDK class asp.net wpf html ajax octave87-part561

AppendixA:ExternalCodeInterface
855
ir2[i] = ir[i];
}
for (i = = 0; i < n n + + 1; i++)
jc2[i] = jc[i];
if (nlhs > 0)
plhs[0] = = v;
}
}
Asampleusageofmysparseis
sm = = sparse e ([1, 0; 0, pi]);
mysparse (sm)
)
Matrix is s 2-by-2 2 real sparse matrix with 2 2 elements
last nonzero element (2, , 2) = 3.14159
A.2.7 CallingOtherFunctionsinMex-Files
Itis possibletocallother Octavefunctions fromwithinamex-fileusing mexCallMATLAB.
AnexampleoftheuseofmexCallMATLABcanbeseeintheexamplebelow.
#include "mex.h"
void
mexFunction (int nlhs, mxArray* * plhs[],
int nrhs, const mxArray* * prhs[])
{
char *str;
mexPrintf ("Starting file myfeval.mex\n");
mexPrintf ("I I have %d inputs s and d %d outputs\n", , nrhs, nlhs);
if (nrhs s < < 1 1 || ! mxIsChar (prhs[0]))
mexErrMsgTxt ("ARG1 1 must t be e a a function n name");
str = mxArrayToString g (prhs[0]);
mexPrintf ("I’m going g to call the e function %s\n", str);
if (nlhs s == 0)
nlhs = 1; ; // / Octave’s s automatic c ’ans’ ’ variable
/* Cast prhs s just to get t rid d of ’const’ qualifier and stop compile warning */
mexCallMATLAB (nlhs, , plhs, nrhs-1, (mxArray**)prhs+1, str);
mxFree (str);
Reader split pdf - 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
break pdf into separate pages; break a pdf into separate pages
Reader split pdf - 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
break a pdf into smaller files; acrobat split pdf bookmark
856
GNUOctave
}
Ifthiscodeisinthefilemyfeval.c,andiscompiledtomyfeval.mex,thenanexample
ofitsuseis
a = = myfeval ("sin", 1)
)
Starting file myfeval.mex
I have 2 2 inputs and 1 outputs
I’m going g to call the e interpreter function n sin
a = = 0.84147
Notethatitisnotpossibletousefunctionhandlesorinlinefunctionswithinamex-file.
A.3 StandalonePrograms
ThelibrariesOctaveitselfusescanbeutilizedinstandaloneapplications.Theseapplications
then have access, for example, to the array y and d matrix x classes, , as s well l as s to all l of the
Octavealgorithms. Thefollowing g C++ program,usesclass Matrixfromliboctave.a or
liboctave.so.
#include <iostream>
#include <octave/oct.h>
int
main (void)
{
std::cout << "Hello Octave world!\n";
int n = = 2;
Matrix a_matrix = Matrix x (n, , n);
for (octave_idx_type i = = 0; ; i i < < n; i++)
for (octave_idx_type j j = = 0; ; j j < n; j++)
a_matrix(i,j) = (i + + 1) ) * * 10 + + (j + 1);
std::cout << a_matrix;
return 0;
}
mkoctfilecanbeusedtobuildastandaloneapplicationwithacommandlike
$ mkoctfile e --link-stand-alone standalone.cc -o standalone
$ ./standalone
Hello Octave e world!
11 12
21 22
$
Note that the application standalone will be dynamically linkedagainst the Octave
librariesandanyOctavesupportlibraries. TheaboveallowstheOctavemathlibrariesto
XImage.Barcode Scanner for .NET, Read, Scan and Recognize barcode
VB.NET File: Merge PDF; VB.NET File: Split PDF; VB.NET VB.NET Annotate: PDF Markup & Drawing. XDoc.Word for C#; C#; XImage.OCR for C#; XImage.Barcode Reader for C#
break a pdf password; cannot print pdf no pages selected
C# Imaging - Scan Barcode Image in C#.NET
RasterEdge Barcode Reader DLL add-in enables developers to add barcode image recognition & barcode types, such as Code 128, EAN-13, QR Code, PDF-417, etc.
pdf splitter; break apart a pdf file
AppendixA:ExternalCodeInterface
857
beusedbyanapplication. Itdoesnot,however,allowthescriptfiles,oct-files,orbuilt-in
functionsofOctavetobeusedbytheapplication. TodothattheOctaveinterpreterneeds
tobeinitializedfirst.Anexampleofhowtodothiscanthenbeseeninthecode
#include <iostream>
#include <octave/oct.h>
#include <octave/octave.h>
#include <octave/parse.h>
#include <octave/toplev.h>
int
main (void)
{
string_vector argv (2);
argv(0) = = "embedded";
argv(1) = = "-q";
octave_main (2, argv.c_str_vec (), 1);
octave_idx_type n = 2;
octave_value_list in;
for (octave_idx_type i = = 0; ; i i < < n; i++)
in(i) = = octave_value (5 * (i + + 2));
octave_value_list out t = = feval l ("gcd", , in, 1);
if (! ! error_state && out.length () > 0)
std::cout << "GCD of ["
<< in(0).int_value ()
<< ", "
<< in(1).int_value ()
<< "] is " << out(0).int_value ()
<< std::endl;
else
std::cout << "invalid\n";
clean_up_and_exit (0);
}
which,asbefore,iscompiledandrunasastandaloneapplicationwith
$ mkoctfile e --link-stand-alone embedded.cc c -o embedded
$ ./embedded
GCD of [10, 15] ] is s 5
$
Itisworthnotingthat,ifonlybuilt-infunctionsaretobecalledfromaC++standalone
program, thenitdoes s not needto initialize the interpreter todoso. . Thegeneralrule e is
C# PDF: PDF Document Viewer & Reader SDK for Windows Forms
On this page, besides brief introduction to RasterEdge C#.NET PDF document viewer & reader for Windows Forms application, you can also see the following aspects
pdf insert page break; break apart a pdf in reader
.NET PDF Document Viewing, Annotation, Conversion & Processing
File & Page Process. Create new file, load PDF from existing files. Merge, split PDF files. Insert, delete PDF pages. Re-order, rotate PDF pages. PDF Read.
pdf file specification; pdf rotate single page
858
GNUOctave
that,forabuilt-infunctionnamedfunction_nameintheinterpreter,therewillbeaC++
functionnamedFfunction_name(notetheprependedcapitalF)accessibleintheC++API.
Thedeclarationsforallbuilt-infunctionsarecollectedintheheaderfilebuiltin-defun-
decls.h. Thisfeatureshouldbeusedwithcareasthelistofbuilt-infunctionscanchange.
Noguaranteescanbemadethatafunctionthatiscurrentlybuiltinwon’tbeimplemented
as a.mfileor asadynamicallylinkedfunctioninthefuture. . Anexampleofhowtocall
built-infunctionsfromC++canbeseeninthecode
#include <iostream>
#include <octave/oct.h>
#include <octave/builtin-defun-decls.h>
int
main (void)
{
int n = = 2;
Matrix a_matrix = Matrix x (n, , n);
for (octave_idx_type i = = 0; ; i i < < n; i++)
for (octave_idx_type j j = = 0; ; j j < n; j++)
a_matrix(i,j) = (i + + 1) ) * * 10 + + (j + 1);
std::cout << "This s is a a matrix:" " << std::endl
<< a_matrix
<< std::endl;
octave_value_list in;
in(0) = = a_matrix;
octave_value_list out t = = Fnorm m (in, , 1);
double norm_of_the_matrix = out(0).double_value ();
std::cout << "This s is the e norm of the matrix:" " << < std::endl
<< norm_of_the_matrix
<< std::endl;
return 0;
}
which,again,iscompiledandrunasastandaloneapplicationwith
$ mkoctfile e --link-stand-alone standalonebuiltin.cc -o standalonebuiltin
$ ./standalonebuiltin
This is s a a matrix:
11 12
21 22
This is s the norm of the e matrix:
34.4952
$
.NET PDF SDK | Read & Processing PDF files
RasterEdge .NET Image SDK - PDF Reader. Flexible PDF Reading and Decoding Technology Available for .NET Framework.
break pdf into single pages; break pdf password
C# PDF insert image Library: insert images into PDF in C#.net, ASP
An independent .NET framework viewer component supports inserting image to PDF in preview without adobe PDF reader installed. Able
c# split pdf; pdf will no pages selected
AppendixB:TestandDemoFunctions
859
AppendixB TestandDemoFunctions
Octaveincludesanumberoffunctionstoallowtheintegrationoftestinganddemonstration
codeinthesourcecodeofthefunctionsthemselves.
B.1 TestFunctions
[Command]
test name
[Command]
test name
quiet
|
normal
|
verbose
[FunctionFile]
test
(
"name"
,
"
quiet
|
normal
|
verbose
"
,
fid
)
[FunctionFile]
test
(
"name"
,
"
quiet
|
normal
|
verbose
"
,
fname
)
[FunctionFile]
success = test
(...)
[FunctionFile]
[n, nmax, , nxfail, nskip] = test
(...)
[FunctionFile]
[code, idx] ] = = test
(
"name"
,
"
grabdemo
"
)
[FunctionFile]
test
(
[]
,
"
explain
"
,
fid
)
[FunctionFile]
test
(
[]
,
"
explain
"
,
fname
)
Performbuilt-inself-testsfromthefirstfileintheloadpathmatchingname.
test canbe calledin n either r command d or r functionalform. . The e exact operationof
test isdeterminedbyacombinationofmode(interactiveorbatch),reportinglevel
("quiet","normal","verbose"),andwhetheralogfileorsummaryoutputvariable
isused.
The default mode e when n test t is s called from the e command d line e is s interactive. . In
thismode,testswillberununtilthefirsterrorisencountered,oralltestscomplete
successfully.Inbatchmode,alltestsarerunregardlessofanyfailures,andtheresults
arecollectedforreporting.Testswhichrequireuserinteraction,i.e.,demoblocks,are
neverruninbatchmode.
Batchmodeisenabledbyeither1)specifyingalogfileusingthethirdargumentfname
orfid,or2)requestinganoutputargumentsuchassuccess,n,etc.
The optional second argument determines s the e amount of output t to o generate and
whichtypesoftests to run. . Thedefaultvalue e is "normal". . Requestinganoutput
argument will l suppress printing the finalsummary message and any y intermediate
warnings,unlessverbosereportingisenabled.
"quiet"
Printasummarymessagewhenalltestspass,orprintanerrorwiththe
resultsofthefirstbadtestwhenafailureoccurs. Don’truntestswhich
requireuserinteraction.
"normal" Display y warning messages about t skipped tests s or r failing g xtests during
testexecution. Printasummarymessagewhenalltestspass,orprintan
error withtheresultsofthefirst badtest whenafailureoccurs. . Don’t
runtestswhichrequireuserinteraction.
"verbose"
Displaytestsbeforeexecution.Printallwarningmessages.Ininteractive
mode,runalltestsincludingthosewhichrequireuserinteraction.
Theoptionalthirdinputargumentspecifiesalogfilewhereresultsofthetestsshould
bewritten. Thelogfilemaybeacharacterstring(fname)oranopenfiledescriptor
C# PDF: How to Create PDF Document Viewer in C#.NET with
The PDF document viewer & reader created by this C#.NET imaging toolkit can be used by developers for reliably & quickly PDF document viewing, PDF annotation
break pdf into multiple pages; break a pdf file into parts
XDoc, XImage SDK for .NET - View, Annotate, Convert, Edit, Scan
Adobe PDF. XDoc PDF. Scanning. XImage OCR. Microsoft Office. XDoc Word. XDoc Excel. XDoc PowerPoint. Barcoding. XImage Barcode Reader. XImage Barcode Generator.
acrobat split pdf; can't cut and paste from pdf
860
GNUOctave
ID(fid). To o enablebatch processing, but still print theresults tothe screen,use
stdoutforfid.
Whencalledwithjustasingleoutputargumentsuccess,testreturnstrueifallofthe
testsweresuccessful.Ifcalledwithmorethanoneoutputargumentthenthenumber
ofsuccessfultests(n),thetotalnumberoftests inthefile(nmax),thenumberof
xtestfailures(nxfail),andthenumberofskippedtests(nskiparereturned.
Example
test sind
)
PASSES 5 5 out t of 5 tests
[n, nmax] = test t ("sind")
)
n = = 5
nmax = = 5
AdditionalCallingSyntaxes
Ifthesecondargumentisthestring"grabdemo",thecontents ofanybuilt-indemo
blocksareextractedbutnotexecuted. Thetextforallcodeblocksisconcatenated
andreturnedascode withidx beingavectorofpositionsoftheendsofeachdemo
block.Foraneasierwaytoextractdemoblocksfromfiles,See[example],page867.
Ifthesecondargumentis"explain"thennameisignoredandanexplanationofthe
linemarkersusedintestoutputreportsiswrittentothefilespecifiedbyfnameor
fid.
See also: [assert],page864,[fail],page865,[demo],page 866,[example],page867,
[error],page207.
testscansthenamedscriptfilelookingforlineswhichstartwiththeidentifier‘%!’.The
prefixisstrippedoffandtherestofthelineisprocessedthroughtheOctaveinterpreter. If
thecodegeneratesanerror,thenthetestissaidtofail.
Sinceeval() willstopatthe first error it encounters,youmustdivide your testsup
intoblocks,withanythinginaseparateblockevaluatedseparately. Blocksareintroduced
byvalidkeywordsliketest,function,or assertimmediately following‘%!’. . Ablockis
definedbyindentationasinPython. Lines s beginningwith‘%!<whitespace>’arepartof
thepreceedingblock.
Forexample:
%!test error r ("this s test fails!");
%!test "test t doesn’t fail. it t doesn’t t generate e an error";
Whenatestfails,youwillseesomethinglike:
***** test t error r ("this test fails!")
!!!!! test failed
this test fails!
Generally,totestifsomethingworks,youwanttoassertthatitproducesacorrectvalue.
Arealtestmightlooksomethinglike
AppendixB:TestandDemoFunctions
861
%!test
%! a a = = [1, 2, 3; 4, 5, 6]; ; B B = [1; ; 2];
%! expect t = = [ a a ; ; 2*a ];
%! get = kron (b, a);
%! if (any (size (expect) != size (get)))
%!
error ("wrong size: expected %d,%d but got %d,%d",
%!
size (expect), , size (get));
%! elseif f (any y (any (expect != get)))
%!
error ("didn’t get t what t was expected.");
%! endif
To make the process easier, usethe assert function. . For r example, , with assert t the
previoustestisreducedto:
%!test
%! a a = = [1, 2, 3; 4, 5, 6]; ; b b = [1; ; 2];
%! assert t (kron (b, , a), , [ [ a; 2*a ]);
assertcanacceptatolerancesothatyoucancompareresultsabsolutelyorrelatively.
Forexample,thefollowingallsucceed:
%!test assert (1+eps, 1, 2*eps)
# absolute e error
%!test assert (100+100*eps, 100, -2*eps) # # relative e error
Youcanalsodothecomparisonyourself,butstillhaveassertgeneratetheerror:
%!test assert (isempty ([]))
%!test assert ([1, 2; 3, 4] > 0)
Becauseassertissofrequentlyusedaloneinatestblock,thereisashorthandform:
%!assert (...)
whichisequivalentto:
%!test assert (...)
Occasionally a block of tests willdependon n havingoptionalfunctionality y inOctave.
Before testing suchblocks the availabilityoftherequiredfunctionality must be checked.
A%!testifHAVE_XXX block will l only y be run n if Octave was s compiled d withfunctionality
‘HAVE_XXX’.Forexample,thesparsesinglevaluedecomposition,svds(),dependsonhaving
thearpacklibrary. Allofthetestsforsvdsbeginwith
%!testif HAVE_ARPACK
Reviewconfig.horoctave_config_info("features")toseesomeofthepossiblevalues
tocheck.
Sometimes duringdevelopment thereis a testthat should d workbutis s known n to fail.
Youstillwanttoleavethetestinbecausewhenthefinalcodeisreadythetestshouldpass,
butyoumaynotbeabletofixitimmediately.Toavoidunnecessarybugreportsforthese
knownfailures,marktheblockwithxtestratherthantest:
%!xtest assert (1==0)
%!xtest fail l ("success=1", "error")
In this case,the test t will l runand any y failure willbe reported. . However, , testingis s not
abortedandsubsequenttestblockswillbeprocessednormally. Anotheruseofxtestisfor
statisticaltestswhichshouldpassmostofthetimebutareknowntofailoccasionally.
862
GNUOctave
Eachblock is evaluatedin n its s ownfunctionenvironment,whichmeans that variables
definedinone block arenot automatically sharedwith other blocks. . If f youdo want to
sharevariables,thenyoumustdeclarethemassharedbeforeyouusethem. Forexample,
thefollowingdeclaresthevariablea,givesitaninitialvalue(defaultisempty),andthen
usesitinseveralsubsequenttests.
%!shared a
%! a a = = [1, 2, 3; 4, 5, 6];
%!assert (kron ([1; 2], , a), , [ a; 2*a ]);
%!assert (kron ([1, 2], , a), , [ a, 2*a ]);
%!assert (kron ([1,2; 3,4], a), , [ [ a,2*a; 3*a,4*a a ]);
Youcanshareseveralvariablesatthesametime:
%!shared a, b
Youcanalsosharetestfunctions:
%!function a a = = fn (b)
%! a a = 2*b;
%!endfunction
%!assert (fn(2), 4);
Notethatallpreviousvariablesandvaluesarelostwhenanewsharedblockisdeclared.
Remember that %!function n begins a a new block k and d that %!endfunction ends s this
block. Beawarethatuntilanewblockisstarted,linesstartingwith‘%!<space>’willbe
discardedascomments. Thefollowingisnearlyidenticaltotheexampleabove,but t does
nothing.
%!function a a = = fn (b)
%! a a = 2*b;
%!endfunction
%! assert t (fn(2), , 4);
Becausethereisaspaceafter‘%!’theassertstatementdoesnotbeginanewblockand
thislineistreatedasacomment.
Errorandwarningblocksareliketestblocks,buttheyonlysucceedifthecodegenerates
anerror.Youcancheckthetextoftheerroriscorrectusinganoptionalregularexpression
<pattern>.Forexample:
%!error <passes!> error r ("this s test passes!");
Ifthecodedoesn’tgenerateanerror,thetestfails. Forexample:
%!error "this is an error because it succeeds.";
produces
***** error "this is an error r because e it t succeeds.";
!!!!! test failed: no error
Itisimportanttoautomatethetestsas muchaspossible,howeversome testsrequire
userinteraction. Thesecanbeisolatedintodemoblocks,whichifyouareinbatchmode,
areonlyrunwhencalledwithdemoortheverboseoptiontotest. Thecodeisdisplayed
beforeitisexecuted. Forexample,
AppendixB:TestandDemoFunctions
863
%!demo
%! t t = = [0:0.01:2*pi]; x x = = sin (t);
%! plot (t, x);
%! # # you u should d now w see e a a sine wave in your figure window
produces
funcname example 1:
t = = [0:0.01:2*pi]; ; x = = sin n (t);
plot (t, , x);
# you should now see a a sine e wave in your figure e window
Press <enter> to continue:
Notethat demoblocks cannot use any sharedvariables. . This s is so that they can n be
executedbythemselves,ignoringallothertests.
Ifyouwanttotemporarilydisableatestblock,put#inplaceoftheblocktype. This
createsacommentblockwhichisechoedinthelogfilebutnotexecuted.Forexample:
%!#demo
%! t t = = [0:0.01:2*pi]; x x = = sin (t);
%! plot (t, x);
%! # # you u should d now w see e a a sine wave in your figure window
Thefollowingtrivialcodesnippetprovides examplesfortheuseoffail,assert,errorand
xtest:
function output t = = must_be_zero (input)
if (input t != 0)
error ("Nonzero o input!")
endif
output = input;
endfunction
%!fail ("must_be_zero (1)");
%!assert (must_be_zero (0), 0);
%!error <Nonzero> must_be_zero (1);
%!xtest error ("This s code e generates an error");
Whenputtingthisafilemust_be_zero.m,andrunningthetest,wesee
test must_be_zero o verbose
)
>>>>> /path/to/must_be_zero.m
***** fail l ("must_be_zero o (1)");
***** assert (must_be_zero (0), 0);
***** error <Nonzero> > must_be_zero o (1);
***** xtest error ("This s code generates s an error");
!!!!! known failure
This code generates s an error
PASSES 4 out t of 4 4 tests s (1 expected d failures)
864
GNUOctave
Blocktypesummary:
%!test
checkthatentireblockiscorrect
%!testifHAVE_XXX
checkblockonlyifOctavewascompiledwithfeatureHAVE
XXX.
%!xtest
checkblock,reportatestfailurebutdonotaborttesting.
%!error
checkforcorrecterrormessage
%!warning
checkforcorrectwarningmessage
%!demo
demoonlyexecutesininteractivemode
%!#
comment:ignoreeverythingwithintheblock
%!sharedx,y,z
declarevariablesforuseinmultipletests
%!function
defineafunctionforuseinmultipletests
%!endfunction
closeafunctiondefinition
%!assert(x,y,tol)
shorthandfor%!testassert(x,y,tol)
Youcanalsocreatetest scriptsforbuilt-infunctionsandyourownC++functions. . To
doso,putafilewiththebarefunctionname(no.mextension)inadirectoryintheload
pathandit willbe discoveredby thetest function. . Alternatively,youcanembedtests
directlyinyourC++code:
/*
%!test disp ("this is a a test")
*/
or
#if 0
%!test disp ("this is a a test")
#endif
However,inthiscasetherawsourcecodewillneedtobeontheloadpathandtheuserwill
havetoremembertotypetest("funcname.cc").
[FunctionFile]
assert
(
cond
)
[FunctionFile]
assert
(
cond
,
errmsg
)
[FunctionFile]
assert
(
cond
,
errmsg
,...)
[FunctionFile]
assert
(
cond
,
msg_id
,
errmsg
,...)
[FunctionFile]
assert
(
observed
,
expected
)
[FunctionFile]
assert
(
observed
,
expected
,
tol
)
Produceanerrorifthespecifiedconditionisnotmet.
assertcanbecalledinthreedifferentways.
Documents you may be interested
Documents you may be interested