diff --git a/DESCRIPTION b/DESCRIPTION index 542fa19..88465db 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Encoding: UTF-8 Package: xmpdf Type: Package Title: Edit 'XMP' Metadata and 'PDF' Bookmarks and Documentation Info -Version: 0.2.0-0 +Version: 0.2.0-1 Description: Edit 'XMP' metadata in a variety of media file formats as well as edit bookmarks (aka outline aka table of contents) and documentation info entries in 'pdf' files. diff --git a/R/bookmarks.R b/R/bookmarks.R index ecb0a89..17a156d 100644 --- a/R/bookmarks.R +++ b/R/bookmarks.R @@ -436,7 +436,7 @@ set_bookmarks_gs <- function(bookmarks, input, output = input) { shQuote(input), shQuote(system.file("gs/pdfmark_restore.txt", package = "xmpdf")), shQuote(metafile)) - xmpdf_system2(cmd, args) + stdout <- xmpdf_system2(cmd, args) if (input == output) { file.copy(target, output, overwrite = TRUE) } diff --git a/tests/testthat/test-bookmarks.R b/tests/testthat/test-bookmarks.R index 8be2289..1ee1425 100644 --- a/tests/testthat/test-bookmarks.R +++ b/tests/testthat/test-bookmarks.R @@ -72,6 +72,9 @@ test_that("set_bookmarks_gs", { expect_equal(nrow(bm), 3L) expect_equal(attr(bm, "total_pages"), 2L) + gs_version <- numeric_version(system2(find_gs_cmd(), "--version", stdout = TRUE)) + skip_if_not(gs_version <= "9.55.0") + # Does Unicode work skip_if_not(l10n_info()[["UTF-8"]]) skip_on_os("mac") # CRAN checks on macOS 14 @@ -174,6 +177,10 @@ test_that("bookmarks_pdftools", { # Does Unicode work skip_if_not(l10n_info()[["UTF-8"]]) skip_on_os("mac") # CRAN checks on macOS 14 + if(supports_gs()) { + gs_version <- numeric_version(system2(find_gs_cmd(), "--version", stdout = TRUE)) + skip_if_not(gs_version <= "9.55.0") + } bookmarks <- data.frame(title = c("R\u5f88\u68d2\uff01", "Page 1", "Page 2"), level = c(1, 2, 2), page = c(1L, 1L, 2L))