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.

spinservers春节优惠:$149/月10Gbps圣何塞服务器-2*E5-2630Lv3 CPU,256G内存,2*1.6T SSD硬盘

spinservers是Majestic Hosting Solutions LLC旗下站点,商家提供国外服务器租用和Hybrid Dedicated等产品,数据中心包括美国达拉斯和圣何塞机房,机器默认10Gbps端口带宽,高配置硬件,支持使用PayPal、信用卡、支付宝或者微信等付款方式。农历春节之际,商家推出了几款特别促销配置,最低双路E5-2630Lv3机器每月149美元起,下面列出几款机器...

Hosteons - 限时洛杉矶/达拉斯/纽约 免费升级至10G带宽 低至年$21

Hosteons,一家海外主机商成立于2018年,在之前还没有介绍和接触这个主机商,今天是有在LEB上看到有官方发送的活动主要是针对LEB的用户提供的洛杉矶、达拉斯和纽约三个机房的方案,最低年付21美元,其特点主要在于可以从1G带宽升级至10G,而且是免费的,是不是很吸引人?本来这次活动是仅仅在LEB留言提交账单ID才可以,这个感觉有点麻烦。不过看到老龚同学有拿到识别优惠码,于是就一并来分享给有需...

IMIDC(rainbow cloud):香港/台湾/日本/莫斯科独立服务器特价,闪购大促销,最低30usd/月起

imidc怎么样?imidc彩虹网路,rainbow cloud知名服务器提供商。自营多地区数据中心,是 Apnic RIPE Afrinic Arin 认证服务商。拥有丰富的网路资源。 在2021年 6.18 开启了输血大促销,促销区域包括 香港 台湾 日本 莫斯科 等地促销机型为 E3係,参与促销地区有 香港 日本 台湾 莫斯科 等地, 限量50台,售罄为止,先到先得。所有服务器配置 CPU ...

999ddd.com为你推荐
淘宝门户淘宝网怎么样从个人中心进入首页安徽汽车网安徽省各地车牌号简称是按照什么顺序排的老虎数码86年属虎的吉祥数字和求财方向www.yahoo.com.hk香港的常用网站www.33xj.compro/engineer 在哪里下载,为什么找不到下载网站?www.5ff.comhttp://www.940777.com/网站,是不是真的网投六合www.vtigu.com破译密码L dp d vwxghqw.你能看出这些字母代表什么意思吗?如果给你一把破以它的钥匙X-3,联想se95se.comwww.sea8.com这个网站是用什么做的 需要多少钱m.kan84.net经常使用http://www.feikan.cc看电影的进来帮我下啊sesehu.comwww.hu338.com 怎么看不到啊
绍兴服务器租用 河南vps 香港vps主机 播放vps上的视频 地址大全 全能主机 qq数据库 台湾谷歌地址 共享主机 架设邮件服务器 重庆联通服务器托管 美国主机 建站技术 神棍节 文件传输 报警主机 国内免备案空间 万网空间价格 防盗报警主机 灵动:鬼影实录 更多