Error when using PDF Citation Cover Page after Update to 7.6.3

77 views
Skip to first unread message

schu...@effective-webwork.de

unread,
Feb 20, 2025, 3:29:13 AM2/20/25
to DSpace Technical Support
Hello,

we recently did an update for a project from a 7.6.1 based DSpace to version 7.6.3. Everything seems to work fine, except for the Citation Cover Page generation. We use the variant where the Citation Cover Pages are generated on the fly during download. Instead of downloading or displaying the PDF files, the browser (or tools like Postman) just show "Failed to load PDF file".

There are no errors in the logs and debugging leads to no exceptions.

Is this a known problem or does anyone know a fix?

Regards
Johannes

schu...@effective-webwork.de

unread,
Feb 20, 2025, 10:49:07 AM2/20/25
to DSpace Technical Support
P.S. I just tried enabling the on the fly Citation Cover Page generation in a DSpace 8 installation, and the same error occurs.

Nurminen, Miika

unread,
Feb 23, 2025, 6:14:28 PM2/23/25
to dspac...@googlegroups.com
Hello Johannes,

if the problem is related to showing PDF in browser, there is a known
issue (present in DSpace 7 and newer versions as well) related to
content-length calculation that renders files with coverpages unreadable
in browsers, even though downloading the file as attachment should work.

More details on the issue
https://github.com/DSpace/DSpace/issues/9665

And fixes for DSpace 7.x and 8.x
https://github.com/DSpace/DSpace/pull/9895
https://github.com/DSpace/DSpace/pull/10354


Best regards,
Miika Nurminen
> --
> All messages to this mailing list should adhere to the Code of Conduct:
> https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx <https://
> www.lyrasis.org/about/Pages/Code-of-Conduct.aspx>
> ---
> You received this message because you are subscribed to the Google
> Groups "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to dspace-tech...@googlegroups.com <mailto:dspace-
> tech+uns...@googlegroups.com>.
> To view this discussion visit https://groups.google.com/d/msgid/dspace-
> tech/00eb0c56-feb7-40ce-abcc-f48ac7bbd878n%40googlegroups.com <https://
> groups.google.com/d/msgid/dspace-tech/00eb0c56-feb7-40ce-abcc-
> f48ac7bbd878n%40googlegroups.com?utm_medium=email&utm_source=footer>.

schu...@effective-webwork.de

unread,
Feb 24, 2025, 8:33:09 AM2/24/25
to DSpace Technical Support
Hello Miika,

thanks a lot -  I'll look into the issue and the fixes!

Regards
Johannes

schu...@effective-webwork.de

unread,
Feb 25, 2025, 7:10:09 AM2/25/25
to DSpace Technical Support
Just to confirm: the patch for 7.x works perfectly for us.

Regards
Johannes

Eric Montague

unread,
Mar 20, 2025, 1:43:45 AM3/20/25
to dspac...@googlegroups.com, miika.s....@gmail.com

I applied https://github.com/DSpace/DSpace/pull/10354 to Dspace 8.1 running on Windows.
This fixed on-the-fly Citation Cover Page generation for anonymous users.
But cover page generation does not occur for logged-in users,
and no errors appear in the browser or the dspace log.

The dspace log extracts below, indicate that the code paths for anonymous and logged-in users
are slightly different.

Is this a bug?

... PDF Cover Page is not generated when logged in.
... Download PDF from Simple item page ...
... When anonymous, PDF Cover Page is generated
2025-03-19 20:52:50,258 INFO  8ac89edb-e2e2-4b1c-a1c2-91869284fd9e c9f38e6a-8357-46f7-9e62-2ebc34551229
org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter
@ Before request [GET /server/api] originated from /items/591f4c44-a037-4f6d-8f96-4a88f85aaf9d
2025-03-19 20:52:52,536 INFO  unknown 3b6d8895-5f87-4308-b108-c2eefe068bab
org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter
@ Before request [GET /server/api/core/bitstreams/4d7d123e-1ba4-41bd-9d8e-e5c0effd6836/content]
originated from http://localhost:4000/
2025-03-19 20:52:52,548 INFO  unknown 3b6d8895-5f87-4308-b108-c2eefe068bab
org.dspace.usage.LoggerUsageEventListener
@ anonymous::view_bitstream:bitstream_id=4d7d123e-1ba4-41bd-9d8e-e5c0effd6836
... When logged in, PDF Cover Page is not generated
025-03-19 20:58:20,340 INFO  8ac89edb-e2e2-4b1c-a1c2-91869284fd9e 4e3e76fc-d952-49e1-a09e-99bbc3fa3c07
org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter
@ Before request [GET /server/api] originated from /items/591f4c44-a037-4f6d-8f96-4a88f85aaf9d
... This [POST] does not occur when anonymous
2025-03-19 20:58:22,551 INFO  8ac89edb-e2e2-4b1c-a1c2-91869284fd9e 78c8b40f-fc32-4c24-801b-772937a74b03
org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter
@ Before request [POST /server/api/authn/shortlivedtokens]
originated from /bitstreams/4d7d123e-1ba4-41bd-9d8e-e5c0effd6836/download
2025-03-19 20:58:22,780 INFO  unknown b8d3bde6-74bd-4e14-b9e4-fd714079a289
org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter
@ Before request [GET /server/api/core/bitstreams/4d7d123e-1ba4-41bd-9d8e-e5c0effd6836/content]
originated from http://localhost:4000/
2025-03-19 20:58:22,788 INFO  unknown b8d3bde6-74bd-4e14-b9e4-fd714079a289
org.dspace.usage.LoggerUsageEventListener
@ ericmontag@comcast.net::view_bitstream:bitstream_id=4d7d123e-1ba4-41bd-9d8e-e5c0effd6836

