-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix PDF export #10361
Fix PDF export #10361
Conversation
Throws Exception: Method threw 'java.lang.IllegalStateException' exception. Cannot evaluate org.apache.pdfbox.cos.COSDictionary.toString() |
import java.nio.file.Path; | ||
import java.util.List; | ||
import java.util.Objects; | ||
import java.io.IOException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
intendation off?
} | ||
exporter.exportToFileByPath(databaseContext, filePreferences, originalFilePath, abbreviationRepository); | ||
|
||
Files.copy(Paths.get(originalFilePath.toString()), Paths.get(exportedFilePath.toString()), StandardCopyOption.REPLACE_EXISTING); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You already have two Path objects, so you don't need that wrapping here
Files.copy(Paths.get(originalFilePath.toString()), Paths.get(exportedFilePath.toString()), StandardCopyOption.REPLACE_EXISTING); | |
Files.copy(originalFilePath, exportedFilePath), StandardCopyOption.REPLACE_EXISTING); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Files.copy(Paths.get(originalFilePath.toString()), Paths.get(exportedFilePath.toString()), StandardCopyOption.REPLACE_EXISTING); | ||
|
||
try (PDDocument importedDocument = Loader.loadPDF(new File(exportedFilePath.toString()))) { | ||
assertNotNull(importedDocument, "The imported document should not be null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use JabRef's PDF Importer for this so you can compare the exported entries with the imported entries
PdfEmbeddedBibFileImporterTest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the importer and commit it
DevCall: Current functionality: One can write for one PDF the XMP data (and an embedded .bib file) to the PDF: Mass update is possible at Currently, File -> Export also offers export to PDF (XMP or embedded .bib file). Which causes an error. In this PR, a new PDF is created if the PDF is not found. We looking forward to user feedback. We should write:
We could even embed the PDFs inside the PDFs. Pro: It is super-easy now. No ZIP-file generation/export and later import. |
* upstream/main: (94 commits) Bump org.openrewrite.rewrite from 6.3.11 to 6.3.16 (JabRef#10442) Update all of lucene Bump org.apache.lucene:lucene-core from 9.7.0 to 9.8.0 Bump com.dlsc.gemsfx:gemsfx from 1.77.0 to 1.82.0 Accept LaTeX errors in comment field (JabRef#10436) Fix NPEs in UrlCleanup (JabRef#10435) Fix triggering workflows (JabRef#10433) Show exception in cleanup error (JabRef#10430) Exclude check for ampersand (&) at verbatim fields (JabRef#10419) fix checkstyle fix escaping of slashes fix checkstyle and l10n Add TeXShop (macOS only) Fix casing First set fetcherWorker properties, then start the worker improve variable names checkstyle Fix fetcher worker execution on background thread Update contributing.md jakarta ...
…in-protected-terms-files * upstream/main: Update src/main/java/org/jabref/logic/exporter/AtomicFileOutputStream.java Fix saving on network drive under macOS Infer DOI from ArXiv identifier (#10449) Add TexShop Icon (#10447) Fix PDF export (#10361) Fixed SpringerFetcherTest and ACMPortalFetcherTest (#10445) Bump org.openrewrite.rewrite from 6.3.11 to 6.3.16 (#10442) Update all of lucene Bump org.apache.lucene:lucene-core from 9.7.0 to 9.8.0 Bump com.dlsc.gemsfx:gemsfx from 1.77.0 to 1.82.0 Accept LaTeX errors in comment field (#10436) fix checkstyle fix escaping of slashes fix checkstyle and l10n Add TeXShop (macOS only)
Fixes #10102
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)