Create mobile apps with HTML5, JavaScript and Visual Studio

(Elle) #1
ement1); areaSeries Add(seriesElement2); areaSeries Add(seriesElement3); // Add series to the plot area plotArea Series Add(areaSeries); //page Elements Add( new LayoutGrid() ); // Add the page elements to the page AddEAement1); areaSerieies.AAdd(se(srriesElement2t2); a) reaSeries.AdAd(seriesElement3); // Add series to the plot area plotArea.Series.Add(areaSeries); //page.Elemenem ts.Add( ddd(new ne LaLayyoutGrid() ); // A/ dd the page elements to the page AddEA

s, 240, 0); AddEAN1AN3SupSup5(pa5(pge.Elemeentnts, 480, 0); AdddUPCVersionA(page.Elemenets, 0, 135); AddUPCVersionASup2(page.Elements, 240, 135); AdddUPCddUPCd CVerssionAionAo Sup5((page.Elemennts, t 480, 135); AddEAN8(page.Elements, 0,

.Elements, 480, 2 2 70);; AddddUUPCVersionE(papage.Elementts, 0, 405); AddUPCVersionESuE p2(page.Elements, 240, 405); AddUPCVersionESup5(pageage.Ele.Elelemmments, 4s, 4 880 0, 4 405); // AAdd the page toe t the document document.Pages.Add(pa

CaptionAndRectanga lee(elemeements, “EAN/JA/JAN 13 Bar Codde”, x, y, 204, 99); BarCode barCode = new Ean13(“123456789012”, x, y + 2 1 ); barCode.ode.X +=X +X +=X+ ((20 0 4 -4 - baarCoode.GettSymbolWidth()h) / 2; elements.Add(barCode); } private vovo

dRectangle(elementes,, “EANEAN/JAN 13 Bar Car Code, 2 digit supplement”, x, y, 204, 99); BarCode barCode = new Ean13Sup2(“1 2 234556789678012121 2”, 2”, x, yy + 2+ 2 1 1); 1); barCoode.XX += (2 0 4 - barCode.GetSymbolWidth()) / 2; elements.Add((barC

ts, float x, float yy) { A{ AddCaCaptionAndRectanangle(elements, “EAN/JAN 13 Bar Code, 5 5 digit supplement”, x, y, 204, 99); BaBrrCodee barrCode == new Ean13SupS 5(“12345678901212345”, x, y + 21); ba

s.Add(barCode); } }pprivate te vooid AddUPCVPCVersiersonA(Group elements, float x, float y) {Add{ CaptionAndRectangle(elements, “, UPC VersVersVersVersion ionioA Baar Cr Coode”, x, y,y, 2 04 , 99);; BarCoode barCode = new UpcVersionA(“12345678901”, xx, y +

s.Add(barCode); } }pprivate te vooid AddUPCVPCVersiersonASup2(Group elements, float x, floato y) { AddCaptionAndRectangle(elementm ““UPCC Version E Bar Code, 2 digit supplement”, x, y, 204, 9 4 9); BarCoode od

21) ; barCode.X ++= (2= ( 04 - barbaCode.GeetSymbymbolWidth()) / 2; elements.Add(barCode); e} private void AddUPCVVVersionASSSSup5(uuup5( Group elements,n float x, flfloaflot

digit supplement”,t” xx, y, 2 20 04, 99); BarCodeCode bbarCode = new UUpcVep rsionASuASp5(“ 12343 567890112345”, x, y + 21); bbarCarCode.Xde.X += (204 - barCode.GetSymbomolWidth()) / 2 2; eelele

t x, float y) { AddCapdCaptionnAndRAndectangle(eleelemments, “EAN/JANN 8 8 Bar Code”,de”, xx, y, 204, 0 99); BarCode barCode = nnew Eew Ean8(an8(n8n8“1 2345670”, x, y + 21); OpenFileileDialaog fileDiealoloogog =

g.Filter = “Adobeob PDPDF fileess (.pdf)|.pdf|Alll FileFiles (.)|.”; if (fileDieDalog.SShowDiialog() == DialogResult.OK) { { pdfVpdfVfieweewer.Opr.OpOpOpen (fifileDialogalog.FilleName, “”); } SaveveFileDialog saveFaveFileileDDialoog = neneww Sav


Dialog.Filter == “AdoAdobe PPDF fiDF files (*.pdff)|*.pdpdf|A|All Files (*.*)|*.*”;”; iff (saveFFileDialolog.Showh Dialog() ==DialoalogResgResReeult..OK)OK) OK) { pdfVfVView .SSaveAsve (sav(saveFieFileDia

printer = pdfViewViewer.Perrinterr; pprinter.PriintWiWthDialog(); } elsee { MesssageBox.SShoww(“Please opeopen a n a fifile to pto printrinrint”)”); }OpenFinle DDialoog fileDieDalogalog = new OpenFileDDialog(); fileDiaDialog.ogTittle = e e = e “Opepen File Dl

les (*.*)|*.*|Addobe Pe PDF files es(*.p*.pdf)|*.pdddf”; if i(fifileDialog.ShowwDialalog() === DialogResult.ultOK) { { DynaDynamicPDFVDFVDFVDFViewiewewerClass test e = neew DynammiccPDFViewerClass((); PPDFPrinter terpprinp ter er r = te= ttetst.OpenFFileFo

= File.ReadAAllByteBytes(@”C:\M:\MyDyDoc.pdff””); //u//sing System.Runntimme.IntntteropServicces;GCHaGCHandlendledd gch=GCH=CHaaananddle.Aloc(conteents, GCHandleTTy pee.Pinnedd); ) IIntntPtrPtr cocontonentsIntPtr = g

tents.Lengthh, “”);“”); A AddCaCaptioonAndReReectananglee(pageElementts, “BBooB kmarkk k Pagee E Elemelemeent:”nt:”, x,, y);; pa pagpagaaeEeEleemeents.Add(newtesw t Bookmookmaark(“Bookmarked TextTextt”, x + 5 5 , y , y, yy++2+ 20+ , paprentre OutlO ine)); p) a

215, 10, Fonnt.TTimemesRomanma, 10 10 )); } prprrriivate vooid AddCiirclercle(G(GGroup paageElemeenntsnnts, floafloat x,x floafloatyt y)t y) { / { /////Add/Add/A ss a circlt to the papge Eleemenmentenents AddCapdCapdCapCaCationt AndRdRectae

Add(new Cirrcle(x e(x++ 112.5f5f, y ++ 50f, 1 0 07.5f, 30f, 0 RgbColoolor.RRRed, RgbColbb or.Bor.Blueluee, 2, LLineeStyylyylle.DaeDashLasLrge))); } pprivate void AdAd FormatteedTexd xtAreea(Groupp paageElements, floflat xa , fl float yy)) { )// A// AAdds dds a foa formatted textte a

mic</i><b>PDFPDF</b>/b>&tm; GGenerator vvv 66 6.0 6 for ..NETNET has has a forrmattted ttetext arrea pea page aaa “ + “ “ele“ele“eleeeemmmentm. ThThis prroviddes rich fororm m atting ssuppupport for texext that appapeears in the doocumment. You have “ + “+ “compcompletlete concotrolol oveovevever 8 r paragraph

left indentattionn, rigrighht indenentation, aligliggnnment, allollowing orphaaan linnes, aand whwhite ite“ + “spa“spaacece pce ppprereservataion; 6 foont propropeerties: e <fonont fat fce=’=’Timemes’>s’>font facece, <//fontt><font ppoinntSize=’6’>font “ + “s+ “size, </font>ont><fonont cot cocooolor=lor=’FF0000’00’>c

2 line prpropertieses: le leading, ag ndd leaddinngg type.ype. TTe xt can also be rootateeed.</d.</<p>”;p> FFororommattmattm ededTeeedTeTeextArx ea fformaormattedTTextAreArea = nnew FormattedTextTe xAreare(formattatedHHtmll, x + 5, yy + 2 0, 215, 60, FonttFammily.Helveelvetictica, 9, fffalalsse);se);se);sssse) // // Sets the i

