We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PDF/A-2u- PDF/A-3u compliance needed

Hello,
Aspose.Pdf.PdfFormat enum doesn’t contain values for PDF/A-2u and PDF/A-3u compatibility levels. Support for these levels is necessary for our processing. We would like to request this feature in Aspose. Can you add the feature?

Petr Behensky

Hi Petr,


Thanks for contacting support.

I am afraid the requested features are currently not supported. However for the sake of implementation, I have logged them in our issue tracking system.

  • PDFNET-41491 - PDF to PDF/A-2u - Support this conversion format
  • PDFNET-41492 - PDF to PDF/A-3u - Support this conversion format

We will further look into the details of these requirements and will keep you updated on the status of correction.Please be patient and spare us little time. We are sorry for this inconvenience.

Hi,


I wanted to check whether there is any update on this issue.

Thanks!

Hi Petr,


Thanks for your patience.

I am afraid the earlier reported issues are still pending for review and are not yet resolved. However the product team will surely consider investigating/fixing them as per development schedule and as soon as we have some definite updates regarding their resolution, we will let you know. Please be patient and spare us little time. We are sorry for this delay and inconvenience.

hi,
is there any update on this issue?

we’re using aspose total for .net convert to pdf and noted pdf/a-2u is not available in the compliance options.

if its currently not available, is it in aspose roadmap to include this?

kindly advise, thanks.

Hi Chinnam,


Thanks for your interest in Aspose. I am afraid the requested feature(PDFNET-41491) is still not implemented, it is pending for investigation in the queue. As soon as the issue investigation is completed then we will be in a good position to share an ETA/plan. We will notify you as soon as some update is available.

Thanks for your patience and cooperation.

Best Regards,

Hi,


is there still no plan for the PDF/A-2U support?

Hi Benjamin,


Thanks for your inquriy. I am afraid support of PDF/A-2U standard is still not implemented. However we have raised the issue priority of related ticket(PDFNET-41491) and requested our team to complete issue investigation and share an ETA/solution at their earliest. We will keep you updated about the issue resolution progress.

We are sorry for the inconvenience.

Best Regards,

Hi Petr,


Thanks for your patience.

Please try using following code snippet to convert PDF file to PDF/A_3U format.

