Checkbox999ddd.com

999ddd.com  时间:2021-04-09  阅读:()
ApowerfultemplateenginethatconvertsdataintoiTextqualityPDFsWhitePaperV1.
2www.
itextpdf.
com2IntroductionManyorganizationsstrivetomaketemplatingmoreuser-friendly,withoutconstantlypesteringthedevelopmentteamwithadhocrequests.
Whatifyoucouldhaveaneasywaytoconfigureanddesigndata-drivenPDFoutputtemplatesorinputforms,andconnectthesetotheappropriateback-endlogicanddata,ensuringcorrectbusinessresultsandprofessionaloutputThat'swhatiTextDITOisallabout.
WhatisiTextDITOiTextDITOsimplifiestheprocessofcreatingmultipleoutputtemplatesorinputforms.
AnintuitiveWYSIWYG(WhatYouSeeIsWhatYouGet)front-endgivesyoutheabilitytocreateyourowndata-drivenoutputtemplatesorinputforms,tiedtoapowerfulback-end.
iTextDITOhandleseverythingfromHTML5inputformcreationanddataprocessingwithJSON,tothegenerationofPDFs–allwithoutrequiringdeveloperstowriteanycode.
Thisprovidesawaytogetresultswhilereducingworkloadfordevelopersandsavingyoutimeandresources.
iTextDITOisanenterprise-gradetemplateenginebuiltonproventechnology;usingiText7CorewithitspdfHTMLandpdfCalligraphadd-onstoenableseamlessintegrationofHTML5,CSS3,PDF2.
0andgloballanguage/ligaturesupportintoyourdocumentworkflows.
Inthiswhitepaper,wediscussthehowandwhyofiTextDITO.
Startingwithabroadoverviewexplainingthefeaturesoftheframework,wethenlookatwhatiTextDITOcando,andhowitcanhelpyou.
Thisdocumentisaimedatdeveloperswhowillhavetoimplementandmaintainthissolution.
Therefore,we'llgointoextensivetechnicaldetail,explainingadvancedfeatures,configurationoptionsandworkflowimplementation.
WhyuseiTextDITOThereisaclearneedinthemarketforasolutionthatoffersusersthepowerofdynamicdata-drivenformcreation,allowingthemtoquicklydesignPDFoutputtemplatesorinputforms.
iTextDITOisapowerfultemplateenginethatconvertsdataintoiTextqualityPDFs.
Thissolutionallowsuserswithouttechnicalexpertisetodesignanoutputtemplateorinputformandlinkittoadesiredoutputdocument,usingasystemsetupbydevelopersfordataprocessing.
Atitscore,iTextDITObridgesthegapbetweenaninputdocumentandthedesiredoutputformat,usingthedatathathasbeengathered.
Thismeansyou'renotlimitedtoforms;theenginecanacceptanydatathatcanbeconvertedtoJSONandoutputtoeitherPDF,orstructureddatathatcanbewrittentootherdatabases.
Allthisenablesyoutohaveatrulydata-drivendocumentworkflowleadingtosignificantsavingsforyourbusiness.
HowiTextDITOWorks:AhighleveloverviewiTextDITOisatemplateenginewithtwomaincomponents:auser-friendlybrowser-basedapplicationandaJavaSDK.
TheJavaSDKcanbeconfiguredbydeveloperstodotheheavylifting,whilethebrowser-basedapplicationgivesusersaneasytousetooltoleveragethepoweroftheJavaSDK.
Theapplicationitselfcanbeconfiguredtofittheneedsofthebusiness,andtheworkflowcanbeintegratedintoanexistingITenvironment.
Usingthebrowser-basedapplicationuserscanquicklycreateHTML5inputformsandoutputtemplateswhichcanbeutilizedinanumberofways,suchasinputformstocaptureandsubmitdataenteredbyusers(forexampleanapplicationform).
Alternatively,youmightwanttopopulateanoutputtemplateusingexistingdatafromadatabase,togeneratePDFinvoicesorotherdocuments.
Youcanalsolinkinputformstooutputtemplates,tobealteredorcombinedwithotherdatabeforebeingoutputtoaspecificstyleandsavedasaPDF.
Thetemplatesarebuiltusingeasytoaddelementssuchasrichtext,textfields,sub-formsandtables.
StylingcanbeaddedtothoseelementsintheiTextDITObrowser-basedapplication,however,ifyourequirefurtherstylingthenyoucansimplyaddyourownCSStotemplates.
Forexample,companyformattingandbrandingcanbeappliedtothetemplatescreatediniTextDITO.
3Allinputfieldscanbelinkedtoavariableidentifyingtheinputfield.
Thisenablestheusertocombinefieldsintocalculations(e.
g.
Total=PricexQuantity),butalsoallowsoutputdocumentstobecreatedeasily.
Someinputdatawillberelevantasoutput,somemightberelevantasasourceforcalculations,andsomemightevenonlybeusedforauthenticationandservenofurtherpurpose.
Databindingmakesiteasytoincludeinputfromnon-humansourcessuchasdatabasesorRESTfulAPIcalls.
iTextDITOusesdataconvertedintoJSONformatturningitintomuchmorethanaformcreationtool;itcanalsobeusedtostructuredatafromdifferentsourcesintooutputdocuments.
Youcanofcoursealsocombineuserinputwithadditionaldatafromothersources.
Whentheuserissatisfiedwithboththeinputformandoutputtemplate,theycanexporttheresulttoaniTextDITOtemplatepackage.
Thisisessentiallyanarchivefilecontainingallthenecessaryinformationtobuildtheforms,includingallrelevantresourcessuchasfontsandimages.
Tousetheinputformoroutputtemplate,youneedtheiTextDITOSDKwhichisavailableeitherasaDockercontainerforusewithnon-Javaenvironments,orasanativeJavalibraryifyouprefer.
TheSDKistheenginepoweringiTextDITOandisresponsibleforbothpublishingandexecutingthelogictomovefrominputdatatostructuredoutputdata.
TheoutputusuallytakestheformofaPDF,butthankstothedatabindingit'salsopossibletoexporttheinput,forexampletostoreitinadatabase.
TheSDKrunsusingtheiTextDITOtemplatepackageandasetofotherparameters.
Itcanbewrappedintoastandaloneapplication(whichmightberunfromthecommandline),butusuallythefunctionalityoftheSDKwillbeintegratedintoexistingsoftware.
Thismighttranslatetoaneasy-to-usebuttonthatuserscanclickwithouttheneedforanyassistancefromdevelopers,apartfromtheinitialintegrationandimplementation.
iTextDITOenablesapowerfulend-to-endworkflowwhereanyusercaneasilycreateoutputtemplatesorinputformsusingdatafromusers,databasesorboth.
Theycanthenapplythenecessarylogictogetendresultsthatsuittheirneeds.
ThiscanbeaPDFsuchasaninvoiceoralegalrecord,orevennewentriesinadatabase.
YouonlyneedtointegrateiTextDITOandupgradetheimplementationasnecessary(forexamplewithnewCSSstyles).
Bothdevelopersanduserscanworkfarmoreefficiently,requiringfarlessofeachother'stime.
4AdvancedfunctionalitydeepdiveTheeditorThepowerofiTextDITOcomesinpartfromthewebapplication.
Theeasy-to-useyetpowerfulWYSIWYGinterfaceallowsevennon-technicaluserstocreateformsthatoperateexactlyasneeded.
Itisthelogicalconnectionbetweeninputandoutput,andthecomprehensivewayinwhichtocreatethatlogic,thatreallymakestheproductunique.
TheeditorisusedtomakeproprietaryiTextDITOtemplatepackages.
Theycontainallthenecessaryresourcestoproducetheneededoutput,inPDForwrittentoanexistingdatabase.
Theapplicationenablesanyonetocreateuniquetemplates.
Itcanrunlocally,butthewebappisusuallyaccessedthroughalocalserver.
Theeditorconsistsofacentralworkspace;ontherightaresubform-toolssuchastable,imageanddatabindingcontrols,andontheleftisacolumnforadditionalfinetuningofthetemplates,withtemplatestylesheetsandelementsalsodisplayed.
RTFAnyuserfamiliarwithtexteditorsoftwarewillimmediatelyfeelathomeinthecentralworkspacearea.
Richtextoptionsallowthemtoeasilyadjustthestyling,font,colorandoutlineoftext.
Textcanbebothstaticanddynamic.
It'spossibletoinsertdynamicintrusionstakenfromdatatocustomizeeachoutputform.
Obviousexamplesareinvoicenumbers,ornamesofrecipientstakenfromanexistingdatabase.
5SubformsCentraltothefunctionalityofanyformarethesubforms.
Asubformisagroupcontainingdifferentelements.
Byeditingthesubform,allelementswithinitareaffected.
Itispossibletodirectlyaffectthevisualstyleofaformthroughsubforms.
Whencreatinganinvoiceform,forexample,theusercangrouptheitemname,number,quantityandpriceinasubformandcreateaborderaroundalltheseelements.
Visually,thismakesiteasierforanyonefillingtheformtokeepanoverview.
Furthermore,thesubformsallowforsomepowerfuldynamicfeatures,aswe'lldiscussfurtherinthisdocument.
TablesiTextDITOalsosupportstables.
Thisfeatureisespeciallyusefulwhencombinedwithdatabindingofthetablefields.
ItallowsiTextDITOtogetinputdatafromexistingdatabases,oroutputdatagatheredthroughtheformstootherdatabases.
Iftherearemultipleinputvaluesavailableforatablerow,itcanberepeatedasoftenasnecessary.
Auserfillingouttheformcanmanuallyaddnewrows,butiTextDITOcanalsoautomaticallyaddnewitemsasneededwhengettinginputfromaJSONfile.
Intheexampleoftheinvoiceform,youcanimagineatablecontaininganitemname,apriceandaquantityineachrow.
IfyouwanttouseiTextDITOtocreatePDFinvoicesfromadatabase,you'llbeconfrontedwithdifferentcustomersorderingdifferentamountsofitems.
Ifacustomerordersalaptopatacostof500dollars,andakeyboardatacostof10dollars,thetablecanautomaticallycreateasecondrowcontainingtheseconditem.
TextAtextfieldisaverystraightforwardadditiontoanyform.
Itallowstheusertotypewhatevertheywant.
Firstandlastnamesarestraightforwardexamples.
Ausercancreateplaceholdertextthatwillappearinanunfilledtextformbox,toclarifywhatisexpected.
Theycanalsoattachstylesorspecifydatabindings.
ImagesAsaformshouldusuallyreflectthecompanystyle,addingimagesisanessentialfeature.
Youcanaddimagesfromtheinternetoruploadyourown.
UploadedimageswillbearchivedintheiTextDITOtemplatepackageaftercreationofthetemplate.
Themostpopularusecaseforaddingimagesistheinclusionofacompanylogo.
6CheckboxTheadditionofcheckboxesisratherstraightforward.
Ofcourse,it'spossibletospecifythelabelandthestyleaccompanyingthecheckbox.
SubmitbuttonThesubmitbuttonisonlyavailableforinputtemplatesandcan'tcorrespondwithanelementontheoutputtemplate.
Asthenamesuggests,thebuttontriggersthecollectionofthedatafromtheform.
Whenthebuttonisclicked,thedataissenttoapreviouslyselectedURI.
ThedatacannowbeusedtoproduceaPDFoutputtemplate,butitcanalsobestoredinadatabase.
Youcaneasilycustomizetheappearanceofbuttonstofitthetemplatestyle.
InputversusoutputTheworkflowforcreatingtheoutputformisalmostidenticaltothecreationoftheinputform.
It'spossibletoomitcertaininputorperformcalculationsoninputfieldsinordertogenerateoutputfields.
Byadjustingthestyle,theoutputformquicklybecomesaformaldocumentthatstandsonitsownanddoesn'tjustlooklikeacheapreplicaoftheinputform.
Howdifferenttheinputandoutputformslookdependsentirelyonyourbusinessneeds.
FormattingandlogicThebrainofiTextDITOistheSDKwhichusesmanycomponentsoftheiText7code,althoughitisavailableasaseparateproduct.
ThesoftwareisbuiltontheOpenWebPlatformstack,butmorespecifically,HTML,CSSandJavaScriptarethefoundationsofiTextDITO.
ThispowerfulSDKparsesiTextDITOtemplatescreatedwiththeeditorandhasalotofadvancedfunctionswhichmakeitidealfordataprocessing.
Inthissegment,we'lldiscussinsomedetailthewayiTextDITOhandlesdataandlogic,andhowyoucanadddynamicformatting.
Someofthefeaturesbelowarequiteadvancedandareintendedforimplementationbytechnicalusers.
Weprovidethefollowingdocumentationforthebenefitofdevelopers.
DatabindingDatabindingconnectsdatawithtemplateelements.
Bindsmakeitpossibletousedatadynamically;tocreateoutputformsusingdatafrominputforms,tostoredataindatabases,andtoautomaticallyinputdatafromnon-humansources.
Supposeyouwanttocreatecustomticketsforanevent,andyoualreadyhaveallthenecessaryinformationoftheinviteesstoredinadatabase.
Youwanttocreateaninputformtogathertherelevantdatafromthedatabase,andanoutputformthatlookslikethefinalinvitationyou'dbesending.
ThisoutputformisaPDF,builtfromthedatainthedatabase.
Thefirstthingyouneedtoaddisafirstname.
YouneedtocreateJSONdatadefiningthedatabindproperty,followedbythefieldvalue.
TheJSON-datacouldlooklikethis:{"first_name":"John"}first_nameisthevalueofthedatabindpropertyofafield,whilethefieldvaluetakenfromthedatasourceisJohn.
Ifyouspecifyafieldcontainingtextinputandbindthatinputtofirst_name,thefieldwillautomaticallyresolvetoJohn.
7DatabindpropertiesWhenwebindvaluesfromdatatoatemplateitgoesthroughthefollowingtransformation:datavalue->rawvalue->displayvalueTherawvalueistheinternalformatthatiTextDITOuses.
Thedisplayformatcoversthesecondtransformationwhilethebindformatisresponsibleforthefirstone.
Thesamesyntaxisusedforboth.
Bindformatshouldbespecifiedwhendataisexpectedinaformatthatisdifferentfromtheinternalformat.
Intheexampleabove,iTextDITOreadsthedate-timefromdatastoredinBrusselstimezoneformatanddisplaysthetimeinUTC.
ResolvinglogiciTextDITOresolvesinputfollowingasetofrules.
Itisimportanttoknowtheserulesinordertogettheresultsyouwant,whenusingJSONinputdatawithaformtemplate.
ResolvingorderThedataisautomaticallyresolvedagainstthedataboundtothenearestelementinaparentchain,ortotherootdataifnoparentsinthechainareboundtodata.
Supposeyou'vecreatedafieldwithabinding(first_name),nestedwithinasubformwithoutbinding,nestedinturnwithinaparentsubformwithabinding(person).
subform("person"binding)|---subform(nobinding)|---field("first_name"binding)NowimaginetheJSONdataforinputlooksasfollows:{"person":{"first_name":"John"},"first_name":"JaneInthisexample,thefieldwillresolvetoJohn,asthealgorithmlooksforthenearestboundparent,inthiscasethesubformperson.
Youcanchangethisbehaviorbyaddingthe$signinfrontofadatabindvalue.
Theparametertellsthealgorithmtolookforthebindingrelativetothedataroot.
So,theformstructurewouldlooklikethis:8subform("person"binding)|---subform(nobinding)|---field("$.
first_name"binding)Thefieldwouldresolvewiththefirst_namebindingclosesttotherootoftheJSONdataexample,whichisJane.
ResolvingmultipledataentriesResolvingdatatodataboundfieldsiseasywhenthereisexactlyoneentrythatcorrespondswithonefield.
Moreoftenthannot,thenumberofdataentriesisvariable.
Youmighthaveonecustomerwhoorderedtwodifferentitems,andanotherwhoorderedten.
Ifyouwanttoautomaticallycreateinvoicesfromanexistingdatasetcontainingtheorders,yourformneedstocopewiththisvariableinput.
Specifically,youwouldneedtherelevantsubformtoautomaticallymultiplyasmanytimesasneeded.
Thatway,youonlyhavetoaddasinglesubformwithentryfieldsforitem,quantityandprice.
Ifacustomerordersmorethanoneitem,anewlineisadded,asmanytimesasneeded.
Byaddingthe[*]parametertothedatabindvalueofafieldinthewebeditor,thealgorithmknowsitneedstomultiplyasubformasmanytimesastheinputdatarequires.
Apartfromtheparameter,thestructureremainsthesame.
subform("people[*]"binding)|---field("first_name"binding)---field("last_name"binding)Nowthesubformwillmultiplyforeachdataentry.
Iftheinputdataspecifiesthreefirst_nameandlast_namebindslikeintheexamplebelow,theabovesubformwillbeaddedtotheformthreetimes.
{"people":[{"first_name":"John","last_name":"Doe"},{"first_name":"Jane","last_name":"Diluca"},{"first_name":"Han","last_name":"Pak"}]}The[*]parametermeansyouneverhavetoaddthesamesubformmultipletimesmanually,whilealsogivingyourtemplatetheflexibilitytohandleanunknownamountofdataentries.
Ifyouwanttopublishaformformanualfilling,youcancheckacheckboxinthewebeditortoadd+and-buttonsnexttoasubform.
CalculationsandlogicWe'vealreadytalkedaboutperformingcalculationsiniTextDITO.
Sometimes,itmightbeimpossibletoshowthenecessaryinformationontheoutputformusingonlydatabinding.
Youmightforexamplewanttoshowatotalattheendofaninvoice,containingthesumofallitemsorderedintheirrespectivequantities,multipliedbytheVAT.
Inordertosimplifyprocessingofthedatawithouttheneedforpre-processing,iTextDITOcanhandlemanystraightforwardcalculations.
Calculationsallowyoutoassignvaluestocertainfieldsdependingonthevaluesofotherfields.
It'spossibletocalculateafieldusingotherfieldswhicharetheresultsofcalculationsthemselves.
Inasense,youcantreatiTextDITOlikeasimplespreadsheet.
9Inordertoperformcalculationsonthevariablesinafield,youmustnamethefields.
Thefieldnamesactasvariablesthatyoucanuseinmathematicalexpressions.
Ifyouhaveafieldnamedpriceandanotheronenamedquantity,youcancreateafieldshowingthetotalofanorderbydefiningitasprice*quantity.
The[*]parametercanbeusedinthiscontextaswell.
Theparameterallowsyoutoperformacalculationusingavariablenumberoffields.
If,forexample,youwanttocalculateagrandtotalbasedontheorderofanunknownnumberofdifferentitems,you'dneedthesumofthepricefieldofallthoseitems.
Youcandothisbyusingthefollowingnotation:sum(price[*])iTextDITOsupportsthefollowingfunctions:-sum-product-concatAndthefollowingoperators:DataMappingModeTheeditorhasanadditionalviewmodetoseeandconfiguredatabinding.
Youcanswitchtothedatamappingmodebyclickingthefollowingbuttonintheeditor:Thiswillgiveyouaviewlikethis:10VisualstylesandformattingWealreadytalkedaboutsomeeasy-to-usevisualoptionswithinthewebeditor,butiTextDITOhasfarmoreupitssleeve.
YoucandefineveryspecificpersonalstylesusingCSScode,andyoucanevenmakeasingleformlocallyresponsivebasedontheregioninwhichyouwanttouseit.
ValueformattingValueformattingfunctionsarepowerfultoolsthatenableyoutodisplayvaluesinspecificwaysintheoutputform.
Youcanusethefunctionstospecifythedesiredformat.
Currently,iTextDITOsupportsnumberandcurrencyformatting.
Numberformattingisrepresentedasastring,precededbythenumoperator.
Aformattingstringmightlooklikethis:num('$#,##0.
00','de-de')Intheaboveexample,therearetwoarguments.
Thefirstonespecifiesthepattern;thesecondargumentaddsalocale.
Alocale-parameterisoptional,butveryhandywhenyouwanttodeployasingleforminmultiplegeographicalregions.
Itaffectsgrouping,decimalseparatorsandcurrencysymbols.
Forexample,aformatof#,###.
00andatextof4500.
20willlookasfollowswithalocaleof"de":4.
500,20Andasfollowswithalocaleof"us":4,500.
20Therearesixspecialcharactersyoucanusetodefineformatting.
Allothercharactersinaformattingstringwillbeleftintact.
-0(Digit)-#(Digit,zeroshowsasabsence)-.
(Decimalseparator)--(Negativesign)-,(Groupingseparator)-%(Percent,multipliesnumberby100)Time/dateformattingFortime/dateformatting,aswithnumberformattingtherearetwoargumentsthatspecifythepattern,andthe(optional)timezoneID.
IfnotimezoneIDisspecified,thenthelocalonewillbeused.
AnexampleshowingthelocaltimeanddateinPariswouldbeformattedasfollows:date('YYYY-MM-DDHH:mm:ssZZ','Europe/Paris')TheZZinthisexampledisplaystheUTC(CoordinatedUniversalTime)offsetfromtheselectedtimezone.
Thepatternconsistsofspecialcharactersaswellasanyothercharacters,specialcharacterscanbeescapedwith[]brackets.
11Specialcharacters:Month:M-12.
.
.
1112Mo-1st2nd.
.
.
11th12thMM-0102.
.
.
1112MMM-JanFeb.
.
.
NovDecMMMM-JanuaryFebruary.
.
.
NovemberDecemberQuarter:Q-1234Qo-1st2nd3rd4thDayofMonth:D-12.
.
.
3031Do-1st2nd.
.
.
30th31stDD-0102.
.
.
3031DayofYear:DDD-12.
.
.
364365DDDo-1st2nd.
.
.
364th365thDDDD-001002.
.
.
364365DayofWeek:d-01.
.
.
56do-0th1st.
.
.
5th6thdd-SuMo.
.
.
FrSaddd-SunMon.
.
.
FriSatdddd-SundayMonday.
.
.
FridaySaturdayDayofWeek(ISO):E-12.
.
.
67WeekofYear:w-12.
.
.
5253wo-1st2nd.
.
.
52nd53rdww-0102.
.
.
5253WeekofYear(ISO):W-12.
.
.
5253Wo-1st2nd.
.
.
52nd53rdWW-0102.
.
.
5253Year:YY-7071.
.
.
2930YYYY-19701971.
.
.
20292030Y-19701971.
.
.
9999+10000+10001WeekYear:gg-7071.
.
.
2930gggg-19701971.
.
.
20292030WeekYear(ISO):GG-7071.
.
.
2930GGGG-19701971.
.
.
20292030AM/PM:A-AMPMa-ampmHour:H-01.
.
.
2223HH-0001.
.
.
2223h-12.
.
.
1112hh-0102.
.
.
1112k-12.
.
.
2324kk-0102.
.
.
2324Minute:m-01.
.
.
5859mm-0001.
.
.
5859Second:s-01.
.
.
5859ss-0001.
.
.
5859FractionalSecond:S-01.
.
.
89SS-0001.
.
.
9899SSS-000001.
.
.
998999SSSS.
.
.
SSSSSSSSS-0000.
.
0010.
.
.
.
.
9980.
.
9990.
.
TimeZone:z/zz-ESTCST.
.
.
MSTPSTZ--07:00-06:00.
.
.
+06:00+07:00ZZ--0700-0600.
.
.
+0600+0700UnixTimestamp:X-1360013296UnixMillisecondTimestamp:x-136001329612312Notesontime/dateformatting:Formonthformatting,usingtheMMMMpatternwillnotresultinfour-lettermonths,butwillinsteadreturnfullmonthnames.
Ifanincompatibletimeisparsed(onewithtwoconflictinghoursdeclarationsforexample)thenanexceptionwillbethrownIfthepatterndoesn'tcontainmorespecificinformation(e.
g.
itcontainsayearbutdoesn'tcontainamonth)thenformorespecificinformationtheinitialvaluewillbeused(firstmonth,firstdayetc.
)Ifthepatterndoesn'tcontainmorebroadinformation(e.
g.
itcontainsamonthanddaybutdoesn'tcontainayear)thentheclosestpossiblelocalinformationwillbeused(e.
g.
2019fortheyearetc.
)IfthepatternhasaUTC(CoordinatedUniversalTime)offsetthenitwillbeused,andthetimezonewillbeignored.
DuetoDST(daylightsavingtime),thereisapossibilitythatatimeeitherdoesnotexist,orithaspreviouslyexisted.
Ifyoutrytoparseatimethatneverexisted,itwillskipforwardbytheamountoftheDSTgap(usually1hour).
Ifyoutrytoparseaduplicatedtime,thentheearlierinstancewillbetaken.
StylesheetsandclassesiTextDITOtemplatesmakeuseoftheOpenWebPlatform.
ThetemplatesarethereforetoagreatextentcompatiblewithCSSstylesheets.
AdvanceduserscancustomizealmostallvisualpropertiesofatemplatewithCSS.
However,sincetheiTextDITOwebeditorismeanttobeusedbynon-technicalusers,CSSknowledgeisnotrequired.
Anyonecanmodifythevisualstylingwiththedesignertool,butCSSofcourseoffersmoreflexibility.
YoucanalsoembedpersonalizedstylesheetswhileintegratingiTextDITOintothecompanyinfrastructure.
Youcanaddtherelevantstylesonce,allowingtheusertoselectthestyleneedingtounderstandCSS.
Youcanaddanewembeddedstylesheetoruseanexternalone.
Thestylesheetscanbelinkedwithelementsthroughelementclasses.
It'salsopossibletospecifystyleswithoutexplicitlylinkingtothem.
Forexample:*[data-dito-element="rich-text"]{color:red;Inthisexample,allthetextinrichtextelementswoulddefaulttored,unlesstheuserexplicitlyoverridesthetextcolorbychangingthelay-out.
InstallationandintegrationiTextDITOisnotanout-of-the-boxapplication.
TheframeworkneedstobeintegratedwithanexistingITinfrastructure.
Whileanyonecanusetheframeworktocreatetemplatesandforms,theintegrationneedstobedonebyanexperienceddeveloper.
ThedevelopercandefineoptimalworkflowsbyintegratingwiththeexistingITinfrastructure.
iTextDITOisonlyavailableforJavaandrequiresJava8torunthewebeditorapplication.
FormsarepublishedanddataisprocessedwiththeJavaSDK.
TheSDKalsoproducesthePDFoutput.
iTextguaranteessoftwarecompatibilitywithboththeOracleJREandOpenJRE.
Youneedversion8withupdate152.
iTextDITOmightnotworkproperlyonolderversions.
WebeditorinstallationYoucandownloadtheJARfilefromtheiTextArtifactory.
Inordertorunthewebeditorapplication,you'llneedaconfigurationfilesuchasthisone:13server:applicationConnectors:-type:httpport:8080adminConnectors:-type:httpport:8081logging:level:INFOworkDirectory:path:D:/DITOWorkAsyoucansee,theeditorusestwoports.
Thefirstone(8080intheaboveexample),isusedtoaccessthewebeditoritself.
Usersoftheapplicationwillconnectthroughthisport.
Thesecondport(8081)isusedforaccesstoadministrativefeatures.
Youcanofcourseconfiguretheportsmanually,aslongastheeditorandtheadministratorconnectoruseadifferentone.
Youshouldmakesuretheadminportisn'taccessiblefromoutsidethelocaltrustednetwork.
TheworkDirectoryparameterspecifiesthedirectorythatwillbeusedfortemporarystorage.
Thisparameterisrequiredforthewebeditorapplicationtoworkcorrectly,makesurethepathisvalid.
iTextDITOusestheDropwizardwebserverintheback-end.
Ifyouneeddocumentationdetailinghowtosetupthehttpsconnectionandhowtoaddhttpscertificates,youcanrefertotheDropwizardconfigurationmanual,availableonline.
Inordertoruntheeditorapplication,youneedthefollowingcommand:java-jardito-server.
jar{server,check}config.
ymlTheservercommandstartsthewebapplication.
Assoonasit'sstarted,itshouldbeavailablethroughthespecifiedport.
Thecheckcommandmakessuretheconfigurationfileoffersvalidconfigurationdata.
Ifsomethingisnotworkingproperly,you'llseetheerrorsprinted.
Asanadministrator,youcanaccessthehealthcheckfeature.
Healthcheckshelpyouidentifythecauseofproblemswiththeapplication.
Thefeatureisavailablethroughtheadministratorport:http://localhost:8081/healthcheckTheresultofahealthcheckisreturnedinJSONformat.
{"deadlocks":{"healthy":true},"workDirectory":{"healthy":true}}Assumingeverythingworkswell,you'llsee{"healthy":true}forallchecks.
Ifthereisaproblem,theJSONdatawillcontainamessagedescribingtheproblem.
Forexample:"workDirectory":{"healthy":false,"message":"Workdirectorydoesnotexist"}JavaSDKTheJavaSDKistheheartandbrainsoftheiTextDITOframework.
TheSDKdeploystheinputform,producesoutputPDFsfromoutputtemplates,processescalculationsandformatting,andprocessesinputandoutputfromandtoexternaldatabases.
14InstallingwithMavenTheJavaSDKisavailableasaMavenmodule.
Inordertoinstallit,youneedthenecessarydependencyfromtheiTextArtifactory.
First,youneedtoaddtherepositorytotheMavenPOMfileasfollows:ditoDITORepositoryhttps://repo.
itextsupport.
com/ditoSubsequentdeploymentiseasy.
JustaddthedependencytoyourPOMfilelikethis:com.
itextpdf.
ditosdk-java${dito.
sdk.
version}Thedito.
sdk.
versionstatementisavariablespecifyingyourcurrentversionoftheframework.
Thevaluecanforexamplebe1.
0.
0.
InstallingwithGradleToreferencetheJavaSDKfromGradle,youneedthenecessarydependencyfromtheiTextArtifactory.
First,youneedtoaddtherepositorytotheGradlebuildfileasfollows:repositories{mavenCentral()maven{url"https://repo.
itextsupport.
com/dito"}maven{url"https://repo.
itextsupport.
com/releases"}}Referencingthedependencyisnoweasy.
Justaddthecorrespondingentrytothedependenciessection:dependencies{compilegroup:'com.
itextpdf.
dito',name:'sdk-java',version:ditoSdkVersion}TheditoSdkVersionstatementisavariablespecifyingyourcurrentversionoftheframework.
Thevaluecanforexamplebe1.
0.
0.
WorkflowintegrationEveryiTextDITOworkflowstartswiththecreationofaformtemplate,exportedtoaniTextDITOtemplatepackage.
Thisfilewillbeatthecenteroftherestoftheworkflow.
You'llprobablywanttodeployinputforms,acceptdatasubmissionsforthoseforms,andfinallycreateoutputPDFsusingtheinputdata,followingtheoutputtemplate.
LoadingthelicensekeyBeforeyoucanusetheJavaSDK,youneedtoinstallthelicensekey.
Thisiseasilymanagedbyusingthefollowingcommands:FilelicenseKeyFile=".
.
.
";DitoLicense.
loadLicenseFile(licenseKeyFile);15ForvolumelicensecustomersWeadvisequeryingyourremainingvolumefrequentlyandsendingawarningmessagetoyourownapplication/systembeforethelimitisreachedandstopsworking.
ForcustomersusingthenativeiTextDITOJavaSDKyoucancallgetRemainingProducePagesEventsusingtheAPIandthisfunctionwillreturnthenumberofpagesremainingonyourvolumelicensekey.
Ifyouhaveaperpetuallicense,thiscallwillreturnnull.
ForiTextDITOSDKforDockerusersitisevensimpler.
Simplycall/api/licensetodisplaytheexpirationDateofyourlicensekeyaswellastheremainingvolume.
InputformdeploymentAssoonasauserhascreatedatemplatepackageusingtheeditor,thepackagecanbedeployedinyourwebserverenvironment.
TheJavaSDKwillprocessthepackageintoaninputform.
YouneedtheInputTemplateDeployerclassfromthecom.
itextpdf.
dito.
sdk.
inputpackage.
Fourparametersarerelevant.
Youneedtospecifythepathtothetemplatepackageyouwanttouse,thenameoftheinputtemplateinsidethepackage,analiasfortheinputformandanoutputfolder.
Thedeployedformwillbestoredinthislocation.
FileprojectFile=newFile("templatePackage.
dito");StringtemplateName="input";FiledeployFolder=newFile("deployed");InputTemplateDeployer.
deployTemplateFromPackage(projectFile,templateName,deployFolder);Insidethefolderspecifiedfordeployment,youcanfindaninputfile.
Thisfilecontainstheactualformyou'vecreated.
Thefilenamewillbeidenticaltothetemplatename,asspecifiedintheTemplateNameargument.
Astheformisnowcreated,you'refreetorenameitintoanythingyoulike.
Thefolderwillalsocontainasubfoldernamedjs.
Inside,theJavaSDKhasputthefilesnecessarytosupportinteractivefeaturesoftheform.
Ifapplicableforthetemplateyou'veused,you'llalsofindaresourcesfolderhere.
Youcanhostallfilesdirectlyfromthedeploymentfolder.
iTextDITOallowsforflexiblepublicationoftheform.
Youcan,forinstance,createadedicatedwebpageanddirectusersthere,oryoucanembeditinsideanexistingwebpageusingan.
AcceptingdatafromformsWhendesigningthetemplate,youcanspecifyaURI.
Datacollectedbytheform,willbesentthereusingPOSTorPUT,asspecifiedduringthedesignofthetemplate.
Thetypeofthedatapayloadisapplication/x-dito-data-submission,butyoucaneasilyconvertthedatatoatypethat'seasiertoworkwith.
Fornow,onlyJSONissupported.
DatasubmissionsarehandledbytheDataSubmissionclassfromthecom.
itextpdf.
dito.
sdk.
submissionpackage.
TheexamplebelowillustrateshowtogetsubmissiondatainJSONformatfromtheInputStream,whichrepresentsthepayload:Stringjson=DataSubmission.
fromInputStream(is).
asJsonString();16PDFcreationOneoftheprimaryfunctionsofiTextDITOistheautomaticcreationofstylishandusefulPDFsbasedondatagatheredbytheinputform.
Ifthetemplatepackagecontainsanoutputtemplate,allyouneedisthePdfProducerclassfromthecom.
itextpdf.
dito.
sdk.
outputpackage.
CreatingaPDFusinganoutputtemplateandJSONdatamightlooklikethis:FiletemplatePackageFile=newFile(templatePackagePath);StringtemplateName="output";FileOutputStreamfos=newFileOutputStream(newFile(outFilePath))StringjsonPdfProducer.
convertTemplateFromPackage(templatePackageFile,templateName,fos,newJsonData(json));YoucanalsocombineacceptingdatasubmissionsandcreatingPDFs.
Thatway,aPDFwillbecreatedforeachfilledoutform.
Theexamplebelowshowshowyoucanautomatetheworkflow:Stringjson=DataSubmission.
fromInputStream(is).
asJsonString();FiletemplatePackageFile=newFile(templatePackagePath);StringtemplateName="output";FileOutputStreamfos=newFileOutputStream(newFile(outFilePath))StringjsonPdfProducer.
convertTemplateFromPackage(templatePackageFile,templateName,fos,newJsonData(json));UsingiTextDITOWehavenowcoveredtheiTextDITOframeworkquiteextensively.
We'vealsodiscussedtheneedforadata-drivensolutionlikeiTextDITO,thepossibilitiesoftheframework,andwe'vetouchedonthemostimportanttechnicalaspects.
Below,you'lldiscoverasimpleexampleofaworkflowusingiTextDITO,usingasanexamplethecreationofaninvoicetemplate.
AusecaseexampleAninvoicetemplateisastraightforwardexampleofaniTextDITOusecase.
Youcaneasilyimagineasalesrepresentativeinthefieldusingatablettoinputordersforacustomer.
Thesalesrepwouldneedaneasytoolattheirfingertips,whilethecustomerrequiresaprofessionallookingandeasilyunderstandableinvoiceforpayment.
Inthisscenario,theheadofsalescanuseiTextDITOtodevelopaformforusebythesalesrep.
Thedynamicformallowsthemtoaddproductstoanorder,specifyhowmanyproductsareordered,andexpandtheorderwithmultipleproductsasnecessary.
Bycompletingtheinputform,thesalesrepcanthenplacetheorder.
Ofcourse,itwouldn'tdotosendthecustomerascreenshotoftheform.
Eventhoughitlookscleanandeasytouse,it'snowheregoodenoughtoserveasaninvoice.
Furthermore,arealinvoiceneedstohavespecificinformationincluded,suchasanaccountnumberoraddresses.
Lastly,thecustomerexpectstheirinvoicetoarriveviaemailinPDFformat,asPDFoffersawidelycompatibleyetunchangeabledigitalfilethatcarrieswithitasenseofauthority.
WithiTextDITO,theordermadebythesalesrepresentativeisautomaticallyconvertedtoaPDFfilethat'sreadytobeemailedtothecustomer.
What'smore,iTextDITOhandlesthedatagatheredthroughtheinputforminsuchawaythatitcanbesharedwithotherpartsofthecompany'sITinfrastructure.
Imaginetheordergoingstraighttotheorderpickersinthewarehouse,forfastdelivery.
WheniTextDITOhasbeenimplementedcorrectly,theheadofsaleswouldnotneedthehelpofadevelopertocreateboththeformandthePDFoutput.
Theycouldeasilybuildatemplateforboth,followingthecompanystyleandformatting.
17ComprehensivewalkthroughNow,let'shavealookathowtheaboveusecasewouldtranslateintoapracticalworkflow.
Thetemplatewearecreatingmightbeusedbyasalesperson.
Theycanfillouttheformwithordersfortheircustomer.
Aftersubmittingtheorder,iTextDITOwillautomaticallycreateaprofessionallookinginvoiceinPDF.
We'llusesampledatatotryoutourform:{"invoice_no":"12345","company_name":"ABC,Inc.
","address":"12Weststreet,NY,USA","items":[{"name":"Bluepen","price":"20.
1","quantity":10},{"name":"Blackpencil","price":"0.
1","quantity":1},{"name":"Redpen","price":"20","quantity":78},{"name":"Bluepencil","price":"0.
15","quantity":13}]}Thecreationofthetemplatestartsinthewebeditor.
Westartournewprojectbyuploadingthecompanylogo.
Ontheleftoftheeditor,youcanfindtheresourcespanel.
Here,youcaneitheraddanimagefromtheweboruploadyourown.
Assoonastheimageisadded,youcandragittotheeditingarea.
Theeditorwillautomaticallycreateanewelementcontainingtheimage.
Next,wealigntheimagetotherightofourform.
Inordertodoso,wemustfirstwrapitintoasubform.
Clickthesubformiconinthetoolboxanddragtheimageintothesubform.
Nowwecanapplytherighttextalignmentfromtheparagraphstyleproperties.
Theresultlooksasfollows:18Theinvoicewearecreatingwillhaveauniquenumber,shownatthetopoftheform.
Inordertoaddthisheader,weneedanewstatictextelement.
Youcaneasilyadditandusethestylecontrolstoeditthevisualappearanceofthetext.
Ourformmusttaketheinvoicenumberfromtheinputdata.
Inordertodoso,weinsertadatabindingintrusionwiththevalueinvoice_no.
Clicktheunderlinedbuttonontherightofthetoolbartoaddthebinding.
Youcanaddstatictextelementscontainingthecompanynameandaddressinasimilarway.
Wealignthecontactinformationtotheright,soitsitsneatlyunderneaththelogo.
Sincewealreadyhavesomedatabindinggoingon,it'sagoodideatodoapreview.
Atthetopoftheeditorwindow,youcanfindthepreviewbutton.
iTextDITOneedssampledataforthepreviewSowecanusethedataprovidedatthebeginningofthissegment.
TheJSONdatacontains"invoice_no":"12345"asthefirstentry.
Thevalue12345correspondswiththeinvoice_novariable,whichweusedasadatabindinourform.
Thepreviewshowstheexpectedresult:Ineditingmode,it'stimetoaddthebulkofourinputform.
Weneedatablecontainingthenameoftheitembeingbought,theunitprice,thequantityoftheorder,andthetotalforthatitem.
Underneath,weaddafieldwiththegrandtotalfortheentireorder.
Thetableaboverequiressomeconfiguration.
Weneedtodefinetherelationshipbetweentheindividualfieldsandtheinputdata,butalsobetweenthefieldsthemselves.
Wenotonlyneedtoapplydatabindingtothefields,butwemustalsonamethem.
Thatway,wecaninvokethevalueofthefieldsasvariablesforfurthercalculations.
Theitemname,itempriceanditemquantityfieldsallneedadatabindandaname.
Youcanusename,priceandquantityforboth.
Theexamplebelowshowshowthepropertiesoftheitemnamefieldneedtobefilled.
Theitemtotalfieldwillbefilledusingdataprovidedbytheitempriceanditemquantityfields.
Therefore,itdoesnotneedadatabind.
Thefielddoesneedanamethough,aswearegoingtoperformcalculationsonintheGrandtotalfield.
Wecallititem_total.
UnderCalculation,weselectproduct.
Inordertocalculatethetotalamountowed,thefieldmustcontaintheproductofpriceandquantity.
19BeforewecanmoveontotheGrandtotalfield,weneedtotellourformthateachitemfromtheinputdataneedstohaveitsownrowinthetable.
Inotherwords:thetableneedstoextenditselfwithadditionalrowsasmanytimesasthereareitemdataentriesintheJSONdata.
Thismakestheformflexible;itwillbeabletohandleorderscontainingonlyoneitemaswellasorderscontainingmultipleitems.
Selectthesecondtablerow(theonecontainingthefields)fromtheelementstreeontheleft,andspecifythemultiplieditems[*]binding.
Anotherpreviewwillillustratetheresultofthisbinding.
AstherearefourentriesunderItems,theformwillautomaticallyaddfourrowsinthetable.
TheItemtotalwillalsobefilledasaproductofquantityandpriceforeachitem.
Thisworksperfectly,assumingallinputcomesfrompreviouslygathereddata.
Ofcourse,oursalesrepresentativeshouldbeabletousetheformmanuallytoputinaclient'sorder.
Ifwewantthemtobeabletoaddmultipleitemstooneinvoice,weneedtoaddinteractivecontrols.
Thesecontrolswillappearnexttoarowinthetable.
Byclicking'+',therepresentativewillbeabletoaddanewrowmanually.
Withthe'-'button,theycanremovearow.
SelectthesecondrowofthetableagainandlookfortheAddinteractiverepeatablecontrolsoption.
Clickthecheckboxtoenablethefeature.
Lastly,weneedasubmissionbutton.
Byclickingthisbutton,datawillbesenttothedestinationofourchoice.
Addthebutton,andtrypreviewingtheformwithoutanyinputdata,soyoucanseethevanillaformthatwillbepresentedtothesalesrep.
20Theformstilllooksrathercrude,butalltherequiredfunctionalityisthere.
Nowyoucantryandpolishtheform,oryoucanapplycustomCSSstylestoreallywrapitinthecompanystyle.
Nowyoucancopytheinputtemplatetotheoutputtemplate.
Youmustgetridofthebuttonstomanuallyaddorremoverows,andthesubmitbuttonisalsouselesshere.
TheoutputformwillbeconvertedtoPDFandserveasanofficialinvoice,soitshouldlookaccordingly.
Youcanpreviewtheoutputwiththesampledatatoseehoweverythingwilllook.
Whenyou'resatisfied,youcanexportthetemplatetoaniTextDITOtemplatepackagereadyforusebytheJavaSDK.
Conclusion:TakingactionwithiTextDITOiTextDITOisapowerfultoolthatempowersbusinessuserswhiledecreasingthetimedevelopersmustspendperformingnonessentialtasks.
Inbusinessestoday,userswanttousetechnologytoachieveagoal.
Theyknowwhattheyneedbutmaylackthetechnicalknowledgeandbackgroundtotranslatetheirvisionintoreality.
Developershavethisknowledgebutaren'talwaysfamiliarwiththespecificneedsoftheenduser.
Bothofthemtryingtoworkoutasolutiontoaproblemisn'tveryefficient.
ThemaingoalofiTextDITOistoprovideuserswiththetoolstoturntheirowndata-drivenformsvisionintoreality,withoutneedingtoinvolveadeveloper.
Valuabletimegetssaved,whilethepaceofinnovationisincreased.
TherestillisanimportantroleforthedeveloperintheearlystagesoftheimplementationofiTextDITO.
TheymustdotheactuallegworkofintegratingtheframeworkintheexistingITinfrastructureandconfiguringittobeused.
Butafterthisinitialconfiguration,thetoolisreadytogo.
iTextDITOistheonlyframeworkavailabletodaythatempowersenduserstocreateadvancedandfunctionalformscombinedwithPDFoutput.
WithiTextDITOinstalled,userscancreateavarietyofformsinthelookandfeeloftheirchoice.
Theinputoftheformsiseasilystructured,canbeoutputtoadatabase,andofcourseconvertedtoPDFtobeeitherusedorarchived.
SoundinterestingContactustolearnmoreat:https://itextpdf.
com/en/products/itext-dito.
AboutiTextiTextistheworld'sforemostplatformtocreatePDFfilesandintegratethemincorporateapplications.
Originallyreleasedin2000,iTextisavailableasanopensourceproductwithcommunitysupport,aswellasacommercialproduct,worldwidesupportedbytheiTextGroupNV(withofficesinEurope,NorthAmericaandAsia).
In2016,thepopulariText5versionwassucceededbythefullyre-writtenandre-architecturediText7platform,withadvancedadd-onoptions.
iTextrepresentsauniquecapabilityoffacilitatingtheuseofdynamicandcomplexPDFdocumentsincorporatedocumentworkflows,throughoutthewholedocumentlifecycle.

白丝云-美国圣何塞4837/德国4837大带宽/美西9929,26元/月起

官方网站:点击访问白丝云官网活动方案:一、KVM虚拟化套餐A1核心 512MB内存 10G SSD硬盘 800G流量 2560Mbps带宽159.99一年 26一月套餐B1核心 512MB内存 10G SSD硬盘 2000G流量 2560Mbps带宽299.99一年 52一月套餐...

VPS云服务器GT线路,KVM虚vps消息CloudCone美国洛杉矶便宜年付VPS云服务器补货14美元/年

近日CloudCone发布了最新的补货消息,针对此前新年闪购年付便宜VPS云服务器计划方案进行了少量补货,KVM虚拟架构,美国洛杉矶CN2 GT线路,1Gbps带宽,最低3TB流量,仅需14美元/年,有需要国外便宜美国洛杉矶VPS云服务器的朋友可以尝试一下。CloudCone怎么样?CloudCone服务器好不好?CloudCone值不值得购买?CloudCone是一家成立于2017年的美国服务器...

哪里购买香港云服务器便宜?易探云2核2G低至18元/月起;BGP线路年付低至6.8折

哪里购买香港云服务器便宜?众所周知,国内购买云服务器大多数用户会选择阿里云或腾讯云,但是阿里云香港云服务器不仅平时没有优惠,就连双十一、618、开年采购节这些活动也很少给出优惠。那么,腾讯云虽然海外云有优惠活动,但仅限新用户,购买过腾讯云服务器的用户就不会有优惠了。那么,我们如果想买香港云服务器,怎么样购买香港云服务器便宜和优惠呢?下面,云服务器网(yuntue.com)小编就介绍一下!我们都知道...

999ddd.com为你推荐
摩拜超15分钟加钱摩拜单车不是按骑行时间收费吗,我怎么只要开锁就要支付一元(而且只骑十几分钟)怎么查询商标手机上能查询商标吗?怎么查?Baby被问婚变绯闻黄晓明baby一起出来带娃,想要打破离婚传闻?access数据库什么是ACCESS数据库广告法有那些广告法?还有广告那些广告词?dadi.tvapple TV 功能介绍www.493333.comwww.xiaonei.com本冈一郎本冈一郎是什么东西??谁知道??www.28.cnXX小说网站谁有啊?弗雷德疯哈利波特大结局谁谁谁还是活的,谁死了???全部都要,只要出现的求大神帮助
长沙域名注册 kvmla dreamhost debian6 大容量存储 双十一秒杀 php空间购买 百度云1t 息壤代理 vip域名 香港新世界中心 1元域名 ebay注册 cdn网站加速 hostease 腾讯云平台 accountsuspended 远程登录 服务器是什么 easypanel 更多