ddCaptionAAndReRectanct gle(e(pagepageElemeenntsnts, “F, “FororrmarmattedtteTextT Areeae Page ElElemenement:”,t:”,,, x, y); y); y)yAddCAdAddCddCaptionAnAndReectangnglele(pageElements, “FormatmtedTextAxrea OverOvflflow TText:”, x x + 2 279, y); pageElementments.Add(foormarmattedTTTextAxttAtAArea)r ; // CrCrerate

tArea overflowFoowFormatrmtedTdTextAArea == foormamattedtdTdextArea.GettOveerflowwwFormatmatteddTTexextAxx rea(rerea(rex + x 28 284, y +y 20 0); pageElements.Add(overflowFormattedTextAArea)); } pprivate vooid AddImage(Group ppagpageElementsents, float t x, flo, at yy) { ){// // A/ dd

ents, “Imagee PagePage Elementen:”, xx, y); IImagemagem imaaage =ge new Imaage(SServvever. Mr.MapPatattth(“.h(“.“./I./Im./ agesages/DPDDFLogL o..png”), x + 112.5f, y + 50f, 0.24f); // Image is ssizzed and centeredd inn the rectangle immage.ageSetBoundunds(21s(215, 5, 6 5 0); 0)image.VAVAAlign

ge); } privatte void oid AAddLabela (Group pp ppageageElememments, float x, flfloat y) { ///A/ Adds as aa llabel tel t to thte pappapgegeElemenementts AddCaptionAndRectangle(pageElemenm ts, “LabLael & PPageNummbeeringLabel Page EElemments:”, x,x, y); y)striing g laabelTextxt = = “= ““Lab

aain page numbumberinering: %%CP%%CP%%% ofof % %%T%%TP%%% pages.”; LLabeel labbel = nnew Lew LLLabela (labbelTeelTeelTeexxt, x + 5, y 5 ++ 12, 220, 80, Font.TimesRoman, 12, Te xetAlign.C.Centter); label.Annglee = 8; PageNumbeeringgLabel pagepageNumLNumLabelab = nnnewew Pw Page

, 12, TeextAlxtAligign.CentC er); pagaeEleementntntss.Ad.Addd(paageNumLabel));); pagpgeElemenments.Addddd(d(label)); } } privprpp ate voidoid AddA Line(Group pageElements, float x, floaot y) { /// Addds aa line to thethe pageElements AdddCCaptionAndRAndRRectannglengle(pag(pagaeeElemments

+ 5,+ y ++ 20, x + 220, y + 80 80 , , 3, RRgbbColor.Gr.Geeen)); pageElemmementsns.Addd(d(new w Linee(x ++ 22 2200 , yy ++ 20, x + 5,+ 5, y + 80, 3, RgbColor.Green)); } private void AdddLLink((Grouup pageEElemments, float x, floaat yy) { // Adds ads a link ttoo thethhe pagp eEleEleemen

ynynamicPDF.com.m”; AAddCaddCaptioptionAnAndAnddRectanangle((pageElementts, “LLink PaPagege Elemment:nt:”, xx, y);y); LLabel llabela = new Label(text, x + 5, y + 20, 215, 80, font, 12, 2 RggbCoolor.Blue)e); laabel.Underline = true;rue Link link =k = newnew LLinnk(x k(x ++ 5,5, y y ++ 20,

on(o“httpp://www.dynnamicppddf.coomm””))); pageEeElemments..Add(Ad labbeel);l); ppagepagpageElementsnts.AAdd(link); k)} prpivatee void AddPath(Group pageElements, float x, float y) { // AAdds a path to the pageElemeents cee Te.DynamicamiiccPPDPDF.PagegeElemlelemments.PatPh

20, 0 RgbgbbColor.Blue, RgbCRgbCoolor.RRedd, 2 2, LineStyeSlee.Solidd, true); pathhh.Su.SubbPaths.A.Adddd(new Lw LineSineSubPaubPath(x + 215, y + 40)); path.SubPaths.Add(new CurveToSTo SubPPathh(x + 1+ 08 , y + 80, x + 160,, y ++ 80 0)); path.SubPSubSubPathshsss.A.AddAAd(new(ne CurveS


ectecctanglangle(pageElemeents, “P“Path Ph Paage ge Element:””, x, yy);) pageEEEEleElemeentss.AdAdd(pad(pathth)); } pprivaate ve vooid AAddRectangle(Group pageElements, float x, float y) ororderededdList = ordeo redLedList.GetOverFlowLoList((xx + x 5, y + 2+ 2 200 0); AddCAdCdCCaptiapa oonAndRect

2222 5, 1 5 11 0); page.Eleements.Ats.Add(odd(ordrderrdr edList); x == 0; 0;y +y +y +=+= 118188 ; // CCCreaate e an ua norrderede lisist UnUnordderedList unorderedList = new UnoroderedList(x + 5, y +y + 2 20, 4400 , 900 , Font.Ht.Helvetica, 10); uuunoorderredListst.It.Items.AmmmsAdd(“ddd(“FruFFFFrFruFruitss”); unorder

ereeies(); pieSeries.DaataLababel = da; plotArea.Seeriesess.A.AdAdd(pieSSSeriesess);s ppieSeries.Elemelementss.AddAdd(27,7, “Website A”); pieSeries.Elements.Add.Ad(19, “Website e B”)); pieSerrieses.Elementmens.Add(21, “WWebssite CC”); pieSpieSSerieeririees.Eleememenemets[0s[0].Color = a

esss.Elemments[ 2 ].Color = auttogradient3;”unoroderderredSubd LList2 == unoorderedList.Items[ms 1 ].SubLubLissts.AAddUnorderedSubList(); unorderedSubLu ist2.Items.Add(“dd(“Pottato”); unuordeeredSubList2.Itemmms.A.Add(d(“Beaeaansans”);;; UUUnorU dereeredSubSuList subU


eddSud bList(); subUnoUnorderedSubList.Items.As.AAddd(““Lime”); subUUnorddereedSubList.Itemtems.Ads.Add(“Od(“Orangrange”);e” UnorderdedSubList susbUnorderdedSue bList2 = unnorddereedSubLisLit.Items[ms 1 ].SubLists.s.AddUAAddUdnorrderededddSubLSubLbList(st); ssubUnubUnoorderedSe ub


aana”); UUnorderederedSubList subUnordo erededSubLSu ist3st3 = uunnorderredSubLSubList2.Itetms[0 0 ].Su.SubLisLists.As.AddUnd orderedSSubList(); subUnoU rderedSudSubList3.Items.AAdd((“Swweet Potaoto”)); UUnorderedSredSubLubLiLst sstubUUnordrdeeredSredSdSdSubList4 stst 4 = ununorderedSu

SuSuubList4 44 .Ite.Items.Am dd(“String Bean”n”); s; subUnbUnordeereedSubbList4..Itemms.Addd(“Lima BeanBean”); subUsubUnnorderedSubList4.Items.Add(“Kidney Bean”e ); x += 279; pagpage.EElemenntts.Addd(unorderedListst); u); ; nordnoeredreddLisst = =uunnorderedredddLisst..GetGOvervFlo


e.e.Elemeentsen, “Unordered List Page EgeElemment On verflverflow:””, x, y,, 225 5, 110 ); page.Elemementsents.AddAdd(un(unorderedList); } private void AddTextFtield(Group pageEeElemlemennts, flfloaat x, flooatt y) { TextFFieldieldd txt = new Tew extFextFieldeld(“txtfnafnaaame”,me”,meme”, x +x + 20, 20, y +y+

aatted TeextArea(formattedHtml, x ++ 5, 5 y ++ 20, 202 215, 15 60, FontFFamilyy.Heelvetica, 9, ffalse)se; /// SetSets ths the ine dent property formattedTextArea.Style.Paragraph.IndeIn nnt = 118 8; AddCaptCapionAndRendRectanaagle(gepagepagep eEElemElements, “FFormaormamttedttedtedtedTeTextArearea P

atteatatd TeextArea Overflow TeTeext:”, x + 27 9, y9, y); p; pageEgeElements.AAdd(formformattedTextAArea); a)// CCreateaee an overflow formatted text area for the overflow text FoFormmattedTtedTextAxtreaMMaxaxLeLengthngth = 9 = 9=9; txtxtxtxxt1.B1.BordededrCorColor =r = RgbColoCololoor. Br. BBlaack; txttxt1.Ba1 Ba

MaMMMximuum Lengthgth”; p; ageEgeEEElemeements.nts.Add(Add(txttxt1); TTextFex ieldd txt 2 = neew TeextField(“txxtf2namename”, xx + 3+ 30, y + 30, 150, 40 ); txt2.DefaultValue = “This is a Te xxtFtFieldd whiichh goees tottoto the nexxt lit liline ne iiif thffte text et etxceexceeds wds wididth”; ”; ttxt2.xt2xt2.xt2MMMultMuiLinLine = e =

RgRRbCooolor.AliceBlueBluee; txt2.T2.oolTip == “M“Multiline”; ppageEElemennts.AAdd(ttxt2); AddCapCaptiont AndRAndRecctangle(pageElements, “TextField Form Page Element:”, x, x, y, 50450444 , 85 85 ); }; } pr rivate voioidd AddComCCC boFiboeld(Group pap pageElgeElemeemenenettts, tsfloat x, fl

, , y + 400 0, 150,, 20 20)20);c; cb.BoroderCd olor = RgbColorr.BBlack; cb.BaackggrounndColor = RgbCRgbColoro.AliAliceBceBlue; cb.Font = Font.Helvetica; cb.FontSize = 12; cb.Itemsem.AAdd(“(“It((em 1m 1”); ; ccb.IItemste .Add(“It““Item 2em 2”); ”);cb.Icb.Itemsems.Add(“Item 3em 3”)); cb.IItems

aaable”bbb ].SSeSeSeleleclected = true; cb.Edb itable = true; cb.ToToololTip = “Editable Coe Combo Box””; pa; pageElgeEemements.Add(cb); ComboBox cb1 = new ComboBox(“cmb1namame”, x + 303, 030 y +y + 40, 4440 150 , 20 0 ); c); cb1.Bb1.Bb1 ordeorderColrColoor = RgbgColoor.Blr. BrBrBack;ack cb1.Bac

.F..FFFontontSize = 12; cb1.Items.Add(“Item 1”); cb1.Items.AAdd(“Item 2em 2”); ccb1.Items.Add((“Itemem 3”); cb1.Items.Add(“Item 4”); cb1.Items.Add(“Non-Editable”);”); cb 111 .Items[“NNon-Eon-Editable”].Selecteccced =ed = tru true; ce; cb1 Eb1.EEditable e= fa= flse;se cb1.ToolT

eerrter.Coonvert(“http://www.google.com”, “Output.pdf”));Convverteer.Coonvert(GetDocD PathPath(“Do(“DcumentA.rtf”), “Output.pdf”);System.Diagnostics.Process.s.SStartt(“Ot(“utpuuutpuutputt.pdf”);”); AsyncCoConvernverrttter aConaConvertverter =e newe AsyncCncConnverter(); aC

vveerted); aConverter.ConversionError += new ConversiionErroorEvventHHandler(aConveerteer_ConversionError); aConverter.Convert(@”C:\temp\DocumentA.rtAf”f , f”, ””@”C:C\temtep\OuOtputtputA.pdA.pdf”);f”); aCo aCoa nverter.Convert(ert@”C:\teme p\Dop\DcumentB

\Doc\D ummentC.rtf”, @”C :\temp\OutputC.pdf”); aConverrter.Coonverrt(“hhttp://www.yahoo.coo.com”, @”C:\Te mp\yahoo.pdf”); ConvC ersionOptions ops optiontions = new new nneewewConversiesonOpOptiontionoos(72s(720, 70, 720, 72, 7 true); ceTe.DynaDynamicPm DF.CDF.Conveon rsiorsion Con.Co

outpouut.pdf”, optionso ); ceTe.DynamicPD F.Conversion.CConveerter.ConvConert(“C:\\temp\\\Documocument2.docx”, “C:\\temp\\op\utput.pdf”, optioptioptiopptons)ons);s; stringing sampleHpletml m= “<“<htmlhtml><bo><bobdydy><p>This is s a very simplee HTMLHTHTMLHT strstrsing iningininclincincincludinudng a g a g TT

