示例#1
0
        public bool ConvertPDF2PNG(string inConvertFilePath,
                                   string inNewFileTargetFolderPath,
                                   double inResolutionX,
                                   double inResolutionY,
                                   double inGraphicsAlphaBitsValue,
                                   double inTextAlphaBitsValue)
        {
            //          logger.Info("inConvertFilePath = " + inConvertFilePath + ", inNewFileTargetFolderPath = " + inNewFileTargetFolderPath +
            //                      ", inResolutionX = " + inResolutionX + ", inResolutionY = " + inResolutionY + ", inGraphicsAlphaBitsValue = " + inGraphicsAlphaBitsValue +
            //                      ", inTextAlphaBitsValue = " + inTextAlphaBitsValue + ");

            bool conversionSucceed;

            CheckBaseParamsValidation(inResolutionX, inResolutionY, inGraphicsAlphaBitsValue, inTextAlphaBitsValue);

            // Make the conversion.
            FileConverter fileConvertor = InstancesManager.GetObject(InstancesManager.ConversionType.PDF2PNG);

            conversionSucceed = fileConvertor.ConvertPDF2PNG(inConvertFilePath, inNewFileTargetFolderPath, inResolutionX, inResolutionY, inGraphicsAlphaBitsValue, inTextAlphaBitsValue);
            InstancesManager.PutObject(InstancesManager.ConversionType.PDF2PNG, fileConvertor);

            // Rename PNG names to the correct page counter.
            RenameImagesNames(inNewFileTargetFolderPath, inConvertFilePath, "png");


            return(conversionSucceed);
        }
示例#2
0
        public bool ConvertPDFFolder2EPS(string inConvertFolderPath,
                                         string inTargetFolderPath,
                                         string inConvertFileWildCard,
                                         bool inDeleteSourcePDF,
                                         bool inSearchSubFolders,
                                         double inFirstPageToConvert,
                                         double inLastPageToConvert)
        {
            //          logger.Info("inConvertFolderPath = " + inConvertFolderPath + ", inTargetFolderPath = " + inTargetFolderPath +
            //                      ", inConvertFileWildCard = " + inConvertFileWildCard + ", inDeleteSourcePDF = " + inDeleteSourcePDF + ", inSearchSubFolders = " + inSearchSubFolders +
            //                      ", inFirstPageToConvert = " + inFirstPageToConvert + ", inLastPageToConvert = " + inLastPageToConvert);

            bool conversionSucceed;

            System.IO.DirectoryInfo root = new System.IO.DirectoryInfo(inConvertFolderPath);

            // Convert all files in folder.
            FileConverter fileConvertor = InstancesManager.GetObject(InstancesManager.ConversionType.PDF2EPS);

            conversionSucceed = WalkDirectoryTreePDF2EPS(fileConvertor, root, inTargetFolderPath, inConvertFileWildCard, inDeleteSourcePDF, inSearchSubFolders,
                                                         inConvertFolderPath.Equals(inTargetFolderPath), inFirstPageToConvert, inLastPageToConvert);
            InstancesManager.PutObject(InstancesManager.ConversionType.PDF2EPS, fileConvertor);

            return(conversionSucceed);
        }
示例#3
0
        public bool ConvertPDFFolder2PNG(string inConvertFolderPath,
                                         string inTargetFolderPath,
                                         string inConvertFileWildCard,
                                         bool inDeleteSourcePDF,
                                         bool inSearchSubFolders,
                                         double inResolutionX,
                                         double inResolutionY,
                                         double inGraphicsAlphaBitsValue,
                                         double inTextAlphaBitsValue)
        {
            //          logger.Info("inConvertFolderPath = " + inConvertFolderPath + ", inTargetFolderPath = " + inTargetFolderPath +
            //                      ", inConvertFileWildCard = " + inConvertFileWildCard + ", inDeleteSourcePDF = " + inDeleteSourcePDF + ", inSearchSubFolders = " + inSearchSubFolders +
            //                      ", inResolutionX = " + inResolutionX + ", inResolutionY = " + inResolutionY + ", inGraphicsAlphaBitsValue = " + inGraphicsAlphaBitsValue +
            //                       ", inTextAlphaBitsValue = " + inTextAlphaBitsValue);

            bool conversionSucceed;

            CheckBaseParamsValidation(inResolutionX, inResolutionY, inGraphicsAlphaBitsValue, inTextAlphaBitsValue);

            System.IO.DirectoryInfo root = new System.IO.DirectoryInfo(inConvertFolderPath);

            // Convert all files in folder.
            FileConverter fileConvertor = InstancesManager.GetObject(InstancesManager.ConversionType.PDF2PNG);

            conversionSucceed = WalkDirectoryTreePDF2PNG(fileConvertor, root, inTargetFolderPath, inConvertFileWildCard, inDeleteSourcePDF, inSearchSubFolders, inConvertFolderPath.Equals(inTargetFolderPath), inResolutionX, inResolutionY, inGraphicsAlphaBitsValue, inTextAlphaBitsValue);
            InstancesManager.PutObject(InstancesManager.ConversionType.PDF2PNG, fileConvertor);

            return(conversionSucceed);
        }
示例#4
0
        public bool ConvertPDF2LowResPDF(string inConvertFilePath, string inNewFileTargetPath)
        {
            //          logger.Info("inConvertFilePath = " + inConvertFilePath + ", inNewFileTargetPath = " + inNewFileTargetPath);

            bool conversionSucceed;

            // Make the conversion.
            FileConverter fileConvertor = InstancesManager.GetObject(InstancesManager.ConversionType.PDF2LowResPDF);

            conversionSucceed = fileConvertor.ConvertPDF2LowResPDF(inConvertFilePath, inNewFileTargetPath);
            InstancesManager.PutObject(InstancesManager.ConversionType.PDF2LowResPDF, fileConvertor);

            return(conversionSucceed);
        }
示例#5
0
        public bool ConvertPDF2EPS(string inConvertFilePath, string inNewFileTargetPath, double inFirstPageToConvert, double inLastPageToConvert)
        {
            //          logger.Info("inConvertFilePath = " + inConvertFilePath + ", inNewFileTargetPath = " + inNewFileTargetPath +
            //                      ", inFirstPageToConvert = " + inFirstPageToConvert + ", inLastPageToConvert = " + inLastPageToConvert);

            bool conversionSucceed;

            // Make the conversion.
            FileConverter fileConvertor = InstancesManager.GetObject(InstancesManager.ConversionType.PDF2EPS);

            conversionSucceed = fileConvertor.ConvertPDF2EPS(inConvertFilePath, inNewFileTargetPath, inFirstPageToConvert, inLastPageToConvert);
            InstancesManager.PutObject(InstancesManager.ConversionType.PDF2EPS, fileConvertor);

            return(conversionSucceed);
        }