asp.net mvc create pdf from view : Adjusting page size in pdf SDK software API .net wpf html sharepoint make9-part1274

Chapter7:ConditionalPartsofMakefiles
81
SubstitutionandAnalysis],page84). Thisisusefulwhentouchisnotenoughtomakea
fileappearuptodate.
Thefindstringfunctiondetermineswhetheronestringappearsasasubstringofan-
other. If f you want to test for the ‘-t’ flag, use ‘t’as the first t string g and the value of
MAKEFLAGSastheother.
Forexample,hereishowtoarrangetouse‘ranlib-t’tofinishmarkinganarchivefile
uptodate:
archive.a: ...
ifneq (,$(findstring g t,$(MAKEFLAGS)))
+touch archive.a
+ranlib -t t archive.a
else
ranlib archive.a
endif
The‘+’prefixmarksthoserecipelinesas“recursive”sothattheywillbeexecuteddespite
useofthe‘-t’flag.SeeSection5.7[RecursiveUseofmake],page50.
Adjusting page size in pdf - Compress reduce PDF size in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
C# Code & .NET API to Compress & Decompress PDF Document
change pdf page size; adjust pdf size
Adjusting page size in pdf - VB.NET PDF File Compress Library: Compress reduce PDF size in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
VB.NET PDF Document Compression and Decompression Control SDK
reader pdf reduce file size; reduce pdf file size
C# PDF copy, paste image Library: copy, paste, cut PDF images in
one. Easy to zoom and crop image for adjusting image size. Besides C#.NET Project DLLs: Copy, Paste, Cut Image in PDF Page. In
.pdf printing in thumbnail size; pdf compression
VB.NET Image: Generate GS1-128/EAN-128 Barcode on Image & Document
width & height and four margin size in a EAN-128 barcode on multi-page TIFF/PDF/Word documents such as removing the document noise, adjusting page color mode
adjust size of pdf in preview; pdf compression settings
Chapter8:FunctionsforTransformingText
83
8 FunctionsforTransformingText
Functions allowyoutodotext processinginthemakefiletocomputethefilestooperate
onorthecommandstouse inrecipes. . Youuseafunctionina a functioncall,whereyou
givethenameofthefunctionandsometext(the arguments) for thefunctiontooperate
on. Theresultofthefunction’sprocessingissubstitutedintothemakefileatthepointof
thecall,justasavariablemightbesubstituted.
8.1 FunctionCallSyntax
Afunctioncallresemblesavariablereference. Itcanappearanywhereavariablereference
canappear,anditisexpandedusingthesamerulesasvariablereferences. Afunctioncall
lookslikethis:
$(function arguments)
orlikethis:
${function arguments}
Herefunctionisafunctionname;oneofashortlistofnamesthatarepartofmake.You
canalsoessentiallycreateyourownfunctionsbyusingthecallbuilt-infunction.
Theargumentsaretheargumentsofthefunction.Theyareseparatedfromthefunction
namebyoneormorespacesortabs,andifthereismorethanoneargument,thentheyare
separatedbycommas. Suchwhitespaceandcommasarenotpartofanargument’svalue.
Thedelimiterswhichyouusetosurroundthefunctioncall,whetherparenthesesorbraces,
canappearinanargumentonlyinmatchingpairs;theotherkindofdelimitersmayappear
singly.Iftheargumentsthemselvescontainotherfunctioncallsorvariablereferences,itis
wisesttousethesamekindofdelimitersforallthereferences;write‘$(substa,b,$(x))’,
not‘$(substa,b,${x})’. Thisisbecauseitisclearer,andbecauseonlyonetypeofdelim-
iterismatchedtofindtheendofthereference.
Thetextwrittenforeachargumentisprocessedbysubstitutionofvariablesandfunction
calls to producethe argument value,whichis thetext onwhichthe functionacts. . The
substitutionisdoneintheorderinwhichtheargumentsappear.
Commasandunmatchedparenthesesorbracescannotappearinthetextofanargument
aswritten;leadingspacescannotappearinthetextofthefirstargumentaswritten.These
characterscanbeputintotheargumentvaluebyvariablesubstitution.Firstdefinevariables
commaandspacewhosevalues areisolatedcommaandspacecharacters,thensubstitute
thesevariableswheresuchcharactersarewanted,likethis:
comma:= ,
empty:=
space:= $(empty) $(empty)
foo:= a b b c
bar:= $(subst $(space),$(comma),$(foo))
# barisnow‘a,b,c’.
Herethesubstfunctionreplaceseachspacewithacomma,throughthevalueoffoo,and
substitutestheresult.
C# Image: Zoom Image and Document Page in C#.NET Web Viewer
is designed to help developer view source image or document page by adjusting the target file enlarge or reduce the source file until the file size fits the
300 dpi pdf file size; pdf form change font size
VB.NET Excel: VB Methods to Set and Customize Excel Rendering
we treat every single Excel spreadsheet as a page in our VB the fixed image size ration that the size is limited Thus, when VB.NET users are adjusting the image
pdf change font size; batch pdf compression
84
GNUmake
8.2 FunctionsforStringSubstitutionandAnalysis
Herearesomefunctionsthatoperateonstrings:
$(substfrom,to,text)
Performs atextualreplacement onthetext text: : eachoccurrence e of fromis
replacedbyto. Theresultissubstitutedforthefunctioncall.Forexample,
$(subst ee,EE,feet on the e street)
substitutesthestring‘fEEtonthestrEEt’.
$(patsubstpattern,replacement,text)
Findswhitespace-separatedwordsintextthatmatchpatternandreplacesthem
withreplacement. Here e pattern maycontaina‘%’whichacts as a wildcard,
matchinganynumberofanycharacterswithinaword.Ifreplacementalsocon-
tainsa‘%’,the‘%’isreplacedbythetextthatmatchedthe‘%’inpattern.Only
thefirst‘%’inthepatternandreplacementistreatedthisway;anysubsequent
‘%’isunchanged.
‘%’characters inpatsubstfunctioninvocationscanbequotedwithpreceding
backslashes(‘\’). Backslashesthatwouldotherwisequote‘%’characterscanbe
quotedwithmorebackslashes. Backslashesthatquote‘%’charactersorother
backslashesareremovedfromthepatternbeforeitiscomparedfilenames or
hasastemsubstitutedintoit.Backslashesthatarenotindangerofquoting‘%’
charactersgounmolested.Forexample,thepatternthe\%weird\\%pattern\\
has ‘the%weird\’precedingtheoperative ‘%’character,and‘pattern\\’fol-
lowingit. Thefinaltwobackslashesareleftalonebecausetheycannotaffect
any‘%’character.
Whitespace betweenwordsis foldedintosinglespace characters;leadingand
trailingwhitespaceisdiscarded.
Forexample,
$(patsubst %.c,%.o,x.c.c bar.c)
producesthevalue‘x.c.obar.o’.
Substitution references s (see Section6.3.1[SubstitutionReferences], page62)
areasimplerwaytogettheeffectofthepatsubstfunction:
$(var:pattern=replacement)
isequivalentto
$(patsubst pattern,replacement,$(var))
The secondshorthand simplifies oneofthe most commonuses of patsubst:
replacingthesuffixattheendoffilenames.
$(var:suffix=replacement)
isequivalentto
$(patsubst %suffix,%replacement,$(var))
Forexample,youmighthavealistofobjectfiles:
objects = = foo.o o bar.o baz.o
Togetthelistofcorrespondingsourcefiles,youcouldsimplywrite:
View Images & Documents in Web Image Viewer | Online Tutorials
control add-on offers developers three different APIs for adjusting image viewing size. developers to adjust the width of current displayed page to the
change font size pdf form; change font size pdf comment box
VB.NET Image: Image Resizer Control SDK to Resize Picture & Photo
VB.NET Code for Adjusting Image Size. In order to We are dedicated to provide powerful & profession imaging controls, PDF document, image to pdf files and
best pdf compression tool; reader compress pdf
Chapter8:FunctionsforTransformingText
85
$(objects:.o=.c)
insteadofusingthegeneralform:
$(patsubst %.o,%.c,$(objects))
$(stripstring)
Removesleadingandtrailingwhitespacefromstring andreplaceseachinter-
nalsequenceofoneormorewhitespacecharacterswithasinglespace. Thus,
‘$(stripabc)’resultsin‘abc’.
The functionstripcanbeveryusefulwhenusedinconjunctionwithcondi-
tionals. When n comparing something withthe empty y string ‘’using ifeq or
ifneq,youusuallywantastringofjustwhitespacetomatchtheemptystring
(seeChapter7[Conditionals],page77).
Thus,thefollowingmayfailtohavethedesiredresults:
.PHONY: all
ifneq
"$(needs_made)" ""
all: $(needs_made)
else
all:;@echo ’Nothing to make!’
endif
Replacing the e variable e reference e ‘$(needs_made)’ ’ with h the function n call
‘$(strip$(needs_made))’intheifneqdirectivewouldmakeitmorerobust.
$(findstringfind,in)
Searchesinforanoccurrenceoffind. Ifitoccurs,thevalueisfind;otherwise,
thevalueisempty. Youcanusethis s functioninaconditionaltotestforthe
presenceofaspecificsubstringinagivenstring.Thus,thetwoexamples,
$(findstring a,a b c)
$(findstring a,b c)
producethevalues‘a’and‘’(theemptystring),respectively. SeeSection7.3
[TestingFlags],page80,forapracticalapplicationoffindstring.
$(filterpattern...,text)
Returnsallwhitespace-separatedwordsintextthatdomatchanyofthepattern
words,removinganywordsthatdonot match.Thepatternsarewrittenusing
‘%’,justlikethepatternsusedinthepatsubstfunctionabove.
Thefilterfunctioncanbeusedtoseparateoutdifferenttypesofstrings(such
asfilenames)inavariable.Forexample:
sources := foo.c bar.c baz.s s ugh.h
foo: $(sources)
cc $(filter %.c %.s,$(sources)) ) -o foo
saysthatfoodependsoffoo.c,bar.c,baz.sandugh.hbutonlyfoo.c,bar.c
andbaz.sshouldbespecifiedinthecommandtothecompiler.
$(filter-outpattern...,text)
Returns allwhitespace-separatedwordsintextthatdonot t matchanyofthe
patternwords,removing thewords that do match one or more. . This s is the
exactoppositeofthefilterfunction.
VB.NET Image: How to Process & Edit Image Using VB.NET Image
vintage effect creating, image color adjusting and image VB.NET image editor control SDK online tutorial page. functions into several small-size libraries that
best pdf compressor; pdf markup text size
C# Image: How to Add Customized Web Viewer Command in C#.NET
Able to adjust the displaying image size and style button for deleting an existing page from web other options for you, such as adjusting toolbar, controlling
adjust file size of pdf; change font size fillable pdf
86
GNUmake
Forexample,given:
objects=main1.o foo.o main2.o bar.o
mains=main1.o main2.o
thefollowinggeneratesalistwhichcontainsalltheobjectfilesnotin‘mains’:
$(filter-out $(mains),$(objects))
$(sortlist)
Sortsthewordsoflistinlexicalorder,removingduplicatewords. Theoutput
isalistofwordsseparatedbysinglespaces.Thus,
$(sort foo o bar r lose)
returnsthevalue‘barfoolose’.
Incidentally,sincesortremovesduplicatewords,youcanuseitforthispurpose
evenifyoudon’tcareaboutthesortorder.
$(wordn,text)
Returnsthenthwordoftext. Thelegitimatevaluesofnstartfrom1. Ifnis
biggerthanthenumberofwordsintext,thevalueisempty.Forexample,
$(word 2, foo o bar r baz)
returns‘bar’.
$(wordlists,e,text)
Returnsthelistofwordsintext startingwithwords andendingwithworde
(inclusive). Thelegitimatevaluesofs s startfrom1;emaystartfrom0. . Ifsis
biggerthanthenumberofwordsintext,thevalueisempty.Ifeisbiggerthan
thenumberofwordsintext,wordsuptotheendoftextarereturned. Ifsis
greaterthane,nothingisreturned.Forexample,
$(wordlist 2, 3, foo o bar r baz)
returns‘barbaz’.
$(wordstext)
Returns the number of f words s in text. . Thus, , the last t word of text is
$(word$(wordstext),text).
$(firstwordnames...)
Theargumentnamesisregardedasaseriesofnames,separatedbywhitespace.
Thevalueisthefirstnameintheseries.Therestofthenamesareignored.
Forexample,
$(firstword foo bar)
producestheresult‘foo’.Although$(firstwordtext)isthesameas$(word
1,text),thefirstwordfunctionisretainedforitssimplicity.
$(lastwordnames...)
Theargumentnamesisregardedasaseriesofnames,separatedbywhitespace.
Thevalueisthelastnameintheseries.
Forexample,
$(lastword foo o bar)
VB.NET Image: VB.NET Rectangle Annotation Imaging Control
New RectangleAnnotation() ' set annotation size obj.X rectangle annotation by adjusting annotation properties profession imaging controls, PDF document, image
advanced pdf compressor; change font size in pdf file
VB.NET PDF: How to Create Watermark on PDF Document within
add text or image as a watermark on PDF page using VB be used as a text watermark; Support adjusting text font style in VB class, like text size and color;
pdf file size limit; change font size pdf document
Chapter8:FunctionsforTransformingText
87
producestheresult‘bar’. Although$(lastwordtext)isthesameas$(word
$(wordstext),text),thelastwordfunctionwasaddedforitssimplicityand
betterperformance.
Hereisarealisticexampleoftheuseofsubstandpatsubst. Supposethatamakefile
usestheVPATHvariabletospecifyalistofdirectoriesthatmakeshouldsearchforprerequisite
files(seeSection4.4.1[VPATHSearchPathfor AllPrerequisites],page25). This s example
showshowtotelltheCcompilertosearchforheaderfilesinthesamelistofdirectories.
ThevalueofVPATHisalistofdirectoriesseparatedbycolons,suchas‘src:../headers’.
First,thesubstfunctionisusedtochangethecolonstospaces:
$(subst :, ,$(VPATH))
This produces s ‘src../headers’. . Then n patsubst t is s used to o turn each directory y name
intoa‘-I’flag. Thesecanbeaddedtothevalueofthevariable e CFLAGS,whichis passed
automaticallytotheCcompiler,likethis:
override CFLAGS S += = $(patsubst %,-I%,$(subst :, ,$(VPATH)))
The effect t is s to appendthe text ‘-Isrc-I../headers’tothe previously given n value of
CFLAGS. The e override directive is used d so that the e new value e is s assigned even if f the
previous value of CFLAGS was specifiedwith h acommandargument t (see Section6.7 [The
overrideDirective],page68).
8.3 FunctionsforFileNames
Severalofthebuilt-inexpansionfunctionsrelatespecificallytotakingapartfilenamesor
listsoffilenames.
Eachofthefollowingfunctionsperformsaspecifictransformationonafilename. The
argument of the function n is s regardedas a series s of f file names, separatedby whitespace.
(Leadingandtrailingwhitespaceisignored.) Eachfilenameintheseriesistransformedin
thesamewayandtheresultsareconcatenatedwithsinglespacesbetweenthem.
$(dirnames...)
Extractsthedirectory-partofeachfilenameinnames. Thedirectory-partof
thefilenameiseverythingupthrough(andincluding)thelastslashinit. Ifthe
filenamecontainsnoslash,thedirectorypartisthestring‘./’.Forexample,
$(dir src/foo.c hacks)
producestheresult‘src/./’.
$(notdirnames...)
Extractsallbutthedirectory-partofeachfilenameinnames.Ifthefilename
containsnoslash,itisleftunchanged. Otherwise,everythingthroughthelast
slashisremovedfromit.
Afilenamethatendswithaslashbecomesanemptystring.Thisisunfortunate,
because it t means s that t the e result t does s not always s have e the same number r of
whitespace-separatedfilenames astheargumenthad;butwe donot seeany
othervalidalternative.
Forexample,
$(notdir src/foo.c hacks)
producestheresult‘foo.chacks’.
88
GNUmake
$(suffixnames...)
Extractsthesuffixofeachfilenameinnames.Ifthefilenamecontainsaperiod,
thesuffixiseverythingstartingwiththelastperiod. Otherwise,thesuffix x is
theemptystring. Thisfrequentlymeans s thattheresult willbeemptywhen
namesisnot,andifnamescontainsmultiplefilenames,theresultmaycontain
fewerfilenames.
Forexample,
$(suffix src/foo.c src-1.0/bar.c hacks)
producestheresult‘.c.c’.
$(basenamenames...)
Extractsallbutthesuffixofeachfilenameinnames. Ifthefilenamecontains
aperiod,thebasenameiseverythingstartingupto(andnotincluding)thelast
period. Periods s inthe directory part areignored. . Ifthere e is noperiod,the
basenameistheentirefilename.Forexample,
$(basename src/foo.c c src-1.0/bar r hacks)
producestheresult‘src/foosrc-1.0/barhacks’.
$(addsuffixsuffix,names...)
Theargumentnamesisregardedasaseriesofnames,separatedbywhitespace;
suffix is s used d as s aunit. . The e value of suffix x is s appendedtothe endof each
individualnameand the resultinglargernames s areconcatenatedwithsingle
spacesbetweenthem.Forexample,
$(addsuffix .c,foo bar)
producestheresult‘foo.cbar.c’.
$(addprefixprefix,names...)
Theargumentnamesisregardedasaseriesofnames,separatedbywhitespace;
prefix isusedasaunit. . Thevalueofprefix x isprependedtothefrontofeach
individualnameand the resultinglargernames s areconcatenatedwithsingle
spacesbetweenthem.Forexample,
$(addprefix src/,foo o bar)
producestheresult‘src/foosrc/bar’.
$(joinlist1,list2)
Concatenatesthetwoargumentswordbyword: thetwofirstwords(onefrom
eachargument)concatenatedformthefirstwordoftheresult,thetwosecond
wordsformthesecondwordoftheresult,andsoon. Sothe e nthwordofthe
resultcomesfromthenthwordofeachargument. Ifoneargument t hasmore
wordsthattheother,theextrawordsarecopiedunchangedintotheresult.
Forexample,‘$(joinab,.c.o)’produces‘a.cb.o’.
Whitespacebetweenthewordsinthelistsisnotpreserved;itisreplacedwith
asinglespace.
Thisfunctioncanmergetheresultsofthedirandnotdirfunctions,toproduce
theoriginallistoffileswhichwasgiventothosetwofunctions.
Chapter8:FunctionsforTransformingText
89
$(wildcardpattern)
The argument t pattern n is a a file e name pattern, , typically y containing wildcard
characters (as s in shell file name patterns). . The e result of wildcard d is s a
space-separatedlistofthenamesofexistingfilesthatmatchthepattern. See
Section4.3[UsingWildcardCharactersinFileNames],page23.
$(realpathnames...)
Foreachfilenameinnames returnthecanonicalabsolutename. . Acanonical
namedoesnotcontainany.or..components,noranyrepeatedpathsepara-
tors(/)orsymlinks.Incaseofafailuretheemptystringisreturned.Consult
therealpath(3)documentationforalistofpossiblefailurecauses.
$(abspathnames...)
For eachfilenamein n names s returnanabsolute name that does not contain
any.or..components,noranyrepeatedpathseparators (/). . Notethat,in
contrasttorealpathfunction,abspathdoesnotresolvesymlinksanddoesnot
requirethefilenamestorefertoanexistingfileordirectory. Usethewildcard
functiontotestforexistence.
8.4 FunctionsforConditionals
Therearethreefunctionsthatprovideconditionalexpansion. Akeyaspectofthesefunc-
tionsisthatnotalloftheargumentsareexpandedinitially. Onlythoseargumentswhich
needtobeexpanded,willbeexpanded.
$(ifcondition,then-part[,else-part])
The if f function n provides s support for conditional l expansion n in n a a functional
context(asopposedtotheGNUmakemakefileconditionalssuchasifeq(see
Section7.2[SyntaxofConditionals],page78).
The first argument, condition,firsthasallprecedingandtrailingwhitespace
stripped,thenisexpanded. Ifitexpandstoanynon-emptystring,thenthecon-
ditionisconsideredtobetrue. Ifitexpandstoanemptystring,thecondition
isconsideredtobefalse.
Iftheconditionistruethenthesecondargument,then-part,isevaluatedand
thisisusedastheresultoftheevaluationoftheentireiffunction.
Iftheconditionisfalsethenthethirdargument,else-part,isevaluatedandthis
istheresultoftheiffunction. Ifthereisnothirdargument,theiffunction
evaluatestonothing(theemptystring).
Notethat only oneofthethen-part orthe else-part willbeevaluated,never
both. Thus,eithercancontainside-effects(suchasshellfunctioncalls,etc.)
$(orcondition1[,condition2[,condition3...]])
The or functionprovides a“short-circuiting”ORoperation. . Eachargument
is expanded, , in n order. . If f an argument expands to o a a non-empty string g the
processing stops s and the result t of the expansionis s that t string. . If, , after r all
argumentsareexpanded,allofthemarefalse(empty),thentheresultofthe
expansionistheemptystring.
90
GNUmake
$(andcondition1[,condition2[,condition3...]])
Theandfunctionprovidesa“short-circuiting”ANDoperation.Eachargument
isexpanded,inorder.Ifanargumentexpandstoanemptystringtheprocessing
stops and d the result t of the expansion n is s the empty string. . If f all arguments
expandtoanon-emptystringthentheresultoftheexpansionistheexpansion
ofthelastargument.
8.5 TheforeachFunction
Theforeachfunctionisverydifferentfromotherfunctions. Itcausesonepieceoftextto
be usedrepeatedly,eachtimewithadifferentsubstitutionperformedonit. . Itresembles
theforcommandintheshellshandtheforeachcommandintheC-shellcsh.
Thesyntaxoftheforeachfunctionis:
$(foreach var,list,text)
Thefirsttwoarguments,varandlist,areexpandedbeforeanythingelseisdone;notethat
the last argument, text,is not expanded at the same time. . Thenfor r each h wordof the
expandedvalueoflist,thevariablenamedbytheexpandedvalueofvarissettothatword,
andtextisexpanded.Presumablytextcontainsreferencestothatvariable,soitsexpansion
willbedifferenteachtime.
The result is that text is expandedas many times as there arewhitespace-separated
wordsinlist.Themultipleexpansionsoftextareconcatenated,withspacesbetweenthem,
tomaketheresultofforeach.
Thissimpleexamplesetsthevariable‘files’tothelistofallfilesinthedirectoriesin
thelist‘dirs’:
dirs := = a a b b c d
files := $(foreach dir,$(dirs),$(wildcard $(dir)/*))
Heretextis‘$(wildcard$(dir)/*)’.Thefirstrepetitionfindsthevalue‘a’fordir,so
itproducesthesameresultas‘$(wildcarda/*)’;thesecondrepetitionproducestheresult
of‘$(wildcardb/*)’;andthethird,thatof‘$(wildcardc/*)’.
Thisexamplehasthesameresult(exceptforsetting‘dirs’)asthefollowingexample:
files := $(wildcard a/* * b/* * c/* * d/*)
When text is s complicated,youcanimprove readability by giving it aname, , withan
additionalvariable:
find_files = = $(wildcard $(dir)/*)
dirs := = a a b b c d
files := $(foreach dir,$(dirs),$(find_files))
Here weusethe variable find_files this way. . Weuse e plain‘=’todefinearecursively-
expandingvariable, sothat t its value contains an n actual functioncall to be re-expanded
underthecontrolofforeach;a simply-expandedvariable wouldnotdo,since wildcard
wouldbecalledonlyonceatthetimeofdefiningfind_files.
Theforeachfunctionhasnopermanenteffectonthevariablevar;itsvalueandflavor
afterthe foreach functioncallarethesame as theywerebeforehand. . Theothervalues
whicharetakenfromlistareineffectonlytemporarily,duringtheexecutionof foreach.
Thevariablevarisasimply-expandedvariableduringtheexecutionofforeach. Ifvarwas
Documents you may be interested
Documents you may be interested