Page 1 of 1

MRC-Compression and ConvertToPDFA produces false PDF/A conformance

Posted: Tue Feb 04, 2020 3:00 am
by EFernkaes
v.14.1.51

Hi ORPALIS-Team,

I am testing now for several hours, but the result is always the same.
I want to convert a regular PDF to an MRC-compressed PDF/A-1b pdf-file.

Approach 1
Using GdPicturePDFReducer, loading the resulting pdf and then trying to .ConvertToPDFA:

Code: Select all

    
    		Dim gdpicturePDFReducer As GdPicturePDFReducer = New GdPicturePDFReducer()
                gdpicturePDFReducer.PDFReducerConfiguration.OutputFormat = PDFReducerPDFVersion.PdfVersionRetainExisting
                gdpicturePDFReducer.PDFReducerConfiguration.RecompressImages = True
                gdpicturePDFReducer.PDFReducerConfiguration.EnableMRC = True
                gdpicturePDFReducer.PDFReducerConfiguration.DownscaleResolutionMRC = 200
                gdpicturePDFReducer.PDFReducerConfiguration.PreserveSmoothing = False
                status = gdpicturePDFReducer.ProcessDocument(SourceNamePDF, DestNamePDF)
                 status = urGdPicturePdf.LoadFromFile(DestNamePDF, False)
                 status = urGdPicturePdf.ConvertToPDFA(tmpComparablePDFFile, PdfConversionConformance.PDF_A_1b, True, True)
		urGdPicturePdf.CloseDocument
                
The resulting pdf has no PDF/A-1b conformance but PDF/A-2b

Approch 2
Replacing the Images with MRC compressed one and then ConvertingToPDFA:

Code: Select all

status = urGdPicturePdf.LoadFromFile(SourceNamePDF, False)
                            urGdPicturePdf.SetMRCPreserveSmoothing(False)
                            urGdPicturePdf.SetCompressionForBitonalImage(PdfCompression.PdfCompressionJBIG2)
                                urGdPicturePdf.SetCompressionForColorImage(PdfCompression.PdfCompressionJPEG)
                                urGdPicturePdf.SetJpegQuality(80) 

                        For page = 1 To PageCount
                            status = urGdPicturePdf.SelectPage(page)
                                If urGdPicturePdf.IsPageImage(True) Then

                                        ImageID = urGdPicturePdf.ExtractPageImage(1)
                                        status = urGdPicturePdf.GetStat()
                                        If status = GdPictureStatus.OK Then
                                            ImgResName = urGdPicturePdf.GetPageImageResName(0)
                                            status = urGdPicturePdf.GetStat()
                                            If status = GdPictureStatus.OK Then
                                                status = urGdPicturePdf.ReplaceImageMRC(ImgResName, ImageID)
                                            End If
                                        End If
                                        GdPictureDocumentUtilities.DisposeImage(ImageID)
                                    End If
                                End If
                        Next
                 status = urGdPicturePdf.ConvertToPDFA(tmpComparablePDFFile, PdfConversionConformance.PDF_A_1b, True, True)
		urGdPicturePdf.CloseDocument
Same. Created PDF has a conformance Level of PDF/A-2b

The only working version is loading the source pdf, creating a new pdf, iterating through all the pages, extracting the Images of each page from the source and placing the compressed one to the new pdf.

Code: Select all

                    status = oGdPicturePdf.NewPDF(PdfConformance.PDF_A_1b)
status = urGdPicturePdf.LoadFromFile(SourceNamePDF, False)
                        For page = 1 To PageCount
                            status = urGdPicturePdf.SelectPage(page)
ImageID = urGdPicturePdf.RenderPageToGdPictureImage(200, True)
                                    status = oGdPicturePdf.AddImageFromGdPictureImage(ImageID,PdfAdvancedImageCompression.PdfAdvancedImageCompressionMRC)
                                        GdPictureDocumentUtilities.DisposeImage(ImageID)
                        Next
                        urGdPicturePdf.closeDocument
			status = oGdPicturePdf.SaveToFile(DestNamePDF, True)
Any ideas?

Attached one file I was testing with. Many others, too.

Re: MRC-Compression and ConvertToPDFA produces false PDF/A conformance

Posted: Mon Feb 10, 2020 10:52 am
by loicaigon
Hi EFernkaes,

Let me get in touch with our engineers and come back to you asap.

Best regards,

Loic Aigon
Customer Success Manager
Orpalis

Re: MRC-Compression and ConvertToPDFA produces false PDF/A conformance

Posted: Thu Feb 20, 2020 2:18 am
by EFernkaes
Same like on the previous post: Did you already talk to the programmers?
Could they reproduce my issues?

Greetings
Reinhard

Re: MRC-Compression and ConvertToPDFA produces false PDF/A conformance

Posted: Fri Feb 21, 2020 3:53 pm
by loicaigon
Hi Reinhard,

I could see indeed with engineers and they could reproduce the issue. After analysis, they suggest that you revert the process. That means converting first to PDF/A and then apply MRC compression. The latter will keep PDF/A conformance in that specific order.

Hope that helps,

Loic Aigon

Re: MRC-Compression and ConvertToPDFA produces false PDF/A conformance

Posted: Tue Mar 03, 2020 3:09 pm
by loicaigon
Hi Reinhard,

Good news here. The problem has been solved and the fix will be available in next release (i.e. GdPicture.NET 14.1.56)

Best regards,

Loic Aigon.