Here at C2S, we have always struggled to find a consistent solution for document handling that can carefully and accurately convert documents like Word or Excel tp Tiff or PDF. We then came across the Aspose.Total for .NET. Having previously used PDF# and other open source libraries, we were more often than not left disappointed by the performance. Our clients require bullet proof processing and accuracy. During the development of our Santiago tool, we had a specific customer requirement that made us search and find a perfect solution. Santiago is a scheduler that monitors email accounts and downloads attachments that meet set rules. The attachments are then forwarded into a workflow. Santiago effectively feeds a digital mailroom or accounts payable solution. The customer in question received attachments from over 500 branches around London. The attachments are agendas and minutes of meetings and can be in any format but are usually typed in Word or Excel. We needed to forward these into our FileDirector solution, fully indexed into the correct queue but the customer asked to be able to annotate the documents – add text, arrows, highlights etc. This would only be possible if we converted the documents into Tiff. We have now built the Aspose.Total.Net library into Santiago with excellent results The File2Tiff module examines the extension of the file to be converted and selects the required conversion system: [code language="csharp"] fileType = Path.GetExtension(filePath).Replace(".", "").ToLower(); if (FileTypeExtensions.File2TiffDoc_Extensions.Contains(fileType)) { ... } else if (FileTypeExtensions.File2TiffXls_Extensions.Contains(fileType)) { ... } [/code] File2Tiff is then able to utilise the Aspose.Words and Aspose.Cells libraries to perform the conversion, making use of the Document and Workbook classes respectively, using only a few lines of code: [code language="csharp"] Aspose.Words Document doc = new Document(filePath); ... doc.Save(Path.Combine(OutputPath, outputFileName), options); Aspose.Cells Workbook book = new Workbook(filePath); Worksheet sheet; SheetRender sheetRender; Bitmap bitmap; ... for (int i = 0; i < book.Worksheets.Count; i++) { sheet = book.Worksheets[i]; sheetRender = new SheetRender(sheet, imgOptions); for (int j = 0; j < sheetRender.PageCount; j++) { bitmap = sheetRender.ToImage(j); if (bitmap != null) { bitmap.Save(Path.Combine(OutputPath, string.Format("{0}_{1} - Page {2}", outputFileName, i + 1, j + 1))); } } } [/code] A particularly useful feature of both libraries is the ability to specify image saving options. This allows us to provide the end user with the flexibility to specify the resolution at which they wish to save the document, selecting between saving in colour or greyscale and choosing particular pages of a document to convert: [code language="csharp"] Aspose.Words.Saving.ImageSaveOptions options = new Aspose.Words.Saving.ImageSaveOptions(Aspose.Words.SaveFormat.Tiff); options.PageIndex = UserSelectedFirstPage; options.PageCount = UserSelectedPageCount; options.Resolution = UserSelectedResolution; options.ColorMode = UserSelectedColourMode; [/code] Webdesign voor een online gokportaal door Fred Speler - Casino spellen wallpaper. - Online Casino Spellen

Share This: