PDF/A-1 ISO 19005-1:2005 How to? Topic is solved

Talk here about issues with one of the components hosted at wxCode, or suggest features for it.
utelle
Moderator
Moderator
Posts: 993
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: PDF/A-1 ISO 19005-1:2005 How to?

Post by utelle » Mon Nov 16, 2020 11:21 pm

cutecode wrote:
Mon Nov 16, 2020 11:10 pm
utelle wrote:
Mon Nov 16, 2020 11:02 pm
I'm willing to add PDF/A support to wxPdfDocument somehow, but this may take some time.
I hope only on you!!!
I will tackle this issue. Hopefully not in a too far future. :wink:

I would recommend that you use the watch option on the wxPdfDocument GitHub repository. Then you will be automatically informed, when new features are added.

For now, I call it a day.

utelle
Moderator
Moderator
Posts: 993
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: PDF/A-1 ISO 19005-1:2005 How to?

Post by utelle » Fri Nov 20, 2020 1:47 pm

A first implementation of PDF/A-1B support is now available at the wxPdfDocument GitHub repository.

User avatar
cutecode
Super wx Problem Solver
Super wx Problem Solver
Posts: 362
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: PDF/A-1 ISO 19005-1:2005 How to?

Post by cutecode » Fri Nov 20, 2020 3:33 pm

utelle wrote:
Fri Nov 20, 2020 1:47 pm
A first implementation of PDF/A-1B support is now available at the wxPdfDocument GitHub repository.
WOW!!!
THANK YOU.

I will try it right now
wx 3.1.4 win/mac/linux

regards,
Alexander Saprykin
https://v2.dental-soft.ru

User avatar
cutecode
Super wx Problem Solver
Super wx Problem Solver
Posts: 362
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: PDF/A-1 ISO 19005-1:2005 How to?

Post by cutecode » Fri Nov 20, 2020 4:48 pm

Hello
The same result

Code: Select all

Absolute real value must be less than or equal to 32767.0
DeviceRGB may be used only if the file has a PDF/A-1 OutputIntent that uses an RGB colour space
I checked this file on this site
https://bfo.com/blog/2017/11/08/verify_pdfa_online/

It gives more errors

Code: Select all

PDF/A-1b:2005
HasDocID is required but missing
DocIDMissing is set, but shouldn't be
XMPMetaData is required but missing
TransparencyGroup is set, but shouldn't be
CIDFontSubsetWithoutCIDSet is set, but shouldn't be
CIDFontTrueTypeWithoutCIDToGIDMap is set, but shouldn't be
HasOutputIntentGTS_PDFA1 is required but missing
InfoMeetsPDFA1b_2005 is required but missing
RealOverflow14 is set, but shouldn't be
should I comment line #1030 again?
Attachments
1.pdf.zip
(45.89 KiB) Downloaded 7 times
wx 3.1.4 win/mac/linux

regards,
Alexander Saprykin
https://v2.dental-soft.ru

utelle
Moderator
Moderator
Posts: 993
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: PDF/A-1 ISO 19005-1:2005 How to?

Post by utelle » Fri Nov 20, 2020 7:47 pm

cutecode wrote:
Fri Nov 20, 2020 4:48 pm
The same result

Code: Select all

Absolute real value must be less than or equal to 32767.0
DeviceRGB may be used only if the file has a PDF/A-1 OutputIntent that uses an RGB colour space
For the first message, I have no clue, unfortunately.
The second message is not surprising, because the PDF document includes the transparency information (which shouldn't be used for PDF/A-1B documents).
cutecode wrote:
Fri Nov 20, 2020 4:48 pm
I checked this file on this site
https://bfo.com/blog/2017/11/08/verify_pdfa_online/

It gives more errors

Code: Select all

PDF/A-1b:2005
HasDocID is required but missing
DocIDMissing is set, but shouldn't be
XMPMetaData is required but missing
TransparencyGroup is set, but shouldn't be
CIDFontSubsetWithoutCIDSet is set, but shouldn't be
CIDFontTrueTypeWithoutCIDToGIDMap is set, but shouldn't be
HasOutputIntentGTS_PDFA1 is required but missing
InfoMeetsPDFA1b_2005 is required but missing
RealOverflow14 is set, but shouldn't be
At least some of the error messages can be explained by the fact, that PDF/A-1B mode was not in effect.

First, you should make sure that PDF/A-1B mode is in fact enabled. Thereafter we will see which messages remain after checking for PDF/A-1B conformance again.
cutecode wrote:
Fri Nov 20, 2020 4:48 pm
should I comment line #1030 again?
No. If the PDF/A-1B mode of wxPdfDocument is correctly enabled the transparency info will not be written to the PDF document.

I suspect that you didn't enable PDF/A-1B mode. So, please do the following in your code:

Code: Select all

// Create wxPdfDC instance as you already did in your code (the instance name in your code may be different)
wxPdfDC dc;

// Start creation of document
dc.StartDoc("...");

// Access the underlying wxPdfDocument instance immediately *after* method StartDoc has been called
wxPdfDocument* pdfDoc = dc.GetPdfDocument();

// Enable PDF/A-1B conformance
pdfDoc->SetPdfA1Conformance(true);

// Disable page compression
// This makes it easier for me to analyse the PDF content of your generated PDF document.
// Compression should be enabled for production mode.
pdfDoc->SetCompression(false);

// ... continue with generating the PDF document ...
After applying the above modifications repeat your test, check for PDF/A-1B conformance and show the check's results, and attach your PDF as before.

User avatar
cutecode
Super wx Problem Solver
Super wx Problem Solver
Posts: 362
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: PDF/A-1 ISO 19005-1:2005 How to?

Post by cutecode » Fri Nov 20, 2020 9:34 pm

hello. now I have these errors

Code: Select all

CIDFontSubsetWithoutCIDSet is set, but shouldn't be
CIDFontTrueTypeWithoutCIDToGIDMap is set, but shouldn't be
RealOverflow14 is set, but shouldn't be
Attachments
1.pdf.zip
(48.77 KiB) Downloaded 7 times
wx 3.1.4 win/mac/linux

regards,
Alexander Saprykin
https://v2.dental-soft.ru

User avatar
cutecode
Super wx Problem Solver
Super wx Problem Solver
Posts: 362
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: PDF/A-1 ISO 19005-1:2005 How to?

Post by cutecode » Fri Nov 20, 2020 9:39 pm

and my service responed this

Code: Select all

<ns2:message>
Absolute real value must be less than or equal to 32767.0
For all CIDFont subsets referenced within a conforming file, the font descriptor dictionary shall include a
			CIDSet stream identifyi...</ns2:message>
wx 3.1.4 win/mac/linux

regards,
Alexander Saprykin
https://v2.dental-soft.ru

utelle
Moderator
Moderator
Posts: 993
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: PDF/A-1 ISO 19005-1:2005 How to?

Post by utelle » Fri Nov 20, 2020 10:33 pm

cutecode wrote:
Fri Nov 20, 2020 9:34 pm
hello. now I have these errors

Code: Select all

CIDFontSubsetWithoutCIDSet is set, but shouldn't be
CIDFontTrueTypeWithoutCIDToGIDMap is set, but shouldn't be
RealOverflow14 is set, but shouldn't be
Well, at least the list of remaining errors is rather short. I will have to take a look at the PDF documentation to find out what needs to be done to avoid these errors or whether there exists some sort of workaround.

One thing you could at least try would be to disable font subsetting, adding the following code line

Code: Select all

pdfDoc->SetFontSubsetting(false);
This forces to embed the complete font instead of just the subset of used glyphs. Yes, this increases the size of the resulting PDF file, but possibly avoids the font related error message. Not ideal, but maybe a working interim solution.
cutecode wrote:
Fri Nov 20, 2020 9:39 pm
and my service responed this

Code: Select all

<ns2:message>
Absolute real value must be less than or equal to 32767.0
For all CIDFont subsets referenced within a conforming file, the font descriptor dictionary shall include a
			CIDSet stream identifyi...</ns2:message>
I will try to find out which font information is requested, whether wxPdfDocument has access to it, and whether it's feasible to add it to the PDF document.

utelle
Moderator
Moderator
Posts: 993
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: PDF/A-1 ISO 19005-1:2005 How to?

Post by utelle » Fri Nov 20, 2020 10:49 pm

Regarding the message about the real value
cutecode wrote:
Fri Nov 20, 2020 9:39 pm

Code: Select all

Absolute real value must be less than or equal to 32767.0
I found out that your code seems to draw a rectangle right at the beginning using very large coordinates

Code: Select all

42.00 34.00 71769.72 71457.64 re B 
The values correspond to the x/y values of left resp right corner of the rectangle. The right corner is way outside the visible page dimension. This seems to be a bug in your code. If possible you should not draw outside of the page dimension.

User avatar
cutecode
Super wx Problem Solver
Super wx Problem Solver
Posts: 362
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: PDF/A-1 ISO 19005-1:2005 How to?

Post by cutecode » Fri Nov 20, 2020 11:05 pm

I set
pdfDoc->SetFontSubsetting(0);

and removed those lines but the same errors

Code: Select all

CIDFontSubsetWithoutCIDSet is set, but shouldn't be
CIDFontTrueTypeWithoutCIDToGIDMap is set, but shouldn't be
RealOverflow14 is set, but shouldn't be
Attachments
1.pdf.zip
(48.75 KiB) Downloaded 7 times
wx 3.1.4 win/mac/linux

regards,
Alexander Saprykin
https://v2.dental-soft.ru

utelle
Moderator
Moderator
Posts: 993
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: PDF/A-1 ISO 19005-1:2005 How to?

Post by utelle » Fri Nov 20, 2020 11:34 pm

cutecode wrote:
Fri Nov 20, 2020 11:05 pm
I set
pdfDoc->SetFontSubsetting(0);

and removed those lines but the same errors

Code: Select all

CIDFontSubsetWithoutCIDSet is set, but shouldn't be
CIDFontTrueTypeWithoutCIDToGIDMap is set, but shouldn't be
RealOverflow14 is set, but shouldn't be
Hm, the offending rectangle is still in the page content. And for the font subsetting is still used. The latter could be a bug in wxPdfDocument not taking into account the global setting for font subsetting.

Edited 1:
The default font subsetting mode has to be set via the font manager class. The document method SetFontSubsetting does currently nothing. Sorry for the confusion. Please try:

Code: Select all

wxPdfFontManager::GetFontManager()->SetDefaultSubset(false);
Edited 2:
I checked with 2 other PDF generators which claim PDF/A support - both simply turned off font subsetting when in PDF/A conformance mode. For the time being wxPdfDocument should probably follow this route, too, until a better solution is available.

User avatar
cutecode
Super wx Problem Solver
Super wx Problem Solver
Posts: 362
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: PDF/A-1 ISO 19005-1:2005 How to?

Post by cutecode » Sat Nov 21, 2020 9:50 am

2 errors left ))))

