コード例 #1
0
 public ReportProperties(string templateFolderPath, PageNumberSettings pageNumberSettings, string outputDirectory, Orientation reportOrientation)
 {
     this.TemplateFolderPath = templateFolderPath;
     this.PageNumberSettings = pageNumberSettings;
     this.OutputDirectory    = outputDirectory;
     this.ReportOrientation  = reportOrientation;
 }
コード例 #2
0
        public static void Run()
        {
            string inputfile = "doc-sample.doc";

            // Upload input file from local directory to Cloud Storage
            Common.UploadFile(inputfile, string.Empty);

            // Insert Page Number Field into the Document
            PageNumberSettings pageNumberSettings = new PageNumberSettings("{PAGE} of {NUMPAGES}", "right", true, true);

            Common.WordsService.InsertDocumentPageNumbers(inputfile, Common.GetOutputFilePath(inputfile, true), Common.FOLDER, pageNumberSettings);

            string dataDir = Common.DownloadFile(inputfile, string.Empty);

            Console.WriteLine("\nPage number inserted successfully.\nFile saved at " + dataDir);
        }
コード例 #3
0
        public void Words_Tests()
        {
            try
            {
                storageService.File.CopyFile(Utils.CloudStorage_Input_Folder + "/doc-sample.doc", Utils.CloudStorage_Output_Folder + "/doc-sample.doc");

                WordDocumentResponse wordDocumentResponse = wordsService.ReadDocumentCommonInfo("doc-sample.doc", Utils.CloudStorage_Output_Folder);
                wordsService.ConvertDocument("doc-sample.doc", WordOutputFormat.Pdf, Utils.CloudStorage_Output_Folder, Utils.CloudStorage_Output_Folder + "/doc-out-pdf.pdf");
                wordsService.ConvertDocument("doc-sample.doc", WordOutputFormat.Pdf, Utils.CloudStorage_Output_Folder, Utils.Local_Output_Path + "\\doc-out-pdf.pdf");
                wordsService.ConvertDocument("doc-sample.doc", WordOutputFormat.Html, Utils.CloudStorage_Output_Folder, Utils.Local_Output_Path + "\\doc-out-html.html");
                wordsService.ConvertDocument(WordOutputFormat.Tiff, Utils.CloudStorage_Output_Folder + "/doc-out-tiff.tiff", Utils.Local_Input_Path + "doc-sample.doc");

                PageNumberSettings pageNumberSettings = new PageNumberSettings("{PAGE} of {NUMPAGES}", "right", true, true);
                wordsService.InsertDocumentPageNumbers("doc-sample.doc", string.Empty, Utils.CloudStorage_Output_Folder, pageNumberSettings);

                wordsService.InsertDocumentWatermarkImage("doc-sample.doc", string.Empty, 45.0, Utils.CloudStorage_Input_Folder + "/signature.jpg", Utils.CloudStorage_Output_Folder);
                wordsService.InsertDocumentWatermarkImage("doc-sample.doc", string.Empty, 135.0, Utils.Local_Input_Path + "signature.jpg", Utils.CloudStorage_Output_Folder);
                wordsService.InsertDocumentWatermarkText("doc-sample.doc", "Watermarked by Aspose", 45.0, string.Empty, Utils.CloudStorage_Output_Folder);



                //                string jSon = @"<?xml version=\""1.0\"" encoding=\""utf-8\""?>
                //                            <Orders>
                //                              <Order>
                //                                <Number>23</Number>
                //                                <Address>Nelson Street</Address>
                //                                <Suburb>Howick</Suburb>
                //                                <City>Auckland</City>
                //                                <Phonenumber>543 1234</Phonenumber>
                //                                <Date>03/01/2010</Date>
                //                                <Total>14.00</Total>
                //                                <Item>
                //                                  <Name>BBQ Chicken Pizza</Name>
                //                                  <Price>6.00</Price>
                //                                  <Quantity>1</Quantity>
                //                                  <ItemTotal>6.00</ItemTotal>
                //                                </Item>
                //                                <Item>
                //                                  <Name>1.5 Litre Coke</Name>
                //                                  <Price>4.00</Price>
                //                                  <Quantity>2</Quantity>
                //                                  <ItemTotal>8.00</ItemTotal>
                //                                </Item>
                //                              </Order>
                //                              <Order>
                //                                <Number>10</Number>
                //                                <Address>Parkville Avenue</Address>
                //                                <Suburb>Pakuranga</Suburb>
                //                                <City>Auckland</City>
                //                                <Phonenumber>548 7342</Phonenumber>
                //                                <Date>05/03/2010</Date>
                //                                <Total>6.00</Total>
                //                                <Item>
                //                                  <Name>Hawaiian Pizza</Name>
                //                                  <Price>4.00</Price>
                //                                  <Quantity>1</Quantity>
                //                                  <ItemTotal>4.00</ItemTotal>
                //                                </Item>
                //                                <Item>
                //                                  <Name>Fries</Name>
                //                                  <Price>1.00</Price>
                //                                  <Quantity>2</Quantity>
                //                                  <ItemTotal>2.00</ItemTotal>
                //                                </Item>
                //                              </Order>
                //                            </Orders>";

                //wordsService.PopulateDocumentTemplateWithData("doc-sample2.doc", WordCleanupOptions.ContainingFields, string.Empty, Utils.CloudStorage_Output_Folder, jSon);


                WordDocumentEntryRequest wordDocumentEntryRequest = new WordDocumentEntryRequest();
                wordDocumentEntryRequest.DocumentEntries.Add(new WordDocumentEntry(Utils.CloudStorage_Input_Folder + "/doc-sample.doc", WordImportFormatMode.KeepSourceFormatting));
                wordDocumentEntryRequest.DocumentEntries.Add(new WordDocumentEntry(Utils.CloudStorage_Input_Folder + "/doc-sample.doc", WordImportFormatMode.KeepSourceFormatting));
                wordsService.SplitDocument("doc-sample.doc", SplitDocumentFormat.Jpeg, 1, 2, Utils.CloudStorage_Output_Folder);
                WordsDocumentResponse wordsDocumentResponse = wordsService.AppendDocumentsToOriginalDocument("doc-sample.doc", wordDocumentEntryRequest, string.Empty, Utils.CloudStorage_Output_Folder);

                WordsSplitResultResponse wordsSplitResultResponse = wordsService.SplitDocument("doc-sample.doc", SplitDocumentFormat.Jpeg, 1, 2, Utils.CloudStorage_Output_Folder);

                // Please check http://www.aspose.com/docs/display/wordscloud/loadWebDocument+%28Controller+resource%29 for details
                //string requestData = @"<?xml version=""\1.0""\ encoding=""\utf-16""\?>
                //                    <LoadWebDocumentData xmlns:xsd=""\http://www.w3.org/2001/XMLSchema""\ xmlns:xsi=""\http://www.w3.org/2001/XMLSchema-instance""\>
                //                        <LoadingDocumentUrl>http://www.aspose.com</LoadingDocumentUrl>
                //                        <DocSaveOptionsData>
                //                        <SaveFormat>doc</SaveFormat>
                //                        <FileName>google.doc</FileName>
                //                        <SaveRoutingSlip>true</SaveRoutingSlip>
                //                        </DocSaveOptionsData>
                //                    </LoadWebDocumentData>";

                //WordsSaveResultResponse wordsSaveResultResponse = wordsService.LoadNewDocumentFromWebIntoFile(requestData);
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }