Example #1
0
        public void CheckForXMPMetadataUpdateStrings_PDFA1b()
        {
            InitializeTest(TestFile.TestpagePDFA1b);

            _pdfProcessor.ProcessPdf(_th.Job);

            XmpMetadataTester.CheckForXMPMetadataUpdateStrings(_th.Job);
        }
Example #2
0
        public void EncryptionSigningAndBackground()
        {
            GenerateGsJob_WithSettedOutput(TestFile.PDFCreatorTestpage_GS9_19_PDF); //Disables pdf metadata update
            _th.Job.Profile.PdfSettings.Security.Enabled  = true;
            _th.Job.Profile.PdfSettings.Signature.Enabled = true;
            _th.Job.Profile.BackgroundPage.Enabled        = true;

            _pdfProcessor.ProcessPdf(_th.Job);

            PdfVersionTester.CheckPDFVersion(_th.Job, _pdfProcessor);
            EncryptionTester.DoSecurityTest(_th.Job, IsIText);
            SigningTester.TestSignature(_th.Job);
            BackgroundPageTester.BackgroundOnPage(_th.Job);
        }
Example #3
0
        public void CheckIfFileExists_AllPdfPropertiesDisabled()
        {
            _th.GenerateGsJob_WithSetOutput(TestFile.PDFCreatorTestpage_GS9_19_PDF);
            _th.Job.Profile.OutputFormat = OutputFormat.Pdf;
            //UpdateXMPMetadata disabled if format is not PDF/A
            _th.Job.Profile.PdfSettings.Security.Enabled  = false;
            _th.Job.Profile.PdfSettings.Signature.Enabled = false;
            _th.Job.Profile.BackgroundPage.Enabled        = false;
            _th.Job.Passwords = new JobPasswords();

            _pdfProcessor.ProcessPdf(_th.Job);

            Assert.IsTrue(File.Exists(_th.Job.OutputFiles[0]), "Processed file does not exist.");
        }
Example #4
0
        private void TestEncryption()
        {
            _pdfProcessor.ProcessPdf(_th.Job);

            PdfVersionTester.CheckPDFVersion(_th.Job, _pdfProcessor);
            EncryptionTester.DoPasswordTest(_th.Job);
            EncryptionTester.DoSecurityTest(_th.Job, IsIText);
        }
Example #5
0
 private void Process(Job job)
 {
     if (!_processor.ProcessingRequired(job.Profile))
     {
         _logger.Debug("No pdf processing required.");
         return;
     }
     _processor.ProcessPdf(job);
 }
        private void Process(Job job)
        {
            if (!_processor.ProcessingRequired(job.Profile))
            {
                return;
            }

            _processor.ProcessPdf(job);
        }
Example #7
0
        public void CheckIfFileExistsAndTempFilesAreDeleted_AllPdfPropertiesDisabled()
        {
            _th.GenerateGsJob_WithSetOutput(TestFile.PDFCreatorTestpagePDF);
            _th.Job.Profile.OutputFormat = OutputFormat.Pdf;
            //UpdateXMPMetadata disabled if format is not PDF/A
            _th.Job.Profile.PdfSettings.Security.Enabled  = false;
            _th.Job.Profile.PdfSettings.Signature.Enabled = false;
            _th.Job.Profile.BackgroundPage.Enabled        = false;
            _th.Job.Passwords = new JobPasswords();

            _pdfProcessor.ProcessPdf(_th.Job);

            Assert.IsTrue(File.Exists(_th.Job.OutputFiles[0]), "Processed file does not exist.");
            var files = Directory.GetFiles(_th.TmpTestFolder);

            Assert.AreEqual(1, files.Where(x => x.EndsWith(".pdf", StringComparison.InvariantCultureIgnoreCase)).ToArray().Length,
                            "TmpTestFolder contains more PDF files than the processed one: "
                            + Environment.NewLine + files);
        }
        public void EncryptionAndBackground()
        {
            GenerateGsJob_WithSettedOutput(TestFile.PDFCreatorTestpagePDF); //Disables pdf metadata update
            _th.Job.Profile.PdfSettings.Security.Enabled  = true;
            _th.Job.Profile.PdfSettings.Signature.Enabled = false;
            _th.Job.Profile.BackgroundPage.Enabled        = true;

            _pdfProcessor.ProcessPdf(_th.Job);

            EncryptionTester.DoSecurityTest(_th.Job, IsIText);
            BackgroundPageTester.BackgroundOnPage(_th.Job);
        }
Example #9
0
        private void DoTestTimeServer(string timeserverUrl)
        {
            TestHelper.Job.Profile.OutputFormat = OutputFormat.Pdf;
            _timeServerAccount.Url = timeserverUrl;

            PdfProcessor.ProcessPdf(TestHelper.Job);

            SigningTester.TestSignature(TestHelper.Job);
            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PdfProcessor);
        }
Example #10
0
        public void SigningPdf_SecuredTimeServerEnabled_TimeserverDoesNotRequireLogin()
        {
            TestHelper.Job.Profile.OutputFormat = OutputFormat.Pdf;
            TestHelper.Job.Profile.PdfSettings.Signature.TimeServerUrl = "http://timestamp.globalsign.com/scripts/timestamp.dll";

            TestHelper.Job.Profile.PdfSettings.Signature.TimeServerIsSecured = true;
            TestHelper.Job.Profile.PdfSettings.Signature.TimeServerLoginName = "TimeServerLoginName";
            TestHelper.Job.Profile.PdfSettings.Signature.TimeServerPassword  = "******";

            PDFProcessor.ProcessPdf(TestHelper.Job);

            SigningTester.TestSignature(TestHelper.Job);
            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PDFProcessor);
        }
Example #11
0
        public void TimeServer_GlobalSign()
        {
            TestHelper.Job.Profile.OutputFormat = OutputFormat.Pdf;
            TimeServerAccount.Url = "http://timestamp.globalsign.com/scripts/timestamp.dll";

            TimeServerAccount.IsSecured = true;
            TimeServerAccount.UserName  = "******";
            TimeServerAccount.Password  = "******";

            PDFProcessor.ProcessPdf(TestHelper.Job);

            SigningTester.TestSignature(TestHelper.Job);
            PdfVersionTester.CheckPDFVersion(TestHelper.Job, PDFProcessor);
        }