116
©Nitro
AddoreditfolderlevelJavaScript
FolderlevelJavaScriptsareJavaScriptfiles(.JS)thatarerunduringapplicationstartup.Thesecanbe
usefulforloadingreusableJavaScriptfunctionsintotheapplication,oraccessingmethods/properties
whosesecurityrestrictionsonlyallowthemtoberunintheapp/initevent.
Simpleexamplesincludeloadingtheuser'sWindowsloginintoaglobalJavaScriptvariableatstartup,or
loadingalistofemployeenamesfromyourcompanyintoaJSarrayatstartupwhichcanbeusedbythe
formsthatareopenedinNitroPro8.
ToaddoreditafolderlevelJavaScript
1. OpenNitroPro8
2. OntheFormsribbontab,intheJavaScriptgroup,clickFolderLevel
3. AddJSfilestothefolderoreditexistingones
NitroPro8-UserGuide
Pdf compression - Compress reduce PDF size in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
C# Code & .NET API to Compress & Decompress PDF Document
change font size in fillable pdf; pdf markup text size
Pdf compression - 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
advanced pdf compressor online; pdf optimized format
117
©Nitro
DocumentlevelJavaScript
YoucanuseJavaScripttoaddanalmostinfinitenumberofinteractivefeatures,createcomplexcalculation
formulas,andaddmoredynamicfunctionalitytoyourPDFs.
Documentlevelscriptsareusedtoaddfunctionsfromwhichotherscriptscanreuseroutinesthroughout
aPDFfile.YoucanalsousedocumentlevelJavaScriptstoinvokeactionswhenafileopens.
TowriteadocumentlevelJavaScript
1. OpenthePDFinNitroPro8
2. OntheFormsribbontab,intheJavaScriptgroup,clickDocumentLevel
3. ClickNew,andtypeanamefortheJavaScript
4. IntheJavaScriptEditordialog,enteryourcode.Intheexamplebelow,asimpleroutineiscreated
thatopensanalertdialogboxeachtimethefileopensThecodeusedis:
var msg = “Created in Nitro Pro”;
app.alert(msg);
5. ClickOK.Ifyourscriptwaswrittenproperly,adialogboxshoulddisplayeachtimethefileisopened
NitroPro8-UserGuide
C# PDF Convert to Tiff SDK: Convert PDF to tiff images in C#.net
zoomValue, The magnification of the original PDF page size. override void ConvertToDocument(DocumentType targetType, ImageCompress compression, String filePath).
change font size in pdf comment box; best way to compress pdf files
C# Create PDF from Tiff Library to convert tif images to PDF in C#
Description: Convert to PDF with specified compression method and save it on the disk. Parameters: Name, Description, Valid Value.
pdf files optimized; pdf file size
118
©Nitro
AddoreditcustomcalculationJavaScript
Anyformyoucreatethatrequirescalculationsislikelytorequirecustomcalculationscripts.Theoptions
youhaveavailablewithpresetcalculationformulasarelimitedtosimplemultiplicationandaddition.
Otherkindofcalculationyouneedrequireswritingascript.
Towriteacalculationscript
1. OpenthePDFinNitroPro8
2. OntheFormsribbontab,intheFieldsgroup,clickTextField
3. Selectthetextfieldtoedit
4. Right-clickandselectProperties
5. ClicktheCalculatetab
6. ClicktheCustomcalculationscriptoption,andthenclicktheEditbutton
7. Typethecodeforyourscript.Intheexamplebelow,asimpleroutineiscreatedtocalculatesales
taxata7.25%rate.Thecodeusedis:
var f = this.getField(“subtotal”);
event.value = Math.round(f.value 7.25)/100;
8. ClickOK
NitroPro8-UserGuide
C# PDF Convert to Word SDK: Convert PDF to Word library in C#.net
zoomValue, The magnification of the original PDF page size. override void ConvertToDocument(DocumentType targetType, ImageCompress compression, String filePath).
300 dpi pdf file size; pdf page size may not be reduced
C# Create PDF from PowerPoint Library to convert pptx, ppt to PDF
Description: Convert to PDF/TIFF with specified compression method and save it on the disk. Parameters: Name, Description, Valid Value.
pdf page size; change page size pdf acrobat
119
©Nitro
Addasimplifiedfieldnotation
SimplifiedfieldnotationiswrittenmorelikeformulasyouaddinspreadsheetapplicationslikeMicrosoft
Excel.Writinganotationisoftenaneasiersolutionwhenaddingcalculationscripts.
ToaddaSimplifiedfieldnotation
1. OpenthePDFinNitroPro8
2. OntheFormsribbontab,intheFieldsgroup,clickTextField
3. Selectthetextfieldtoedit
4. Right-clickandselectProperties
5. ClicktheCalculatetab
6. ClicktheSimplifiedfieldnotationoption,andthenclicktheEditbutton
7. Typethecodeforyourscript.Inthisexample,thesamecalculationforcreatingsalestaxisadded.
ThecodeintheJavaScriptEditoriswrittenasfollows:
subtotal .0725;
8. ClickOK
NitroPro8-UserGuide
C# Create PDF from Excel Library to convert xlsx, xls to PDF in C#
Description: Convert to PDF/TIFF with specified compression method and save it on the disk. Parameters: Name, Description, Valid Value.
pdf compression settings; adjust pdf page size
C# Create PDF from Word Library to convert docx, doc to PDF in C#.
Description: Convert to PDF/TIFF with specified compression method and save it on the disk. Parameters: Name, Description, Valid Value.
can pdf files be compressed; change font size in pdf fillable form
120
©Nitro
UsetheJavaScriptconsole
YoucanopentheJavaScriptConsoleandwriteascriptthatdoesn’tbelongtoanyfieldorelement.Scripts
writtenintheJavaScriptConsolecanbeusedtotestroutinesanddebugcode.
TousetheJavaScriptconsole:
l
OntheFormsribbontab,intheJavaScriptgroup,clickConsole
NitroPro8-UserGuide
C# TIFF: How to Use C#.NET Code to Compress TIFF Image File
When you create a TIFFPage with an image source, you can choose the type of image compression you want to use. C# Demo Code for TIFF File Compression.
batch pdf compression; change font size pdf fillable form
C# Create PDF from CSV to convert csv files to PDF in C#.net, ASP.
Description: Convert to PDF/TIFF with specified compression method and save it on the disk. Parameters: Name, Description, Valid Value.
change paper size in pdf; adjust size of pdf file
121
©Nitro
ViewoutputandJavaScripterrors
TheOutputPaneallowsyoutoviewanyerrorsrelatedtoJavaScriptordocumentprocesses,andwillopen
automaticallytoalertyouofanyimportantoutputmessages.
ToopentheOutputpane:
l
Onthesidebar,clicktheOutputtab
NitroPro8-UserGuide
122
©Nitro
SupportedJavaScriptObjects
l
App
object
l
Color
object
l
Console
object
l
Event
object
l
Field
object
l
Global
object
l
Identity
object
l
Link
object
l
This
object
l
Util
object
l
OCG
object
NitroPro8-UserGuide
123
©Nitro
Appobject
AstaticobjectthatrepresentsthePDF viewerapplication.
Containsmethodsandpropertiesforinterfacingwiththeapplicationaswellassomeforworkingwith
activedocuments.
Example:Getsthenumberofdocumentsopenanddisplaysitinanalertmessage.
var nDocs = app.activeDocs.length;
app.alert("You have " + nDocs + " documents open.");
Properties
activeDocs
formsVersion
platform
viewerType
viewerVersion
Methods
alert
browseForDoc
goBack
goForward
launchURL
mailMsg
newDoc
openDoc
response
NitroPro8-UserGuide
124
©Nitro
Colorobject
AnobjectthatcanbeusedwhensettingacolorinotherJavaScriptmethodsandproperties.
Example:Setsthetextcolorintheformfield“FirstName”tored.
this.getField("First Name").textColor = color.red;
Properties&Methods
ThecolorobjectsupportsallpropertiesandmethodsincludedintheAcrobatJavaScriptspecification.
NitroPro8-UserGuide
125
©Nitro
Consoleobject
AllJavaScriptscriptsareexecutedastheresultofaparticulareventoccurring.Foreachoftheseevents,
JavaScriptwillcreateaneventobjectthatcanbeusedtogetandupdateinformationaboutthecurrent
stateoftheevent.
Example:ExecutingthisJavaScriptonthekeystrokeeventwillchangeanyinputfromtheuserto
uppercase.
event.change = event.change.toUpperCase();
Properties&Methods
TheconsoleobjectsupportsallpropertiesandmethodsincludedintheAcrobatJavaScriptspecification.
NitroPro8-UserGuide
Documents you may be interested
Documents you may be interested