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,
- PDFNET-41491 - PDF to PDF/A-2u - Support this conversion format
- PDFNET-41492 - PDF to PDF/A-3u - Support this conversion format
Hi,
Hi Petr,
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,
Hi,
Hi Benjamin,
Hi Petr,
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,
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.
Hi Benjamin,
Hi… thanks for the response. just to confirm the updates will include PDF/A-2U on all aspose products?
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.
Hi Benjamin,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 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.
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,
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;
}