Пример #1
0
        public static Apogee.ApoXML CreateBusinessCards()
        {
            string[] names   = new string[] { "A", "B", "C" };
            int[]    amounts = new int[] { 200, 100, 300 };

            Apogee.ApoXML apoxml = new Apogee.ApoXML()
            {
                AgentName         = "ApoXmlCsLib",
                AgentVersion      = "1.0.0",
                OrderNumber       = "ApoXML",
                JobName           = "BusinessCards " + Utils.Timestamp,
                Comments          = "ApoXML BusinessCards sample - 3 different business cards in different quantities.",
                ProductType       = "Flatwork",
                DecimalSeparator  = Apogee.ApoXMLDecimalSeparator.Item1,                 // Item=comma, Item1=point
                ThousandSeparator = Apogee.ApoXMLThousandSeparator.Item1,                // Item=point Item1=comma
                Unit = Apogee.ApoXMLUnit.mm,
                //TicketTemplate = "myTicketTemplate",	// Name of job or hot ticket template.
                CustomerContact = new Apogee.BaseContactType()
                {
                    Company = new Apogee.BaseCompanyType()
                    {
                        JDFProductID  = "PID_Comp_DemoCompany_001",
                        Company       = "Demo Company",
                        Street        = "Demo Street 1",
                        ZIP           = "1234",
                        City          = "Demo City",
                        StateProvince = "Demo Province",
                        Country       = "Demo Country",
                        Phone         = "123456789",
                        PrintCenter   = "Demo Print Center"
                    },
                    Person = new Apogee.BasePersonType()
                    {
                        JDFProductID = "PID_Pers_FirstLast_001",
                        Title        = "Mr.",
                        FirstName    = "ContactFirstName",
                        LastName     = "ContactLastName",
                        Prefix       = "123",
                        FixPhone     = "456789",
                        MobilePhone  = "987654",
                        Email        = "*****@*****.**"
                    }
                },
                Binding = new Apogee.BindingType()
                {
                    Method          = Apogee.MethodType.Unbound,
                    MethodSpecified = true
                }
            };

            apoxml.Part = new Apogee.BasePartType[names.Length];
            for (int i = 0; i < names.Length; i++)
            {
                var part = new Apogee.BasePartType()
                {
                    PartType  = Apogee.PartTypeType.Plain,
                    PartName  = "BusinessCards " + names[i],
                    Press     = "Large Press",
                    WorkStyle = Apogee.ImposeWorkStyleType.Duplex,
                    Comments  = "BusinessCard remark",
                    Amount    = amounts[i].ToString(),                    // string
                    Pages     = new Apogee.PagesType()
                    {
                        URL        = $"file:///{Utils.AppFolderUrl}Samples/PDF/BusinessCard_{names[i]}_01_DS_CMYK_85x54.7.pdf",
                        PageCount  = "2",                          // string
                        PageWidth  = 85M,
                        PageHeight = 55M
                    },
                    Color = new Apogee.ColorType()
                    {
                        NrColors = "4"                          // string
                    },
                    PaperStock = new Apogee.PaperStockType()
                    {
                        Grade                = Apogee.GradeType.Item1,          // 1
                        GradeSpecified       = true,
                        StockName            = "Businesscards",
                        Weight               = "200",              // string
                        Thickness            = 0.2M,               // decimal
                        ThicknessSpecified   = true,
                        SheetWidth           = 707M,               // decimal
                        SheetWidthSpecified  = true,
                        SheetHeight          = 500M,               // decimal
                        SheetHeightSpecified = true
                    }
                };
                apoxml.Part[i] = part;
            }
            return(apoxml);
        }
 public static Apogee.ApoXML CreateBookletSpreadCoverBody()
 {
     Apogee.ApoXML apoxml = new Apogee.ApoXML()
     {
         AgentName         = "ApoXmlCsLib",
         AgentVersion      = "1.0.0",
         OrderNumber       = "ApoXML",
         JobName           = "Booklet - SpreadCover + Body " + Utils.Timestamp,
         Amount            = "2000",                               // string
         Comments          = "ApoXML multipart brochure SpreadCover 4/4; Body 1/1 16pp",
         DecimalSeparator  = Apogee.ApoXMLDecimalSeparator.Item1,  // Item=comma, Item1=point
         ThousandSeparator = Apogee.ApoXMLThousandSeparator.Item1, // Item=point Item1=comma
         ProductType       = "Brochure",
         Unit = Apogee.ApoXMLUnit.mm,
         //TicketTemplate = "myTicketTemplate",	// Name of job or hot ticket template.
         CustomerContact = new Apogee.BaseContactType()
         {
             Company = new Apogee.BaseCompanyType()
             {
                 JDFProductID  = "PID_Comp_DemoCompany_001",
                 Company       = "Demo Company",
                 Street        = "Demo Street 1",
                 ZIP           = "1234",
                 City          = "Demo City",
                 StateProvince = "Demo Province",
                 Country       = "Demo Country",
                 Phone         = "123456789",
                 PrintCenter   = "Demo Print Center"
             },
             Person = new Apogee.BasePersonType()
             {
                 JDFProductID = "PID_Pers_FirstLast_001",
                 Title        = "Mr.",
                 FirstName    = "ContactFirstName",
                 LastName     = "ContactLastName",
                 Prefix       = "123",
                 FixPhone     = "456789",
                 MobilePhone  = "987654",
                 Email        = "*****@*****.**"
             }
         },
         Binding = new Apogee.BindingType()
         {
             Method          = Apogee.MethodType.Nested,
             MethodSpecified = true
         },
         PartCover = new Apogee.PartCoverType()
         {
             PartType           = Apogee.PartTypeType.Cover,
             PartTypeSpecified  = true,
             PartName           = "Cover",
             Press              = "Small Press",
             WorkStyle          = Apogee.ImposeWorkStyleType.Duplex,
             CoverType          = Apogee.CoverTypeType.Spread,
             CoverTypeSpecified = true,
             OpenWidth          = 422M,
             OpenWidthSpecified = true,
             Comments           = "Cover remarks",
             Pages              = new Apogee.PagesType()
             {
                 URL        = $"file:///{Utils.AppFolderUrl}Samples/PDF/Cover_Spread_DS_425x297.pdf",
                 PageCount  = "2",                           // string
                 PageWidth  = 210M,
                 PageHeight = 297M
             },
             Color = new Apogee.ColorType()
             {
                 NrColors = "4"                          // string
             },
             PaperStock = new Apogee.PaperStockType()
             {
                 Grade                = Apogee.GradeType.Item1,          // 1
                 GradeSpecified       = true,
                 StockName            = "Cover_Heavy",
                 Weight               = "200",               // string
                 Thickness            = 0.24M,               // decimal
                 ThicknessSpecified   = true,
                 SheetWidth           = 707M,                // decimal
                 SheetWidthSpecified  = true,
                 SheetHeight          = 500M,                // decimal
                 SheetHeightSpecified = true
             }
         },
         Part = new Apogee.BasePartType[]
         {
             new Apogee.BasePartType()
             {
                 PartType  = Apogee.PartTypeType.Body,
                 PartName  = "Body",
                 Press     = "Large Press",
                 WorkStyle = Apogee.ImposeWorkStyleType.Duplex,
                 Comments  = "Body remark",
                 Pages     = new Apogee.PagesType()
                 {
                     URL        = $"file:///{Utils.AppFolderUrl}Samples/PDF/A4_16p_CMYK.pdf",
                     PageCount  = "16",                                  // string
                     PageWidth  = 210M,
                     PageHeight = 297M
                 },
                 Color = new Apogee.ColorType()
                 {
                     NrColors = "1"                              // string
                 },
                 PaperStock = new Apogee.PaperStockType()
                 {
                     Grade                = Apogee.GradeType.Item1,              // 1
                     GradeSpecified       = true,
                     StockName            = "Antalis Coated",
                     Weight               = "100",                    // string
                     Thickness            = 0.12M,                    // decimal
                     ThicknessSpecified   = true,
                     SheetWidth           = 1000M,                    // decimal
                     SheetWidthSpecified  = true,
                     SheetHeight          = 707M,                     // decimal
                     SheetHeightSpecified = true
                 }
             }
         }
     };
     return(apoxml);
 }
Пример #3
0
 /// <summary>
 ///		Demonstration how to use the ApoXmlCsLib to generate ApoXML / AsantiXML files.
 /// </summary>
 static void Main()
 {
     // Depending on the workflow, Apogee or Asanti, use one of the following constructors:
     Apogee.ApoXML apogeexml = new Apogee.ApoXML() /* initialization */ }