Exemplo n.º 1
0
        protected override void InternalExecute(object data)
        {
            VerifyPdfAData verifyData = data as VerifyPdfAData;
            verifyData.Mode = Type.ValidationMode.Unknown;
            verifyData.Compliant = false;
            verifyData.Exception = null;

            try
            {
                License.Import(LicenseCode);

                using (SolidFramework.Converters.PdfToPdfAConverter converter = new SolidFramework.Converters.PdfToPdfAConverter())
                {
                    converter.ValidationMode = SolidFramework.Plumbing.ValidationMode.Detect;
                    converter.AddSourceFile(verifyData.Source);
                    converter.ValidateOnly = true;
                    converter.Convert();
                    SolidFramework.Converters.Plumbing.PdfAConversionResult result = converter.Results[0] as SolidFramework.Converters.Plumbing.PdfAConversionResult;
                    if (result != null)
                    {
                        verifyData.Mode = Translate(result.PdfType);
                        verifyData.Compliant = Translate(result.PdfAStatus);
                    }
                }
            }
            catch (Exception ex)
            {
                verifyData.Exception = ex;
            }
        }
Exemplo n.º 2
0
 ConversionStatus InternalExecute(string source, string target, SolidFramework.Plumbing.ValidationMode mode, bool overRide = true)
 { 
     License.Import(LicenseCode);
     using (SolidFramework.Converters.PdfToPdfAConverter converter = new SolidFramework.Converters.PdfToPdfAConverter())
     {
         converter.ValidationMode = mode;
         converter.AddSourceFile(source);
         return converter.ConvertTo(target, overRide);
     }
 }