Beispiel #1
0
        public static void Init(TestContext context)
        {
            var gs = PdfProcessorHelper.SetupGhostScriptFromEmbeddedResources(Directory.GetCurrentDirectory());

            target = new PdfProcessorHelper(new PdfProcessorSettings()
            {
                SearchForGhosts    = false, GhostScriptDllPath = gs.GhostScriptDllPath,
                GhostScriptVersion = gs.GhostScriptVersion
            });
        }
Beispiel #2
0
        static async Task Main()
        {
            var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory());

            builder.SetupAppSettingsAndLogging();
            var config = builder.Build();
            var logger = config.SetupSerilog();

            string inPdfPath = $"{Directory.GetCurrentDirectory()}\\BlackRectanglesWithSomeText.pdf";

            var workingDir = Directory.CreateDirectory("output");

            var converterSettings = new ConverterSettings
            {
                Pdf2SwfExecutableFilePath = ConverterHelper.SetupPdf2SwfNativeExeFromEmbeddedResources()
            };

            var gs = PdfProcessorHelper.SetupGhostScriptFromEmbeddedResources();

            var pdfProcesserSettings = new PdfProcessorSettings
            {
                SearchForGhosts    = false,
                GhostScriptDllPath = gs.GhostScriptDllPath,
                GhostScriptVersion = gs.GhostScriptVersion
            };

            var converter = new Converter(converterSettings, new PdfProcessorHelper(pdfProcesserSettings), logger);

            var status = await converter.ConvertPdf2Swf(inPdfPath, new ConversionOptions
            {
                HowToConvert          = ConversionPath.Both,
                OutputDirectory       = workingDir.FullName,
                OverwriteExistingSwfs = true
            });

            logger.LogWarning($"Result is {status.State}");

            System.Console.ReadKey();
        }
Beispiel #3
0
 public Pdf2SwfConverter(ILogger logger, PdfProcessorHelper pdfProcessor, ApplicationSettingsProvider settings)
 {
     _logger       = logger;
     _pdfProcessor = pdfProcessor;
     _settings     = settings;
 }
Beispiel #4
0
 public Converter(ConverterSettings settings, PdfProcessorHelper pdfProcessor, ILogger logger)
 {
     _settings     = settings;
     _pdfProcessor = pdfProcessor;
     _logger       = logger;
 }