Code: Select all

CIDFontTrueTypeWithoutCIDToGIDMap is set, but shouldn't be
RealOverflow14 is set, but shouldn't be
Attachments
1.pdf.zip
(395.37 KiB) Downloaded 6 times
wx 3.1.4 win/mac/linux

regards,
Alexander Saprykin
https://v2.dental-soft.ru

User avatar
cutecode
Super wx Problem Solver
Super wx Problem Solver
Posts: 362
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: PDF/A-1 ISO 19005-1:2005 How to?

Post by cutecode » Sat Nov 21, 2020 1:45 pm

1 error left

Code: Select all

CIDFontTrueTypeWithoutCIDToGIDMap is set, but shouldn't be
I found where I draw rectengle out of page bounderies. And this did help on removing the error
RealOverflow14 is set, but shouldn't be

Thank you
Attachments
1.pdf.zip
(628.06 KiB) Downloaded 6 times
wx 3.1.4 win/mac/linux

regards,
Alexander Saprykin
https://v2.dental-soft.ru

utelle
Moderator
Moderator
Posts: 993
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: PDF/A-1 ISO 19005-1:2005 How to?

Post by utelle » Sat Nov 21, 2020 10:18 pm

cutecode wrote:
Sat Nov 21, 2020 1:45 pm
I found where I draw rectangle out of page bounderies. And this did help on removing the error
RealOverflow14 is set, but shouldn't be
Good news.
cutecode wrote:
Sat Nov 21, 2020 1:45 pm
1 error left

Code: Select all

CIDFont TrueType Without CIDToGIDMap is set, but shouldn't be
Obviously it is not enough to embed a complete font, but additional information is even then required - at least for TrueType fonts.

Well, I have to inspect the PDF reference manuals once again, how to prepare the required TrueType font data for inclusion in the resulting PDF document. Solving the issue will probably take a few days, but be assured that a solution will be provided.

utelle
Moderator
Moderator
Posts: 993
Joined: Tue Jul 05, 2005 10:00 pm
Location: Cologne, Germany
Contact:

Re: PDF/A-1 ISO 19005-1:2005 How to?

Post by utelle » Mon Nov 23, 2020 10:11 pm

utelle wrote:
Sat Nov 21, 2020 10:18 pm
cutecode wrote:
Sat Nov 21, 2020 1:45 pm

Code: Select all

CIDFont TrueType Without CIDToGIDMap is set, but shouldn't be
Obviously it is not enough to embed a complete font, but additional information is even then required - at least for TrueType fonts.

Well, I have to inspect the PDF reference manuals once again, how to prepare the required TrueType font data for inclusion in the resulting PDF document. Solving the issue will probably take a few days, but be assured that a solution will be provided.
An adjusted implementation of PDF/A-1B conformance is now available. PDF/A-1B mode should now work with TrueType Unicode and OpenType Unicode fonts.

Post Reply