( g[] g)

{{

pp

gg g ( p p )

[ ]

[ ]

pp y y yyp

High h SecuSec rity sec uriturit y y new w High h Secu u rity y (“O Ow nerPassword” , “U “ serPassw ord” )

yy pyp

ees y yy

p

( p p )

pag p ( p pp )

p ()

}

GI<:@J<CP


GIF>I8DD<;


=FIJG<<;


KIPFLIG;=JFCLK@FEJ=I<<KF;8P


nnn%;peXd`ZG;=%Zfd&\mXcfiZXcc/''%-*(%,''-s"(+('%..)%/-)'


;peXdZG;=Ç:fdgi\_\ejm\G;=Jfclk`fej]fi%E<K;\m\cfg\ij


Z\K\Jf]knXi\Ëj;peXdZG;=gif[lZkjgifm[\i\Xc$kd\G;=^\e\iXkfe#dXeglcXkfe#Zfem\ij`fe#


gieke^#m\ne^#Xe[dlZdfi\%Gifm[e^k\Y\jkf]Yfknfic[j#k\fYa\Zkdf[\cjXi\\oki\d\cp


Õ\oYc\ Ylk jkcc jlggcp k\ i`Z ]\Xkli\j pfl e\[ Xj X [\m\cfg\i% I\cXYc\ Xe[ \]ÔZ\ek# k\ `^_$


g\i]fidXeZ\ jf]knXi\ j \Xjp kf c\Xie Xe[ lj\% @] pfl [f \eZflek\i X hl\jkfe n`k_ Xep f] fli


Zfdgfe\ekj#jdgcpZfekXZkZ\K\Jf]knXi\Ëji\X[cpXmXcXYc\#e[ljkip$c\X[`e^jlggfikk\Xd%


NNN%;PE8D@:G;=%:FD

K


n


Untitled-1 1 9/8/11 11:56 AM
Free download pdf