The purpose behind this Wiki is to generate a JDF file consisting of XML that is compliant with the newly emerging Digital Large Format JDF standards. This is only possible on the Customizable version of Control. The steps taken here assume basic knowledge of creating variables and User Constants.
Concept
There are several basic tasks that will be done to set this up. First, we create 2 UDF's to store some of the Directory and URL information. Second, we create the JDF variable to store the XML text string that will be printed. Next, we attach this to the Digital Print products that this will be used for. Lastly, we create a SQL report to generate the XML file to be used.
Cautions
There are several stipulations for the XML file to be generated correctly. The only Resolutions supported are High, Normal, and Production. Any others will cause the file to generate an error. The Material being used and it's description must not contain any double quotes (ex: Avery Saturn 12oz DS Matte Banner 54“). If quotes exist, the XML file created will generate an error. Also, if the User Contants are not created, or if no information is entered in them, the file will contain an error. Also, the Path must be URL compliant, so it can not contain any spaces. Lastly if no Material is selected (FlatStock or RollStock, dependant on Product), an error file will be created.
Creating the User Constants
- Go to Setup > Pricing Setup > All Pricing Setup
- Click on User Constants on the left, and click “Add” from the top of the middle column.
- Set the Category Name to “JDF Options” and click on Save, then click on Edit.
- Click on Insert to add 2 new User Constants
- JDF_Artwork_Path Will contain the file path for the artwork
- IMPORTANT All spaces must be replaced with %20 to be URL Compliant. IMPORTANT
- Example: C:/My%20Documents/My%20Path/JDF%20File%20Path
- JDF_Artwork_Extension Will be the file extension appended to the file path (ex: .pdf) Must be enclosed in quotes. (ex: ”.pdf“)
Creating the JDF Variable
- Go to Setup > Pricing Setup > All Pricing Setup
- Click on Variables on the left, and select “General” from the middle column, then click on “New Variable” at the top.
- Variable Name is JDF
- Variable Type is Text
- Save Option is “Save Extra Information for Reporting and Enhanced Search Capabilities”.
- For Default, select “Use Formula” and paste this CFL in.
Declare Sample:= ”“;
Declare Resolution:= ”“;
Declare Side := ”“;
Declare Rotate:= ”“;
Declare Path:= ”“;
Declare Errors := ”“;
Declare CustNumber := 0;
Declare JobName := ”“;
Declare Dimensions := ”“;
Declare Organization := ”“;
Declare FirstName := ”“;
Declare FamilyName := ”“;
Declare MediaDescription:= ”“;
Declare Brand := ”“;
Declare MediaDimension := ”“;
Declare MediaUnit := ”“;
Declare Unit := ”“;
Sample := “o” + ToString(TransHeader.OrderNumber) + ”-“ + TransDetail.LineItemNumber;
If LargeFormatResolution = “Standard”
Then Resolution := “Normal”
elseif LargeFormatResolution = “High”
Then Resolution := “High”
elseif LargeFormatResolution = “Production”
Then Resolution := “Draft”
else Errors := Errors + “Unable to Create JDF because Resolution does not match a supported PrintQuality.”
endif;
If IsAssigned(Rollstock_Layout) then
if GetVariablePropertyValue(RollStock_Layout,”IsRotated“,0) = 1
then Rotate := 'Rotate=“Rotate90”'
else Rotate:= 'Rotate=“Rotate0”'
endif
elseif IsAssigned(Flatstock_Layout) then
if GetVariablePropertyValue(Flatstock_Layout,”IsRotated“,0) = 1
then Rotate := 'Rotate=“Rotate90”'
else Rotate:= 'Rotate=“Rotate0”'
endif
else Rotate := ”“; not an error, just don't save any value. endif; If SidesDrop = “Single Sided” then Side := “OneSidedFront” elseif SidesDrop = “Double Sided” then Side := “TwoSidedFlipX” Else Errors := Errors + “Unable to Create JDF because Side does not match supported Sides. ” EndIf; Assigns values for Media sectioin
If IsAssigned(Rollstock_Layout)
then Brand := RollStock_Material;
MediaDescription := PartByVariableName(“RollStock_Material”).Description;
MediaUnit := “Roll”;
MediaDimension := ToString(PartUDFByVariableName(RollStock_Material, “Substrate - Roll Width”, 0) * 72) + ” 0“;
Unit := PartByVariableName(“RollStock_Material”).Part.InventoryUnitText
elseif IsAssigned(Flatstock_Layout)
then Brand := FlatStock_Material;
MediaDescription := PartByVariableName(“FlatStock_Material”).Description;
MediaUnit := “Sheet”;
MediaDimension := ToString(PartUDFByVariableName(FlatStock_Material, “Substrate - Height”, 0) * 72) + ” “ + ToString(PartUDFByVariableName(FlatStock_Material, “Substrate - Width”, 0) * 72);
Unit := PartByVariableName(“FlatStock_Material”).Part.InventoryUnitText
else Errors := Errors + “Unable to Create JDF because no media is selected. ”
endif;
If Pos(Brand, '”') > 0
Then Errors := Errors + 'Invalid Part Name “'+Brand+'”. Quotes not allowed in the Part Name. '
EndIf;
If Pos(MediaDescription, '“') > 0
Then Errors := Errors + 'Invalid Part Description ”'+MediaDescription+'“. Quotes not allowed in the Part Description. '
EndIf;
If JDF_Artwork_Path = ”“ then Errors := Errors + “Unable to create JDF because no System Path is set for the User Constant” endif;
If JDF_Artwork_Extension = ”“ then Errors := Errors + “Unable to create JDF because no File Extension is set for the User Constant” endif;
Path := JDF_Artwork_Path + ”/Order“ + ToString(TransHeader.OrderNumber) + ”-“ + TransDetail.LineItemNumber + JDF_Artwork_Extension;
Assigns values for CustomerInfo section If TransHeader.Account.CompanyName = “Not Assigned” then CustNumber := 0 else CustNumber := TransHeader.Account.CustomerNumber Endif; JobName := Description; Dimensions := ToString1); Multiply by 72 for Pixels
Organization := TransHeader.Account.CompanyName;
FirstName := TransHeader.Contact.FirstName;
FamilyName := TransHeader.Contact.LastName ;
If Errors ”“ Then Errors Else
'
'
endif
6. For Both Roll Sign Print and Rigid Sign Print: ### Click on Edit and go to the Variables tab. ### Make sure, "Show Only Variables In Use" is Unchecked ### Expand General, and click the box next to the JDF variable. ### Click on Save ===== Create the SQL Report ===== - Go to Setup > Reporting Setup - Expand Reports on Action Toolbar > For Order Line Items - With "For Order Line Items" category selected, pull down the "Add" box above the list, and select "New SQL Report" * Menu Item Name is "JDF File" * Select the box next to "SQL" * Make sure "Create View and Save" is selected under the Options box at the bottom. - In the SQL box, paste this code
select TransDetailParam.ValueAsString as []
From TransDetail with(nolock)
LEFT OUTER JOIN TransDetailParam with(nolock) ON TransDetailParam.ParentID = TransDetail.ID
Where TransDetailParam.ParameterName = 'JDF' AND TransDetail.ID =
5. Click on the "Options" Tab at the Top 6. Click on "Show Detail" under LineItem_LineItemID, and use the dropdown list next to Paramter Type and select "Line Item". 7. Click on Save ===== Sample File ===== Below is a sample of the output file converted to XML format to make it easier to read.
<code> Source Contributor: kking, Cyrious(optional) Date: 9/30/2010 Version: Control 4.5