Class PdfAConverter
Nom dels espais: Aspose.Pdf.Plugins Assemblea: Aspose.PDF.dll (25.4.0)
Representa un plugin per gestionar la conversió de documents PDF en un format PDF/A i per a la validació de la conformitat PDF/A.
public sealed class PdfAConverter : IPlugin
Inheritance
Implements
Membres heretats
object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
L’exemple mostra com validar el document PDF de conformitat amb el format PDF/A (PDF/A-1a en aquest cas):
// Create the options class to set up the validation process
var options = new PdfAValidateOptions
{
PdfAVersion = PdfAStandardVersion.PDF_A_1A
};
// Add one or more files to be validated
options.AddInput(new FileDataSource("path_to_your_first_pdf_file.pdf")); // replace with your actual file path
options.AddInput(new FileDataSource("path_to_your_second_pdf_file.pdf"));
// add more files as needed
// Create the plugin instance
var plugin = new PdfAConverter();
// Run the validation and get results
var resultContainer = plugin.Process(options);
// Check the resultContainer.ResultCollection property for validation results for each file:
for (var i = 0; i < resultContainer.ResultCollection.Count; i++)
{
var result = resultContainer.ResultCollection[i];
var validationResult = (PdfAValidationResult) result.Data;
var isValid = validationResult.IsValid; // Validation result for the i-th document
}
L’exemple mostra com convertir el document PDF en un format PDF/A (PDF/A-3b en aquest cas):
// Create the options class to set up the conversion process
var options = new PdfAConvertOptions
{
PdfAVersion = PdfAStandardVersion.PDF_A_3B
};
// Add the source file
options.AddInput(new FileDataSource("path_to_your_pdf_file.pdf")); // replace with your actual file path
// Add the path to save the converted file
options.AddOutput(new FileDataSource("path_to_the_converted_file.pdf"));
// Create the plugin instance
var plugin = new PdfAConverter();
// Run the conversion
plugin.Process(options);
Constructors
Pdfaconverter()
public PdfAConverter()
Methods
Process(Opcions IPlugin)
Comença un procés de conversió o validació de PDF/A amb les opcions donades.
public ResultContainer Process(IPluginOptions options)
Parameters
options
IPluginOptions
Un objecte d’opcions que conté instruccions per al plugin. ha de ser un exemple de l’Aspose.Pdf.Plugins.PdfAConvertOptionso la classe Aspose.Pdf.Plugins.PdfAValidateOptions.
Returns
Un objecte Aspose.Pdf.Plugins.ResultContainer que conté el resultat del tractament.