I have tried the JATSParserPlugin to generate PDF-files on-the-fly from XML. However, I don’t get how I can modify the layout of the PDF:s
Is it some CSS files somewhere?
Can I have different layouts for different journals in a multijournal insallation of OJS?
Also, I think it’s possible to write a direct conversion from PHP objects from JATS Parser to TCPDF entities that will give more possibilities for customization (e.g., 2-column layout, another header) but 1) it requires a lot of effort 2) it requires more support.
I have looked at this and made some small modifications in the oldGregg theme. However, I can not find the way to add the DOI-link and publication date to the pdf-file. Is this information available in variables such as $articleArrays and $templateMgr in OldGreggThemePlugin.inc.php, and how can in find out the content of these arrays?
In the next Old Gregg release JATS Parser library will be decoupled from the theme, thus I suggest to work with JATS Parser plugin directly. Note, in near future all themes would be able to show article’s fulltext on the article landing page through JATS Parser, not only Old Gregg.
If the idea is to inject DOI into header or footer, the best would be check TCPDF documentation.
The latter is the instance of PKPTemplateManager, which in turn is a child of Smarty and inherits all its methods. The former is the instance of PublishedArticle object, I have no idea why I called it that way Anyway, there is a correspondent annotation. You can look at available methods in this class and it’s parent (Article) and grandparent (Submisison).
Let me know if you stuck on something specific. In general, I’d like to add methods that can make adding custom code and CSS into the TCPDF easier. I’d be grateful for the contribution.
I will look into this and try to insert the DOI.
We have tested oldGregg with images in various sizes. JATSparser scale all images in the PDF:s to paper width if they are large enough. However, if they are smaller it looks nice in the pdf and on the website, but the scaling of the image is incorrect in the HTML version when maximizing the image. see for example the second image in the end of this test article: https://journal.ep.liu.se/test/index.php/atena/article/view/291
![image|690x197]
Thanks for reporting. Yes, I know this bug and it’s something that I plan to change in the new release.
Just want to add that the new version of Old Gregg theme would be much different. I’m making new design for it but the functionality would be much the same, plus there would be new features. E.g., yesterday I finally added the back-end support for most viewed articles. Although it will take some time but I believe the results will worth it.
If you are planning to make changes in the theme (not the JATS Parser Plugin), e.g., creating a child theme, I suggest to wait until new release.
I’ve seen that your JATSParserPlugin code imports CSS files from resources/styles/jatsParser.css and resources/styles/default/pdfGalley.css to style the PDF galley.
Wouldn’t it possible to provide a CSS upload option (similar to OJS Website > Advanced > Journal Style Sheet upload) in the plugin settings? The uploaded CSS would then overwrite the default CSS provided by the plugin. In addition, this would offer individual galley styling per journal, which is a requirement in a multi-journal hosting.
Another option would be to read a separate CSS file that is located within the theme used by the journal.
Of course this requires a proper documentation of the CSS classes that are used in the TCPDF conversion.
I can discuss with my team if I can offer some support.
Yes, I was considering this. I also was thinking about moving to something like mPDF with better CSS support but haven’t experimented yet. In TCPDF, the support for something more complex than, say, changing the background colour, like 2-column layout, is only on PHP side and is non-trivial task. mPDF looks better, as minimum if looking at the documentation.
I think the easiest way would be to add possibility for uploading a stylesheet through the plugin settings. I’ll take a look
We are currently in the process of integrating Texture + JatsParser into our journal. So far, the plugins have been performing well and delivering excellent results. We do, however, have a specific question regarding customizing the PDF output.
In a previous chat, you mentioned the possibility of updating the library that the plugin calls or making modifications to the PHP code to incorporate a CSS. We’re prepared to undertake some programming on our end to achieve this customization. However, we believe that coordinating our efforts with you would be beneficial in order to align with your plans for the plugin’s development.
We appreciate your expertise and guidance on this matter. Thank you in advance for your response.
Best regards,
Sergio Santamarina
Librarian, University of José C. Paz, Argentina
Have you already looked at the mPDF’s documentation and CSS selectors it supports? I see also the possibility for further output customisation through PHP with this library, e.g., support for 2 column page layout.