Regards,

- eric

Nurminen, Miika

unread,
Mar 20, 2025, 5:43:09 AM3/20/25
to Eric Montague, dspac...@googlegroups.com
Hello Eric,

please check whether the issue concerns _any_ logged-in users or just
administrators.

The default citation page functionality in DSpace prevents showing the
cover page to administrators:

https://github.com/DSpace/DSpace/blob/dspace-7_x/dspace-api/src/main/java/org/dspace/disseminate/CitationDocumentServiceImpl.java#L267

I have used the following patch (not yet in Github but it's just a
one-line modification) in our system that adds a new configuration
option to enable cover page for admins that might be useful here. Alter
the corresponding line in your CitationDocumentServiceImpl.java as follows:

boolean adminUser = authorizeService.isAdmin(context) &&
!configurationService.getBooleanProperty("citation-page.enable_for_admins",
false);


and then add to e.g. citation-page.cfg:

citation-page.enable_for_admins = true


Cheers,
Miika

On 20.3.2025 7:43, Eric Montague wrote:
> I applied https://github.com/DSpace/DSpace/pull/10354 to Dspace 8.1
> running on Windows.
> This fixed on-the-fly Citation Cover Page generation for *anonymous *users.
> But cover page generation does not occur for*logged-in* users,
> and no errors appear in the browser or the dspace log.
>
> The dspace log extracts below, indicate that the code paths for
> anonymous and logged-in users
> are slightly different.
>
> Is this a bug?
>
> ... PDF Cover Page is not generated when logged in.
> ... Download PDF from Simple item page ...
> *... When anonymous, PDF Cover Page is generated*
> 2025-03-1920:52:50,258INFO8ac89edb-e2e2-4b1c-
> a1c2-91869284fd9ec9f38e6a-8357-46f7-9e62-2ebc34551229
> org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter
> @ Before request [GET /server/api] originated from /items/591f4c44-
> a037-4f6d-8f96-4a88f85aaf9d
> 2025-03-1920:52:52,536INFO unknown 3b6d8895-5f87-4308-b108-c2eefe068bab
> org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter
> @ Before request [GET /server/api/core/
> bitstreams/4d7d123e-1ba4-41bd-9d8e-e5c0effd6836/content]
> originated from http://localhost:4000/
> 2025-03-1920:52:52,548INFO unknown 3b6d8895-5f87-4308-b108-c2eefe068bab
> org.dspace.usage.LoggerUsageEventListener
> @ anonymous::view_bitstream:bitstream_id=4d7d123e-1ba4-41bd-9d8e-
> e5c0effd6836
> ... When logged in, PDF Cover Page is not generated
> 025-03-1920:58:20,340INFO8ac89edb-e2e2-4b1c-a1c2-91869284fd9e4e3e76fc-
> d952-49e1-a09e-99bbc3fa3c07
> org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter
> @ Before request [GET /server/api] originated from /items/591f4c44-
> a037-4f6d-8f96-4a88f85aaf9d
> ... This [POST] does not occur when anonymous
> 2025-03-1920:58:22,551INFO8ac89edb-e2e2-4b1c-a1c2-91869284fd9e78c8b40f-
> fc32-4c24-801b-772937a74b03
> org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter
> @ Before request [POST /server/api/authn/shortlivedtokens]
> originated from /bitstreams/4d7d123e-1ba4-41bd-9d8e-e5c0effd6836/download
> 2025-03-1920:58:22,780INFO unknown b8d3bde6-74bd-4e14-b9e4-fd714079a289
> org.dspace.app.rest.utils.DSpaceAPIRequestLoggingFilter
> @ Before request [GET /server/api/core/
> bitstreams/4d7d123e-1ba4-41bd-9d8e-e5c0effd6836/content]
> originated from http://localhost:4000/
> 2025-03-1920:58:22,788INFO unknown b8d3bde6-74bd-4e14-b9e4-fd714079a289
> org.dspace.usage.LoggerUsageEventListener
> @
> ericm...@comcast.net::view_bitstream:bitstream_id=4d7d123e-1ba4-41bd-9d8e-e5c0effd6836

Eric Montague

unread,
Mar 20, 2025, 4:07:06 PM3/20/25
to Nurminen, Miika, dspac...@googlegroups.com
Thanks Miik,

Yes, it was an administrator login. (On our site, there are no login
users except administrators.)

I made the changes you suggested, and now cover pages are generated for
administrators.

Thanks again,

- eric
Reply all
Reply to author
Forward
0 new messages