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

Free Support Forum - aspose.com

"write-direct" mode and PDF conformance

Hi,


I’m testing Aspose.PDF 7.7.0 to generate PDF from images.

When I use the “normal mode” (new Pdf()), I’m able to generate a PDFA file.

When I use the “write-direct mode” (new Pdf(Stream)) even if I set the conformance property to PDFA (1A or 1B) the resulting file is not, according to Adobe Reader, a PDFA.

Is this an bug or a limitation of the version?

Regards,
No idea?
This feature is crucial for the choice of the component that we will integrate in our solution.

Indeed, we need to generate PDF / A with thousands of different images. The generation of such files directly in memory may result in OutOfMemoryException.

Hi Tetranos,


Sorry for the delayed response. Can you please confirm you are getting issue with some specific image or with all the images? Can you please share your sample code and image here for testing?

Sorry for the inconvenience faced.

Best Regards,
Hi,

The problem appears even with no image.

The following code does not produce a valid PDFA/1a:

string output = "c:\\myfile_invalid.pdf";

using (FileStream outputStream = new FileStream(output, FileMode.Create))
{
Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf(outputStream);
pdf.Conformance = PdfConformance.PdfA1A;

Aspose.Pdf.Generator.Section sec = pdf.Sections.Add();

Aspose.Pdf.Generator.Text text = new Aspose.Pdf.Generator.Text();
Aspose.Pdf.Generator.Segment seg = text.Segments.Add();
seg.Content = "Is not valid PDFA/1a";

sec.AddParagraph(text);

pdf.Close();
}

Whereas the following one produce a valid PDFA/1a:

string output = "c:\\myfile_valid.pdf";

Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
pdf.Conformance = PdfConformance.PdfA1A;

Aspose.Pdf.Generator.Section sec = pdf.Sections.Add();

Aspose.Pdf.Generator.Text text = new Aspose.Pdf.Generator.Text();
Aspose.Pdf.Generator.Segment seg = text.Segments.Add();
seg.Content = "Is valid PDFA/1a.";

sec.Paragraphs.Add(text);

pdf.Save(output);

Hi there,

Sorry for the inconvenience faced. I've managed to reproduce the reported issue on my side and logged the issue in our bug tracking system for further investigation and resolution, the issue ID is PDFNEWNET-35035. I've also linked your request to this issue and you will be notified via this forum thread as soon as it is resolved.


Please feel free to contact us for any further assistance.


Best Regards,

Hi,


Thanks for your patience.

We have further investigated the problem reported earlier and we would like to recommend you to please try using the Document Object Model approach of Aspose.Pdf namespace to created PDF/A-b documents. It’s a new method of creating documents and has better results as compare to Aspose.Pdf.Generator namespace. You may also consider visiting the following page for information on Convert PDF File to PDF-A

[C#]

string outFile = TestSettings.GetOutputFile(“35030.pdf”);<o:p></o:p>

string logFile = TestSettings.GetOutputFile("35030.log");

Document pdfDocument = new Document();

Page page = pdfDocument.Pages.Add();

TextFragment text = new TextFragment("Is valid PDFA/1a.");

page.Paragraphs.Add(text);

pdfDocument.Convert(logFile, PdfFormat.PDF_A_1B, ConvertErrorAction.None);

pdfDocument.Save(outFile);

The issues you have found earlier (filed as PDFNEWNET-35035) have been fixed in Aspose.Pdf for .NET 7.9.0.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi,


The issue is not solved. The following code still does not work.

string output = @“c:\myfile_invalid.pdf”;

using (FileStream outputStream = new FileStream(output, FileMode.Create))
{
Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf(outputStream);
pdf.Conformance = PdfConformance.PdfA1A;

Aspose.Pdf.Generator.Section sec = pdf.Sections.Add();

Aspose.Pdf.Generator.Text text = new Aspose.Pdf.Generator.Text();
Aspose.Pdf.Generator.Segment seg = text.Segments.Add();
seg.Content = “Is not valid PDFA/1a”;

sec.AddParagraph(text);

pdf.Close();
}

Tested with
Aspose PDF 7.9 FX 4.0
Aspose PDF 7.9 FX 3.5
Aspose PDF 8.1 FX 4.0
Aspose PDF 8.1 FX 3.5

Hi there,


Thanks for your feedback. As suggested above please use Apose.Pdf namespace instead Aspose.Pdf.Generator. Please check following code snippet hopefully it will serve the purpose.


string output = myDir+“myfile_valid.pdf”;

using (FileStream outputStream = new FileStream(output, FileMode.Create))
{
Document pdfDocument = new Document();
Page page = pdfDocument.Pages.Add();
TextFragment text = new TextFragment(“Is valid PDFA/1a.”);
page.Paragraphs.Add(text);
pdfDocument.Convert(myDir+“testlogfile”, PdfFormat.PDF_A_1B, ConvertErrorAction.None);
pdfDocument.Save(outputStream);

}

Please feel free to contact us for any further assistance.

Best Regards,