open pdf and draw c# : How to add text field to pdf Library software component .net windows wpf mvc adobephotoshop7_scripting_guide4-part2043

Photoshop7.0ScriptingGuide
41
ScriptingPhotoshop
YourfirstPhotoshopscript
3
3.3.4 JavaScript
// Hello o Word d Script
// Remember current unit settings and then set units to
// the value expected by this script
var originalUnit = preferences.rulerUnits;
preferences.rulerUnits = = Units.INCHES;
// Create a new 4x4 inch document and assign n it t to a variable
var docRef = documents.add( 4, 4 );
// Create a new art layer containing text
var artLayerRef = docRef.artLayers.add();
artLayerRef.kind = LayerKind.TEXT;
// Set the contents of the text layer.
var textItemRef = artLayerRef.textItem;
textItemRef.contents = "Hello, World!";
// Release references
docRef = = null;
artLayerRef = null;
textItemRef = null;
// Restore original ruler unit setting
preferences.rulerUnits = = originalUnit;
How to add text field to pdf - insert text into PDF content in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
XDoc.PDF for .NET, providing C# demo code for inserting text to PDF file
how to enter text into a pdf form; add text to pdf acrobat
How to add text field to pdf - VB.NET PDF insert text library: insert text into PDF content in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Providing Demo Code for Adding and Inserting Text to PDF File Page in VB.NET Program
add text pdf reader; add text to pdf reader
Photoshop7.0ScriptingGuide
42
ScriptingPhotoshop
Objectreferences
3
3.4 Objectreferences
3.4.1 AppleScript
AppleScriptusesobjectreferencestoidentifythetargetobjectforcommands.Whenworking
withPhotoshopyoucanidentifyeachiteminanobjectreferenceusingeitherindexorname
form.Forexample,ifyouhaveasingledocument,named“MyDocument”,open,youcould
targetthedocument’sfirstlayer,named“CloudLayer”witheitherline:
layer 1 1 of f document 1
or
layer "cloud layer" of document "My Document"
N
OTE
:
WhenscriptingPhothshopadocument'sindexisnotalwaysthesameasitsstacking
orderintheuserinterface.Itispossiblefordocument 1tonotbethefront-most
document.ForthisreasonPhotoshopwillalwaysreturnobjectreferencesidentifying
documentsbyname.Itisrecommendedthatyoualwaysusethenameformwhen
identifyingdocumentsinyourscripts.
Anobject'sindexornamealsomaychangeasaresultofmanipulatingotherobjects.For
example,whenanewartlayeriscreatedinthedocument,itwillbecomethefirstlayer,and
thelayerthatwaspreviouslythefirstlayerisnowthe2ndlayer.Therefore,anyreferences
madetolayer1ofcurrentdocumentwillnowrefertothenewlayer.
Considerthefollowingsamplescript:
1.
tell application "Adobe e Photoshop 7.0"
2.
activate
3.
set newDocument to o make new document with properties s ¬
{ width: : inches s 2, height: inches 3}
4.
set layerRef to layer 1 1 of current document
5.
make new w art layer in n current t document
6.
set name e of layerRef to "My layer"
7.
end tell
Thisscriptwillnotsetthenameofthelayerreferencedonthefourthlineofthescript.Instead
itwillsetthenamecreatedonlinefive.Tryreferencingtheobjectsbynameasshownbelow:
1.
tell application "Adobe e Photoshop 7.0"
2.
activate
3.
set newDocument to o make new document with properties s ¬
{ width: : inches s 2, height: inches 3}
4.
make new art t layer in n current document with properties s {name: : "L1" " }
5.
make new w art layer in n current t document with h properties s {name: : "L2" " }
6.
set name e of art t layer "L1" " of current t document to "New w Layer 1"
7.
end tell
C# PDF insert image Library: insert images into PDF in C#.net, ASP
Insert images into PDF form field. Access to freeware download and online C#.NET class source code. How to insert and add image, picture, digital photo, scanned
add text to pdf file online; adding text fields to a pdf
VB.NET PDF insert image library: insert images into PDF in vb.net
Insert images into PDF form field in VB.NET. with this sample VB.NET code to add an image PDFDocument = New PDFDocument(inputFilePath) ' Get a text manager from
how to insert text into a pdf using reader; add text box in pdf document
Photoshop7.0ScriptingGuide
43
ScriptingPhotoshop
Objectreferences
3
3.4.2 VisualBasicandJavaScript
ObjectreferencesinVisualBasicandJavaScriptarefixedandremainvaliduntildisposedor
untilthehostobjectgoesaway.Thefollowingexampleshowshowtocreate2layersandthen
renamethefirstoneinVisualBasic.
Dim appRef As Photoshop.Application
Dim docRef As Photoshop.Document
Dim layer1Ref As Photoshop.ArtLayer
Dim layer2Ref As Photoshop.ArtLayer
' Set ruler units and create e a a new document.
Set appRef = New Photoshop.Application
originalRulerUnits = appRef.Preferences.RulerUnits
appRef.Preferences.RulerUnits = psInches
Set docRef = appRef.Documents.Add(4, 4, 72, "My New Document")
' Create e 2 2 new layers and store their return n references.
Set layer1Ref = docRef.ArtLayers.Add()
Set layer2Ref = docRef.ArtLayers.Add()
' Change e the e name of the first layer that was s created.
layer1Ref.Name = "This layer was first"
'restore unit t values
appRef.Preferences.RulerUnits = originalRulerUnits
TodoasimilarthinginJavaScriptyoucoulddo:
// set ruler units and create new document
originalRulerUnits = preferences.rulerUnits
preferences.rulerUnits = = Units.INCHES;
documents.add(4,4,72,"My New w Document");
docRef = = activeDocument;
layer1Ref = docRef.artLayers.add();
layer2Ref = docRef.artLayers.add();
layer1Ref.name = "This layer was first";
// restore unit setting
preferences.rulerUnits = = originalRulerUnits;
VB.NET PDF Text Extract Library: extract text content from PDF
With this advanced PDF Add-On, developers are able to extract target text content from source PDF document and save extracted text to other file formats
how to insert text box in pdf document; add text to a pdf document
C# PDF Text Extract Library: extract text content from PDF file in
How to C#: Extract Text Content from PDF File. Add necessary references: RasterEdge.Imaging.Basic.dll. RasterEdge.Imaging.Basic.Codec.dll.
how to add text box to pdf; add text boxes to pdf
Photoshop7.0ScriptingGuide
44
ScriptingPhotoshop
Workingwithunits
3
3.5 Workingwithunits
Photoshopprovidestworulersforusewhenworkingonadocument—agraphicsrulerused
formostgraphicallayoutmeasurementsandatyperulerwhichisactivewhenusingthetype
tool.Theunittypesforthesetworulersaresetusingtheruler units
(RulerUnits/rulerUnits)andtype units (TypeUnits/typeUnits),respectively.
ThesesettingscorrespondtothosefoundinthePhotoshoppreferencedialogunder“Edit
>Preferences>Units&Rulers.”
Thegraphicsrulerisusedformostoperationsonadocumentwhereheight,width,orposition
arespecified.Thetyperulerisusedwhenoperatingontextitems,suchaswhensettingleading
orindentvalues.Bychangingthesettingsforeachruleryoucanworkwithdocumentsinthe
measurementsystemthatmakethemostsensefortheprojectathand.
3.5.1 Unitvalues
PhotoshopScriptingSupportusesunitvaluesforcertainpropertiesandparameters.The
commentsforthePhotoshopScriptingSupportobjectsandpropertieswillnotewhereunit
valuesareused.
Becauseofscriptinglanguagesdifferences,thewayyouprovideaunitvalueinascriptwill
dependonthelanguageyouareusing.Alllanguagessupportplainnumbersforunitvalues.
ScriptingSupporttreatsthesevaluesasbeingofthetypecurrentlyspecifiedforthe
appropriateruler.
Forexample,iftherulerunitsarecurrentlysettoinchesandthefollowingVisualBasic
statementisexecuted:
docRef.ResizeImage 3,3
thedocument'simagewillberesizedto3inchesby3inches.Iftherulerunitsweresetto
pixels,theimagewouldbe3pixelsby3pixels,whichisprobablynotwhatwasintended.To
ensurethatyourscriptsproducetheexpectedresultsyoushouldcheckandsettherulerunitsto
thetypeappropriateforyourscript.Afterexecutingascripttheoriginalvaluesoftherule
settingsshouldberestoredifchangedinthescript.Seesection3.5.3,“Changingrulerandtype
units”onpage48 fordirectionsonsettingunitvalues.
AppleScriptunitconsiderations
AppleScriptprovidesanadditionalwayofworkingwithunitvalues.Youcanprovidevalues
withanexplicitunittypewhereunitvaluesareused.Whenatypedvalueisprovideditstype
overridestheruler’scurrentsetting.
Forexample,tocreateadocumentwhichis4incheswideby5incheshighyouwouldwrite:
make new w document with h properties s {width:inches 4, ¬
height:inches 5}
VB.NET PDF Password Library: add, remove, edit PDF file password
VB: Add Password to PDF with Permission Settings Applied. This VB.NET example shows how to add PDF file password with access permission setting.
adding text to a pdf document; add text pdf file acrobat
C# PDF Password Library: add, remove, edit PDF file password in C#
C# Sample Code: Add Password to PDF with Permission Settings Applied in C#.NET. This example shows how to add PDF file password with access permission setting.
adding text fields to pdf acrobat; add text block to pdf
Photoshop7.0ScriptingGuide
45
ScriptingPhotoshop
Workingwithunits
3
ThevaluesreturnedforaPhotoshoppropertywhichusedunitswillbereturnedasavalueof
thecurrentrulertype.Gettingtheheightofthedocumentcreatedabove:
set docHeight to height of current document
wouldreturnavalueof5.0,whichrepresents5inchesbasedonthecurrentrulersettings.
InAppleScript,youcanoptionallyaskforapropertyvalueasaparticulartype.
set docHeight to height of current document as points
Thiswouldreturnavalueof360(5inchesx72pointsperinch).
IMPORTANT:
BecausePhotoshopisapixel-orientedapplicationyoumaynotalwaysget
backthesamevalueasyoupassinwhensettingavalue.Forexample,ifRuler
Unitsissettommunits,andyoucreateadocumentthatis30x30,thevalue
returnedfortheheightorwidthwillbe30.056ifyourdocumentresolutionis
setto72ppi.Thescriptinginterfaceassumessettingsaremeasuredbyppi.
ThelengthunitvaluetypesavailableAppleScriptusearelistedbelow:
ThepointsandpicasunitvaluetypesarePostScriptpoints,with72pointsperinch.The
traditional pointsandtraditional picas unitvaluetypesarebasedonclassical
typesettingvalues,with72.27pointsperinch.
Whenworkingwithunitvalues,itispossibletoconvert,orcoerce,aunitvaluefromonevalue
typetoanother.Forexample,thefollowingscriptwillconvertapointvaluetoaninchvalue.
set pointValue to points 72
set inchValue to pointValue as inches
WhenthisscriptisrunthevariableinchValuewillcontaininches1,whichis72points
convertedtoinches.ThisconversionabilityisbuiltintotheAppleScriptlanguage.
Touseaunitvalueinacalculationitisnecessarytofirstconvertthevaluetoanumber(unit
valuecannotbeuseddirectlyincalculations).Tomultiplyaninchvaluewrite:
set newValue to (inchValue as number) * * someValue
T
ABLE
3.1
AppleScriptLengthUnitValues
inches
millimeters
feet
centimeters
yards
meters
miles
kilometers
points
picas
traditionalpoints
traditionalpicas
ciceros
VB.NET PDF Field Edit library: insert, delete, update pdf form
By using RaterEdge .NET PDF package, you can add form fields to existing pdf files, delete or remove form field in PDF page and update PDF field in VB.NET
how to add text to a pdf in acrobat; add text pdf acrobat
VB.NET PDF Text Add Library: add, delete, edit PDF text in vb.net
Data: Auto Fill-in Field Data. Field: Insert, Delete, Update Field. Redact Text Content. Redact Images. Redact Pages. Annotation & Drawing. Add Sticky Note.
adding text to a pdf in acrobat; add text to pdf in acrobat
Photoshop7.0ScriptingGuide
46
ScriptingPhotoshop
Workingwithunits
3
Specialunitvaluetypes
TheunitvaluesusedbyPhotoshopScriptingSupportarelengthunits,representingvaluesof
linearmeasurement.Supportisalsoincludedforpixelandpercentunitvalues.Thesetwounit
valuetypesarenot,strictlyspeaking,lengthvaluesbutareincludedbecausetheyareused
extensivelybyPhotoshopformanyoperationsandvalues.
N
OTE
:
InAppleScriptyoucangetandsetvaluesaspixelsorpercentasyouwouldanyother
unitvaluetype.Youcannot,however,convertapixelorpercentvaluetoanotherlength
unitvalueasyoucanwithotherlengthvaluetypes. Tryingtorunthefollowingscript
willresultinanerror.
set pixelValue to pixels 72
-- Next line will result t in n a a coercion error when n run
set inchValue to pixelValue as inches
3.5.2 Unitvalueuseage
Thefollowingtwotableslistthepropertiesoftheclassesandparametersofcommandsthatare
definedtouseunitvalues.Unitvaluesforthesepropertiesandparameter,withtheexception
ofsometextitemproperties,arebasedthegraphicsrulersetting.
T
ABLE
3.2
ObjectProperties
Object
AppleScript
Properties
VisualBasic
Properties
JavaScript
Properties
Document
height
width
Height
Width
height
width
EPSopenoptions
height
width
Height
Width
height
width
PDFopenoptions
height
width
Height
Width
height
width
lensflareopen
options
height
width
Height
Width
height
width
offsetfilter
horizontaloffset
verticaloffset
HorizontalOffset
VerticalOffset
horizontalOffset
verticalOffset
C# PDF Field Edit Library: insert, delete, update pdf form field
Able to add text field to specified PDF file position in C#.NET class. Support to change font size in PDF form. Able to delete form fields from adobe PDF file.
how to insert text box on pdf; how to add text to pdf file with reader
C# PDF Text Add Library: add, delete, edit PDF text in C#.net, ASP
Data: Auto Fill-in Field Data. Field: Insert, Delete, Update Field. Redact Text Content. Redact Images. Redact Pages. Annotation & Drawing. Add Sticky Note.
add text field pdf; add text box to pdf file
Photoshop7.0ScriptingGuide
47
ScriptingPhotoshop
Workingwithunits
3
*Unitvaluesbasedontyperulersetting
TextItem
baselineshift*
firstlineindent*
height
hyphenationzone*
leading*
leftindent*
position
rightindent*
spacebefore*
spaceafter*
width
BaselineShift*
FirstLineIndent*
Height
HyphenationZone*
Leading*
LeftIndent*
Position
RightIndent*
SpaceBefore*
SpaceAfter*
Width
baselineShift*
firstLineIndent*
height
hyphenationZone*
leading*
leftIndent*
position
rightIndent*
spaceBefore*
spaceAfter*
width
T
ABLE
3.3
CommandParameters
AppleScript
VisualBasic
JavaScript
crop
(bounds,height,width)
Document.Crop
(Bounds,Height,Width)
document.crop
(bounds,height,width)
resizecanvas
(height,width)
Document.ResizeCanvas
(Height,Width)
document.resizeCanvas
(height,width)
resizeimage
(height,width)
Document.ResizeImage
(Height,Width)
document.resizeImage
(height,width)
contract
(by)
Selection.Contract
(By)
selection.contract
(by)
expand
(by)
Selection.Expand
(By)
selection.expand
(by)
feather
(by)
Selection.Feather
(By)
selection.feather
(by)
selectborder
(width)
Selection.SelectBorder
(Width)
selection.selectBorder
(width)
translate
(deltax,deltay)
Selection.Translate
(DeltaX,DeltaY)
selection.translate
(deltaX,deltaY)
T
ABLE
3.2
ObjectProperties
Object
AppleScript
Properties
VisualBasic
Properties
JavaScript
Properties
Photoshop7.0ScriptingGuide
48
ScriptingPhotoshop
ExecutingJavaScriptsfromASorVB
3
3.5.3 Changingrulerandtypeunits
TheunittypesettingsofthetwoPhotoshoprulerscontrolhownumbersareinterpretedwhen
dealingwithpropertiesandparametersthatsupportunitvalues.Besuretosettherulerunitsas
neededatthebeginningofyourscriptsandsaveandrestoretheoriginalrulersettingswhen
yourscripthascompleted.
InAppleScriptruler unitsandtype unitsarepropertiesofthesettings-object,
accessedthroughtheApplicationobject's settings propertyasshownbelow.
set ruler units of settings to inch units
set type units of settings to pixel units
set point size of settings to postscript size
InVisualBasicandJavaScriptruler units andtype unitsarepropertiesofthe
Preferences,accessedthroughtheapplicationobject'spreferencespropertyasshown
below.
VB:
appRef.Preferences.RulerUnits = PsInches
appRef.Preferences.TypeUnits = PsTypePixels
appRef.Preferences.PointSize = PsPostScriptPoints
JS:
preferences.rulerUnits = = Units.INCHES;
preferences.typeUnits = = TypeUnits.PIXELS;
preferences.pointSize = = PointType.POSTSCRIPT;
IMPORTANT:
Remembertoresettheunitsettingsbacktotheoriginalvaluesattheendofa
script.
3.6 ExecutingJavaScriptsfromASorVB
WithPhotoshop’sscriptingsupportyoucanrunJavaScriptsfromAppleScriptorVisualBasic.
ForApplescript,usedo javascript.
translateboundary
(deltax,deltay)
Selection.TranslateBoundary
(DeltaX,DeltaY)
selection.translateBoundary
(deltaX,deltaY)
T
ABLE
3.3
CommandParameters
AppleScript
VisualBasic
JavaScript
Photoshop7.0ScriptingGuide
49
ScriptingPhotoshop
ExecutingJavaScriptsfromASorVB
3
ForVisualBasic,useeithertheApplication'sDoJavaScriptor DoJavaScriptFile
method.DoJavaScripttakesastring,whichistheJavaScriptcodetoexecute.
DoJavaScriptFileopensafilethatcontainstheJavaScriptcode.Anexampleisbelow:
AS:
set scriptFile to "myscript" as alias
do javascript scriptFile
VB:
Dim appRef As Photoshop.Application
Set appRef = CreateObject("Photoshop.Application")
appRef.DoJavaScriptFile ("D:\\Scripts\\MosaicTiles.js")
3.6.1 PassingargumentstoJavaScript
YoucanpassargumentstoJavaScriptfromeitherAppleScriptorVisualBasicbyusingthe
with arguments (Arguments)parameter.Theparametertakesanarrayforyoutopass
anyvalues.
Forexample,savethefollowingJavaScriptinafilesomewhereonyourmachine:
alert( "You passed " + arguments.length + " arguments" );
for ( i i = = 0; i < arguments.length; ++i )
{
alert( arguments[i].toString() )
}
TopassargumentsfromAppleScripttrythis:
tell application "Adobe Photoshop 7.0"
make new w document
do javascript (alias <a path h to o the JavaScript shown above>) ¬
with arguments {1, "test text", (file <a path h to o a file>),¬
current document}
end tell
TodothesamethinginVB,write:
Dim appRef As Photoshop.Application
Set appRef = CreateObject("Photoshop.Application")
appRef.DoJavaScriptFile "C:\scripts-temp\test.js", _
Array(1, "text t text", appRef.ActiveDocument)
WhenrunningJavaScriptfromAppleScriptorVisualBasicyoucanalsocontrolthe
debuggingstate.Todothisyouusetheshow debugger r (ExecutionMode)argument.The
valuesofthisargumentinclude:
Documents you may be interested
Documents you may be interested