[C#]

PdfFormat format = PdfFormat.PDF_A_3U;<o:p></o:p>

string inFile = "c:/pdftest/XML_input.pdf";

string outFile = "c:/pdftest/XML_input_A_3u.pdf";

string outLog = "c:/pdftest/ConversionLog.xml";

Document doc = new Document(inFile);

PdfFormatConversionOptions opts = new PdfFormatConversionOptions(outLog, format, ConvertErrorAction.Delete);

doc.Convert(opts);

doc.Save(outFile);

Hi Benjamin,


Thanks for your patience.

We are pleased to share that the feature requested earlier to convert PDF file to PDF/A_2U has been implemented and it will become part of upcoming release of Aspose.Pdf for .NET 17.3.0. Once the new version becomes available, please try using following code snippet.

[C#]

string inFile = “input.pdf”;<o:p></o:p>

string outFile = "output.pdf";

// load input PDF file

Document doc = new Document(inFile);

// convert file to PDF/A_2U format

doc.Convert(new MemoryStream(), PdfFormat.PDF_A_2U, ConvertErrorAction.Delete);

// save resultant document

doc.Save(outFile);

Hi.


would like to check is there any rough estimation when the new dll will be released?

currently my code is doing the convert to PDF/A-1B… below are the code used for conversion

Aspose Word
// setting pdf option to pdf/a
Aspose.Words.Saving.PdfSaveOptions options = new Aspose.Words.Saving.PdfSaveOptions();
options.Compliance = Aspose.Words.Saving.PdfCompliance.PdfA1b;
doc.Save(filename_saved, options);

Aspose Cells
Aspose.Cells.PdfSaveOptions pdfSaveOptions = new Aspose.Cells.PdfSaveOptions();
pdfSaveOptions.OnePagePerSheet = true;
pdfSaveOptions.Compliance = Aspose.Cells.Rendering.PdfCompliance.PdfA1b;

//Save the document in PDF format
workbook.Save(filename_saved, pdfSaveOptions);

Aspose Slides
//Instantiate the PdfOptions class
Aspose.Slides.Export.PdfOptions opts = new Aspose.Slides.Export.PdfOptions();
opts.Compliance = Aspose.Slides.Export.PdfCompliance.PdfA1b;
opts.EmbedFullFonts = true;
//Save the presentation to PDF with default options
pres.Save(filename_saved, Aspose.Slides.Export.SaveFormat.Pdf, opts);

Aspose PDF
Aspose.Pdf.Document doc = new Aspose.Pdf.Document();

//if the file is HTML change the load function
if (isHTML)
{
doc = null;
HtmlLoadOptions htmloptions = new HtmlLoadOptions(basePath);
htmloptions.PageInfo.Margin.Bottom = 10;
htmloptions.PageInfo.Margin.Top = 20;
htmloptions.PageInfo.Width = 1500f;
doc = new Aspose.Pdf.Document(path_to_file, htmloptions);
}
else
{
doc = new Aspose.Pdf.Document(path_to_file);

}
Stream logStream = new MemoryStream();
doc.Convert(logStream, PdfFormat.PDF_A_1B, ConvertErrorAction.Delete);
doc.OptimizeResources(new Aspose.Pdf.Document.OptimizationOptions()
{
RemoveUnusedObjects = true,
RemoveUnusedStreams = true,
AllowReusePageContent = true,
CompressImages = true
});
// Save HTML file
doc.Save(filename_saved);


am i right to say, after downloading the new dll i only need to change PDF_A_1B to PDF_A_2U?

the new code would be like this?

Aspose Word
// setting pdf option to pdf/a
Aspose.Words.Saving.PdfSaveOptions options = new Aspose.Words.Saving.PdfSaveOptions();
options.Compliance = Aspose.Words.Saving.PdfCompliance.PdfA2U;
doc.Save(filename_saved, options);

Aspose Cells
Aspose.Cells.PdfSaveOptions pdfSaveOptions = new Aspose.Cells.PdfSaveOptions();
pdfSaveOptions.OnePagePerSheet = true;
pdfSaveOptions.Compliance = Aspose.Cells.Rendering.PdfCompliance.PdfA2U;

//Save the document in PDF format
workbook.Save(filename_saved, pdfSaveOptions);

Aspose Slides
//Instantiate the PdfOptions class
Aspose.Slides.Export.PdfOptions opts = new Aspose.Slides.Export.PdfOptions();
opts.Compliance = Aspose.Slides.Export.PdfCompliance.PdfA2U;
opts.EmbedFullFonts = true;
//Save the presentation to PDF with default options
pres.Save(filename_saved, Aspose.Slides.Export.SaveFormat.Pdf, opts);

Aspose PDF
Aspose.Pdf.Document doc = new Aspose.Pdf.Document();

//if the file is HTML change the load function
if (isHTML)
{
doc = null;
HtmlLoadOptions htmloptions = new HtmlLoadOptions(basePath);
htmloptions.PageInfo.Margin.Bottom = 10;
htmloptions.PageInfo.Margin.Top = 20;
htmloptions.PageInfo.Width = 1500f;
doc = new Aspose.Pdf.Document(path_to_file, htmloptions);
}
else
{
doc = new Aspose.Pdf.Document(path_to_file);

}
Stream logStream = new MemoryStream();
doc.Convert(logStream, PdfFormat.PDF_A_2U, ConvertErrorAction.Delete);
doc.OptimizeResources(new Aspose.Pdf.Document.OptimizationOptions()
{
RemoveUnusedObjects = true,
RemoveUnusedStreams = true,
AllowReusePageContent = true,
CompressImages = true
});
// Save HTML file
doc.Save(filename_saved);


Hi Benjamin,


We plan to release the new version within few days and as soon as we have some definite updates, we will let you know.

Hi… thanks for the response. just to confirm the updates will include PDF/A-2U on all aspose products?


i.e Aspose Words, Cells and Slides too?

as the sample code seems to be Aspose.PDF. i would like to confirm if the updates will be done for Words, Cells and Slides too?

The issues you have found earlier (filed as PDFNET-41491) have been fixed in Aspose.Pdf for .NET 17.3.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
bczm8703:
Hi.. thanks for the response. just to confirm the updates will include PDF/A-2U on all aspose products?

i.e Aspose Words, Cells and Slides too?

as the sample code seems to be Aspose.PDF. i would like to confirm if the updates will be done for Words, Cells and Slides too?
Hi Benjamin,

The update only includes support of feature in Aspose.Pdf for .NET and it was not logged for other API's. However you may consider convert PDF files from Words, Cells, Slides etc and then perform PDF to PDF/A_2U and PDF/A_3U.

hi i tried to convert excel Stream into pdf stream then using this pdf convert to the PDF/A-2U stream. i got the error of root element not found.


result = Excel.convert(license_file, input_stream);

internal static Stream convert(string license_file, Stream excel_stream)
{
MemoryStream out_stream = new MemoryStream();
Aspose.Cells.License license = new Aspose.Cells.License();

//Pass the full path to the license file or the name of the license file embedded in the assembly
license.SetLicense(license_file);

//Instantiate the Workbook object
//Open an Excel file

Workbook workbook = new Workbook(excel_stream);

if (!workbook.IsLicensed)
{
throw new InvalidLicenseException(“invalid license file provided”);
}
//Implement one page per worksheet option
Aspose.Cells.PdfSaveOptions pdfSaveOptions = new Aspose.Cells.PdfSaveOptions();
pdfSaveOptions.OnePagePerSheet = true;
pdfSaveOptions.Compliance = Aspose.Cells.Rendering.PdfCompliance.PdfA1b;

//Save the document in PDF format
workbook.Save(out_stream, pdfSaveOptions);

out_stream.Position = 0;
Stream converted_stream = new MemoryStream();
converted_stream.Position = 0;
return converted_stream;

}

Stream finalResult = new MemoryStream();
finalResult = Misc.convertPDF2U(license_file, result);

internal static Stream convertPDF2U(Stream license_file, Stream input_stream)
{

MemoryStream output = new MemoryStream();

Aspose.Pdf.License pdflicense = new Aspose.Pdf.License();
pdflicense.SetLicense(license_file);
pdflicense.Embedded = true;

if (!Aspose.Pdf.Document.IsLicensed)
{
throw new InvalidLicenseException(“invalid license file provided”);
}

Aspose.Pdf.Document doc = new Aspose.Pdf.Document();

doc = new Aspose.Pdf.Document(input_stream);

Stream logStream = new MemoryStream();
doc.Convert(logStream, PdfFormat.PDF_A_2U, ConvertErrorAction.Delete);
// Save HTML file
doc.Save(output);

output.Position = 0;
logStream.Dispose();
logStream.Close();
return output;
}

it seems that the exception is due to the license file stream. the exception is thrown at function convertPDF2U. it is using the same variable as convert function. how did this error only happen till function convertPDF2U

Hi Benjamin,


Thanks for sharing the details.

I have tested the scenario and observed that in convert method, in last few lines, you instantiated a new Stream object and returned it from method rather than returning the out_stream which contained the Excel to PDF conversion. I have slightly modified the code and I am unable to notice any issue. As per my observations, the Excel file is properly being converted to PDF format.

[C#]

Stream result= convert(@“C:\Aspose.Total.lic”, new
FileStream(“c:/pdftest/input.xlsx”, FileMode.Open));

Stream finalResult = new MemoryStream();

finalResult = convertPDF2U(new FileStream(@"C:\Aspose.Total.lic", FileMode.Open), result);

MessageBox.Show("Conversion Time = " + (DateTime.Now - previous).TotalSeconds);

}

internal static Stream convert(string license_file, Stream excel_stream)

{

MemoryStream out_stream = new MemoryStream();

Aspose.Cells.License license = new Aspose.Cells.License();

//Pass the full path to the license file or the name of the license file embedded in the assembly

license.SetLicense(license_file);

//Instantiate the Workbook object

//Open an Excel file

Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook(excel_stream);

if (!workbook.IsLicensed)

{

//throw new InvalidLicenseException("invalid license file provided");

}

//Implement one page per worksheet option

Aspose.Cells.PdfSaveOptions pdfSaveOptions = new Aspose.Cells.PdfSaveOptions();

pdfSaveOptions.OnePagePerSheet = true;

pdfSaveOptions.Compliance = Aspose.Cells.Rendering.PdfCompliance.PdfA1b;

//Save the document in PDF format

workbook.Save(out_stream, pdfSaveOptions);

out_stream.Position = 0;

Stream converted_stream = new MemoryStream();

converted_stream.Position = 0;

return out_stream;

}


internal static Stream convertPDF2U(Stream license_file, Stream input_stream)

{

MemoryStream output = new MemoryStream();

Aspose.Pdf.License pdflicense = new Aspose.Pdf.License();

pdflicense.SetLicense(license_file);

pdflicense.Embedded = true;

if (!Aspose.Pdf.Document.IsLicensed)

{

// throw new InvalidLicenseException("invalid license file provided");

}

Aspose.Pdf.Document doc = new Aspose.Pdf.Document();

doc = new Aspose.Pdf.Document(input_stream);

Stream logStream = new MemoryStream();

doc.Convert(logStream, PdfFormat.PDF_A_2U, ConvertErrorAction.Delete);

// Save HTML file

doc.Save("c:/pdftest/converted.pdf");

output.Position = 0;

logStream.Dispose();

logStream.Close();

return output;

}