Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target.tsv test for in EmbeddedFiles NameTree #108

Closed
faceless2 opened this issue Mar 6, 2024 · 4 comments
Closed

Target.tsv test for in EmbeddedFiles NameTree #108

faceless2 opened this issue Mar 6, 2024 · 4 comments
Assignees

Comments

@faceless2
Copy link
Collaborator

Coming back to Target.tsv - already been touched in in #38 and #49

For the N key you are checking

fn:Eval(fn:Not(fn:IsPresent(fn:Not((@R==C) && fn:InNameTree(trailer::Catalog::Names::EmbeddedFiles)))))

to capture the requirement in table 205

(Required if the value of R is C and the target is located in the EmbeddedFiles name tree; otherwise, it shall be absent) The name of the file in the EmbeddedFiles name tree.

This requirement can't be verified if the target link is to an embedded file within an embedded file, which is valid (and I have an example if you want it) - it contains this action, referencing the embedded-file "bob.pdf" attached to the embedded-file "charlie.pdf"

<</Type/Action/S/GoToE/D(banana1)/T<</R/C/N(charlie.pdf)/T<</R/C/N(bob.pdf)>>>>>>

One way to fix this is to

  1. split Target.tsv into Target.tsv and TargetEmbedded.tsv
  2. in Target.tsv, change T from [Target] to [TargetEmbedded]
  3. remove any checks in TargetEmbedded.tsv that refer to properties of the PDF, such as InNameTree, NumberOfPages etc., as all these tests would need to be run on the target PDF, not the current PDF.
@petervwyatt petervwyatt self-assigned this Mar 6, 2024
@petervwyatt
Copy link
Member

@faceless2 - could I please get the test file so I can test the changes?

@faceless2
Copy link
Collaborator Author

Indeed! There's one at https://bfo.com/misc/notarizing-signatures/dave.pdf - this has other Arlington issues, but there are two actions in there which are currently being caught by this one (objects 23 and 24).

(context for the file is at https://bfo.com/misc/notarizing-signatures/version2.html)

@petervwyatt
Copy link
Member

petervwyatt commented Mar 15, 2024

Interesting PDF. I also created Errata #382 as a result of poking around...

It is the only place in the Arlington model where fn:StringLength was used on something that was not string-byte!

@petervwyatt
Copy link
Member

petervwyatt commented Mar 16, 2024

On review, I also think we have a rule stating that if @R==C and if key P is present, then A must also be present (and vice-versa) because both P and A have the same identical conditional requirement in Table 205. However, since files of file annots are not required to be in the EmbeddedFiles name tree then there is nothing additional about N that can be specifically asserted beyond that one of N, P and A must always exist.

ie. for P: fn:IsRequired((@R==C) && fn:IsPresent(A))
ie. for A: fn:IsRequired((@R==C) && fn:IsPresent(P))
ie. for N: fn:IsRequired(fn:Not(fn:IsPresent(P) || fn:IsPresent(A)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants