Novedades 2022

Novedades en Aspose.PDF 22.12

Desde esta versión, soporte para convertir PDF a imagen DICOM.


private static void PdfToDicom()
{
    // The path to the documents directory
    var dataDir = RunExamples.GetDataDir_AsposePdf_Images();

    // Open PDF document
    using (var document = new Aspose.Pdf.Document(dataDir + "PagesToImages.pdf"))
    {
        var dicom = new Aspose.Pdf.Devices.DicomDevice();
        FileStream outStream = new FileStream(dataDir + "PdfToDicom_out.dcm", FileMode.Create, FileAccess.ReadWrite);
        dicom.Process(document.Pages[1], outStream);
    }
}

Novedades en Aspose.PDF 22.09

Desde 22.09, soporte para agregar propiedades para modificar el orden de las rúbricas del sujeto (E=, CN=, O=, OU=) en la firma.


private static void SignPdfWithModifiedOrderOfSubjectRubrics(string pfxFilePath, string password)
{
    // The path to the documents directory
    var dataDir = RunExamples.GetDataDir_AsposePdf_SecuritySignatures();

    // Instantiate PdfFileSignature object
    using (var fileSign = new Aspose.Pdf.Facades.PdfFileSignature())
    {
        // Bind PDF document
        fileSign.BindPdf(dataDir + "DigitallySign.pdf");

        var rect = new System.Drawing.Rectangle(100, 100, 400, 100);
        var signature = new Aspose.Pdf.Forms.PKCS7Detached(pfxFilePath, password);

        // Set signature custom appearance
        signature.CustomAppearance = new Aspose.Pdf.Forms.SignatureCustomAppearance()
        {
            UseDigitalSubjectFormat = true,
            DigitalSubjectFormat = new Aspose.Pdf.Forms.SubjectNameElements[] { Aspose.Pdf.Forms.SubjectNameElements.CN, Aspose.Pdf.Forms.SubjectNameElements.O }
            //or
            //DigitalSubjectFormat = new Aspose.Pdf.Forms.SubjectNameElements[] { Aspose.Pdf.Forms.SubjectNameElements.OU, Aspose.Pdf.Forms.SubjectNameElements.S, Aspose.Pdf.Forms.SubjectNameElements.C }
        };

        // Sign PDF file
        fileSign.Sign(1, true, rect, signature);
        // Save PDF document
        fileSign.Save(dataDir + "SignPdfWithModifiedOrderOfSubjectRubrics_out.pdf");
    }
}

Novedades en Aspose.PDF 22.6

Desde 22.5, soporta la extracción de texto en SubScript y SuperScript de PDF.

Si el documento PDF contiene texto en SubScript y SuperScript como H2O, entonces la extracción del texto del PDF también debe extraer su información de formato (en el texto plano extraído). Si el PDF contiene texto en cursiva, también debe incluirse en el contenido extraído.


private static void ExtractTextSuperscript()
{
    // The path to the documents directory
    var dataDir = RunExamples.GetDataDir_AsposePdf_Text();

    // Open PDF document
    using (var document = new Aspose.Pdf.Document(dataDir + "TextWithSubscriptsSuperscripts.pdf"))
    {
        // Use TextFragmentAbsorber with no parameters to get all text
        var absorber = new Aspose.Pdf.Text.TextFragmentAbsorber();
        absorber.Visit(document.Pages[1]);

        // Iterate through text fragments to find superscript text
        foreach (var textFragment in absorber.TextFragments) 
        {
            if (textFragment.TextState.Superscript)
            {
                Console.WriteLine(String.Format("Text {0} at {1} is superscript!", textFragment.Text, textFragment.Position));
            }
        }
    }
}

Novedades en Aspose.PDF 22.4

Esta versión incluye información para Aspose.PDF for .NET:

  • PDF a ODS: Reconocer texto en subíndice y superíndice;

ejemplo


private static void ConvertPdfToOds()
{
    // The path to the documents directory
    var dataDir = RunExamples.GetDataDir_AsposePdf();

    // Open PDF document
    using (var document = new Aspose.Pdf.Document(dataDir + "input.pdf"))
    {
        // Instantiate ExcelSaveOptions object
        var saveOptions = new Aspose.Pdf.ExcelSaveOptions
        {
            // Specify the desired table file format
            Format = Aspose.Pdf.ExcelSaveOptions.ExcelFormat.ODS
        };

        // Save the file in ODS format
        document.Save(dataDir + "PDFToODS_out.ods", saveOptions);
    }
}
  • PDF a XMLSpreadSheet2003: Reconocer texto en subíndice y superíndice;

  • PDF a Excel: Reconocer texto en subíndice y superíndice;

  • Eliminar firmas UR al guardar el documento;

  • Eliminar la bandera de Sospechosos en MarkInfo al guardar el documento;

  • Eliminar información al guardar el documento.

Novedades en Aspose.PDF 22.3

Esta versión incluye las siguientes actualizaciones:

  • Soporte para AFRelationship;

  • Validación de encabezado PDF;

  • Eliminar subfiltro adbe.x509.rsa_sha1 al guardar el documento;

  • Formatear campo como Número y Formato de Fecha;

  • Prohibir el uso de cifrado RC4 en FDF 2.0.

Novedades en Aspose.PDF 22.2

Desde la versión 22.2 es posible firmar un documento utilizando PdfFileSignature con LTV, y con la capacidad de cambiar el hash de SHA1 a SHA256.


private static void SignPdfWithSha256(string pfxFilePath, string password)
{
    // The path to the documents directory
    var dataDir = RunExamples.GetDataDir_AsposePdf_SecuritySignatures();

    // Instantiate PdfFileSignature object
    using (var fileSign = new Aspose.Pdf.Facades.PdfFileSignature())
    {
        // Bind PDF document
        fileSign.BindPdf(dataDir + "DigitallySign.pdf");

        var rect = new System.Drawing.Rectangle(300, 100, 1, 1);
        var signature = new Aspose.Pdf.Forms.PKCS7(pfxFilePath, password)
        {
            UseLtv = true,
            TimestampSettings = new Aspose.Pdf.TimestampSettings("http://freetsa.org/tsr", string.Empty, Aspose.Pdf.DigestHashAlgorithm.Sha256)
        };

        // Sign PDF file
        fileSign.Sign(1, false, rect, signature);
        // Save PDF document
        fileSign.Save(dataDir + "SignPdfWithSha256_out.pdf");
    }
}

Novedades en Aspose.PDF 22.1

Ahora, Aspose.PDF for .NET soporta cargar documentos de uno de los formatos de documento más populares, el Formato de Documento Portátil (PDF) versión 2.0.