public static byte[][] SplitDocumentToPage(byte[] fileContent, string fileName) { string fileext = Path.GetExtension(fileName).ToLower(); switch (fileext) { case ".pdf": return(PdfProcessing.SplitImageFile(fileContent)); break; case ".jpg": case ".jpeg": case ".bmp": case ".gif": case ".png": return(new byte[][] { fileContent }); break; case ".tif": case ".tiff": return(ImageProcessing.SplitImageFile(fileContent)); break; } return(new byte[][] { fileContent }); }
public static byte[][] SplitDocumentToPage(byte[] fileContent, string fileName) { string fileExt = Path.GetExtension(fileName); if (string.IsNullOrEmpty(fileExt)) { throw new ArgumentException(" fileName invalidate."); } switch (fileExt.ToLower()) { case ".pdf": return(PdfProcessing.SplitImageFile(fileContent)); case ".jpg": case ".jpeg": case ".bmp": case ".gif": case ".png": return(new byte[][] { fileContent }); case ".tif": case ".tiff": return(ImageProcessing.SplitImageFile(fileContent)); } return(new byte[][] { fileContent }); }
public static int GetDocumentPageCount(byte[] fileContent, string fileName) { string fileext = Path.GetExtension(fileName).ToLower(); switch (fileext) { case ".pdf": return(PdfProcessing.CalculatePageSize(fileContent)); break; case ".jpg": case ".jpeg": case ".bmp": case ".gif": case ".png": return(1); break; case ".tif": case ".tiff": return(ImageProcessing.GetTifPageCountByFile(fileContent)); break; } return(1); }
public static int GetDocumentPageCount(byte[] fileContent, string fileName) { string fileExt = Path.GetExtension(fileName); if (string.IsNullOrEmpty(fileExt)) { throw new ArgumentException(" fileName invalidate."); } switch (fileExt.ToLower()) { case ".pdf": return(PdfProcessing.CalculatePageSize(fileContent)); case ".jpg": case ".jpeg": case ".bmp": case ".gif": case ".png": return(1); case ".tif": case ".tiff": return(ImageProcessing.GetTifPageCountByFile(fileContent)); } return(1); }