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

Bug: Generating pdf using formatter from search results page results in blank pdf #7983

Open
archaeogeek opened this issue Apr 25, 2024 · 0 comments

Comments

@archaeogeek
Copy link
Contributor

Describe the bug
To get around the fact that it does not seem possible at the moment to generate a multi-lingual pdf from the search page (either labels or metadata) I have been trying to get the formatter approach to work as mentioned in web/src/main/webapp/xslt/services/pdf/portal-present-fop.xsl. I have a working formatter that generates results correctly when called from a browser using (eg) http://localhost/geonetwork/api/records/UUID/formatters/myformatter?language=wel&output=pdf but I am struggling to get this to work as the src in

<fox:external-document content-type="pdf"
      src="{concat($nodeUrl, 'api/records/', uuid, '/formatters/', $formatter)}" />

I have tried simply assigning the URL to src, and building it using concat statements but nothing makes any difference. When I print out the value of src as an xsl:message it is correct, and the code generates a pdf, but it is blank. I have tried debugging this in debug mode and in the web console in my browser but I can't see any errors. My record is public so there should be no authentication problems.

Additional context
Related issues, to do with generating multi-lingual pdfs from the search page include #6630 but that just refers to the language of the labels.
I have also tried to get around these problems by reverting to the traditional non-formatter approach in https://github.com/geonetwork/core-geonetwork/blob/4.2.x/web/src/main/webapp/xslt/services/pdf/portal-present-fop.xsl and adapting https://github.com/geonetwork/core-geonetwork/blob/4.2.x/web/src/main/webapp/xslt/services/pdf/metadata-fop.xsl. I can hard-code the labels to a certain extent but I'm stuck with the fact that elements like resourceAbstractObject only include the default value from the index and not the translations.

Any help with either approach would be much appreciated!

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

1 participant