Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] Poppler 23.09.0
@ 2023-09-17 21:02 mhmdanas
  2023-09-17 21:04 ` [PR PATCH] [Updated] " mhmdanas
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: mhmdanas @ 2023-09-17 21:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1278 bytes --]

There is a new pull request by mhmdanas against master on the void-packages repository

https://github.com/mhmdanas/void-packages poppler-23.09.0
https://github.com/void-linux/void-packages/pull/46107

Poppler 23.09.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly** (and built all revdeps successfully)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/46107.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-23.09.0-46107.patch --]
[-- Type: text/x-diff, Size: 26153 bytes --]

From eea6d88fac103f9f4083821c936c483417a41a0a Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 01/35] poppler: update to 23.09.0.

---
 common/shlibs            | 2 +-
 srcpkgs/poppler/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index c9d59ef3b97ca..8c986286965cf 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -346,7 +346,7 @@ libMagickCore-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagickWand-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagick++-7.Q16HDRI.so.5 libmagick-7.0.11.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.130 libpoppler-23.08.0_1
+libpoppler.so.131 libpoppler-23.09.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 2be3e5ab35e47..f615aa5eccc76 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -4,7 +4,7 @@
 #
 # Revbump libreoffice on SO version bumps.
 pkgname=poppler
-version=23.08.0
+version=23.09.0
 revision=1
 _testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
 create_wrksrc=yes
@@ -25,7 +25,7 @@ homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz
  https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
-checksum="4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
+checksum="80d1d44dd8bdf4ac1a47d56c5065075eb9991790974b1ed7d14b972acde88e55
  ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
 
 build_options="gir boost"

From fc2249fa34e0fee2c60888b086e6554217448b48 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 02/35] poppler-qt5: update to 23.09.0.

---
 srcpkgs/poppler-qt5/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a48ed659920e..2b38a0b678831 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,7 +4,7 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=23.08.0
+version=23.09.0
 revision=1
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
@@ -21,7 +21,7 @@ license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz"
-checksum=4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
+checksum=80d1d44dd8bdf4ac1a47d56c5065075eb9991790974b1ed7d14b972acde88e55
 # fails to find a bunch of files
 make_check=no
 

From c22f57f425eec8d151a736f12a6a8b3fae3db6db Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:30 +0100
Subject: [PATCH 03/35] apvlv: revbump for poppler-23.09.0.

---
 srcpkgs/apvlv/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/apvlv/template b/srcpkgs/apvlv/template
index 8d343dbe33586..d3a92540aeb62 100644
--- a/srcpkgs/apvlv/template
+++ b/srcpkgs/apvlv/template
@@ -1,7 +1,7 @@
 # Template file for 'apvlv'
 pkgname=apvlv
 version=0.2.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DAPVLV_WITH_UMD=no -DAPVLV_WITH_DJVU=yes -DAPVLV_WITH_TXT=yes"
 hostmakedepends="pkg-config"

From 8f88c4f2caaf2e327e21835f0b5888d6c175501a Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:30 +0100
Subject: [PATCH 04/35] atril: revbump for poppler-23.09.0.

---
 srcpkgs/atril/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/atril/template b/srcpkgs/atril/template
index 467151a9dc7cb..f5e7db44a2a41 100644
--- a/srcpkgs/atril/template
+++ b/srcpkgs/atril/template
@@ -1,7 +1,7 @@
 # Template file for 'atril'
 pkgname=atril
 version=1.26.1
-revision=1
+revision=2
 build_style=gnu-configure
 build_helper="gir"
 configure_args="--disable-schemas-compile --enable-djvu --enable-synctex=no

From 6b893f1426cf9102bcc7a113a92e1ba8a08c4d85 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 05/35] bookworm: revbump for poppler-23.09.0.

---
 srcpkgs/bookworm/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/bookworm/template b/srcpkgs/bookworm/template
index 0205a6e624275..462031242c0ff 100644
--- a/srcpkgs/bookworm/template
+++ b/srcpkgs/bookworm/template
@@ -1,7 +1,7 @@
 # Template file for 'bookworm'
 pkgname=bookworm
 version=1.1.2
-revision=5
+revision=6
 build_style=meson
 hostmakedepends="pkg-config glib-devel gettext vala"
 makedepends="gtk+3-devel libgee08-devel granite-devel

From 09fe9e269320faf63f586170bf79fdbd3dea25d5 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 06/35] calligra: revbump for poppler-23.09.0.

---
 srcpkgs/calligra/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 5020e13a2eac7..421700baadd3c 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=17
+revision=18
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From ec1a1b555eac4a531fc1cec40bdd8c0129db2abe Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 07/35] citations: revbump for poppler-23.09.0.

---
 srcpkgs/citations/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/citations/template b/srcpkgs/citations/template
index a4162c34544cf..3aca1cb12372e 100644
--- a/srcpkgs/citations/template
+++ b/srcpkgs/citations/template
@@ -1,7 +1,7 @@
 # Template file for 'citations'
 pkgname=citations
 version=0.5.1
-revision=2
+revision=3
 build_style=meson
 build_helper=rust
 hostmakedepends="glib-devel gettext rust cargo pkg-config

From 611a808eea0d9fcf9dd9748573701bbe1cf77588 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 08/35] claws-mail: revbump for poppler-23.09.0.

---
 srcpkgs/claws-mail/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/claws-mail/template b/srcpkgs/claws-mail/template
index b989ebf1d8e43..775a351979aed 100644
--- a/srcpkgs/claws-mail/template
+++ b/srcpkgs/claws-mail/template
@@ -1,7 +1,7 @@
 # Template file for 'claws-mail'
 pkgname=claws-mail
 version=4.1.1
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--disable-static --disable-python-plugin --disable-perl-plugin
  --enable-enchant --enable-gnutls"

From c303e70ae6b971ec2d55ab39a32442ef82e336b0 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 09/35] cups-filters: revbump for poppler-23.09.0.

---
 srcpkgs/cups-filters/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/cups-filters/template b/srcpkgs/cups-filters/template
index 3f592bdda585a..373eac8dbeaad 100644
--- a/srcpkgs/cups-filters/template
+++ b/srcpkgs/cups-filters/template
@@ -1,7 +1,7 @@
 # Template file for 'cups-filters'
 pkgname=cups-filters
 version=1.28.17
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-static --with-rcdir=no --enable-avahi
  --with-browseremoteprotocols=DNSSD,CUPS

From 4b968a7d7a39de9ff52b7750a90c947d557c0056 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 10/35] diff-pdf: revbump for poppler-23.09.0.

---
 srcpkgs/diff-pdf/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/diff-pdf/template b/srcpkgs/diff-pdf/template
index 1b1c1b690814c..dff1f22362cbd 100644
--- a/srcpkgs/diff-pdf/template
+++ b/srcpkgs/diff-pdf/template
@@ -1,7 +1,7 @@
 # Template file for 'diff-pdf'
 pkgname=diff-pdf
 version=0.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-wx-config=wx-config-gtk3"
 hostmakedepends="pkg-config"

From 7ac3743dce21b98d7f8bd343f5090bd73300cf9c Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 11/35] efl: revbump for poppler-23.09.0.

---
 srcpkgs/efl/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/efl/template b/srcpkgs/efl/template
index 020d102b18634..2a0bbf6117896 100644
--- a/srcpkgs/efl/template
+++ b/srcpkgs/efl/template
@@ -1,7 +1,7 @@
 # Template file for 'efl'
 pkgname=efl
 version=1.26.2
-revision=7
+revision=8
 build_style=meson
 configure_args="
  -Dbuild-examples=false

From add29eb9febed8ac109fe40eba37d4a2bb6c360e Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 12/35] epdfview: revbump for poppler-23.09.0.

---
 srcpkgs/epdfview/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/epdfview/template b/srcpkgs/epdfview/template
index 2c6b5774b49d0..c4d377750459a 100644
--- a/srcpkgs/epdfview/template
+++ b/srcpkgs/epdfview/template
@@ -1,7 +1,7 @@
 # Template file for 'epdfview'
 pkgname=epdfview
 version=0.1.8
-revision=12
+revision=13
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="gtk+-devel poppler-glib-devel"

From a401059ccea083412a7fdffa4135619c49d4d766 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 13/35] evince: revbump for poppler-23.09.0.

---
 srcpkgs/evince/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/evince/template b/srcpkgs/evince/template
index 4568a1f329539..9e15f9e5fbdb9 100644
--- a/srcpkgs/evince/template
+++ b/srcpkgs/evince/template
@@ -1,7 +1,7 @@
 # Template file for 'evince'
 pkgname=evince
 version=44.3
-revision=1
+revision=2
 build_helper="gir"
 build_style=meson
 configure_args="$(vopt_bool gir introspection) $(vopt_bool gtk_doc gtk_doc)

From 7ab4452906502097808213e50c2dd7b083c68882 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 14/35] extractpdfmark: revbump for poppler-23.09.0.

---
 srcpkgs/extractpdfmark/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/extractpdfmark/template b/srcpkgs/extractpdfmark/template
index 3e924aae4ea82..1be7c9b222c73 100644
--- a/srcpkgs/extractpdfmark/template
+++ b/srcpkgs/extractpdfmark/template
@@ -1,7 +1,7 @@
 # Template file for 'extractpdfmark'
 pkgname=extractpdfmark
 version=1.1.1
-revision=1
+revision=2
 build_wrksrc=build
 build_style=gnu-configure
 configure_script="../configure"

From 2eb98ad484be5f1e6323eef9c06d2bc50bc39ee9 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 15/35] fbida: revbump for poppler-23.09.0.

---
 srcpkgs/fbida/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/fbida/template b/srcpkgs/fbida/template
index ac9d75dc1d3b4..782ef591c6c4e 100644
--- a/srcpkgs/fbida/template
+++ b/srcpkgs/fbida/template
@@ -1,7 +1,7 @@
 # Template file for 'fbida'
 pkgname=fbida
 version=2.14
-revision=3
+revision=4
 build_style=meson
 hostmakedepends="cmake perl pkg-config cairo-devel libjpeg-turbo-devel"
 # XXX ida needs motif-devel

From c32d22218b37e00e8b7669aa686efd6480d5bd01 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 16/35] gegl: revbump for poppler-23.09.0.

---
 srcpkgs/gegl/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gegl/template b/srcpkgs/gegl/template
index 5d4b070cd703e..b61f8abe041f6 100644
--- a/srcpkgs/gegl/template
+++ b/srcpkgs/gegl/template
@@ -1,7 +1,7 @@
 # Template file for 'gegl'
 pkgname=gegl
 version=0.4.46
-revision=2
+revision=3
 build_style=meson
 build_helper="gir"
 configure_args="-Ddocs=false -Dintrospection=true -Dvapigen=enabled

From 9b55dc2ee67d60282d3a2b61604a5dd6b635f5ab Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 17/35] gimp: revbump for poppler-23.09.0.

---
 srcpkgs/gimp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gimp/template b/srcpkgs/gimp/template
index 336e33ae83cce..9321de1ff9610 100644
--- a/srcpkgs/gimp/template
+++ b/srcpkgs/gimp/template
@@ -1,7 +1,7 @@
 # Template file for 'gimp'
 pkgname=gimp
 version=2.10.34
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-check-update --datadir=/usr/share"
 hostmakedepends="automake gegl gettext-devel glib-devel gtk+-devel intltool

From df113823150592cd78843f2f40866f0619a372fa Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 18/35] gloobus-preview: revbump for poppler-23.09.0.

---
 srcpkgs/gloobus-preview/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gloobus-preview/template b/srcpkgs/gloobus-preview/template
index 28dd6f126490a..9bf343bf89a48 100644
--- a/srcpkgs/gloobus-preview/template
+++ b/srcpkgs/gloobus-preview/template
@@ -1,7 +1,7 @@
 # Template file for 'gloobus-preview'
 pkgname=gloobus-preview
 version=2015.12.21
-revision=7
+revision=8
 build_style=gnu-configure
 hostmakedepends="automake libtool pkg-config python3 gettext-devel xz"
 makedepends="gettext-devel boost-devel gtk+3-devel gtksourceview-devel

From 5b20467af7bab22c1502f5ea40e2e928d4bc94bc Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 19/35] gummi: revbump for poppler-23.09.0.

---
 srcpkgs/gummi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gummi/template b/srcpkgs/gummi/template
index fe1ae455c5521..be5d402d225cd 100644
--- a/srcpkgs/gummi/template
+++ b/srcpkgs/gummi/template
@@ -1,7 +1,7 @@
 # Template file for 'gummi'
 pkgname=gummi
 version=0.8.3
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake intltool pkg-config glib-devel gtk+3-devel gettext-devel"
 makedepends="gtksourceview-devel glib-devel gtk+3-devel poppler-glib-devel

From adcb48086aeed2f7b7e90ebb9dd14717c32fa7db Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 20/35] inkscape: revbump for poppler-23.09.0.

---
 srcpkgs/inkscape/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 1e0e2c26b5c58..305b9936ddeae 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.3
-revision=3
+revision=4
 build_style=cmake
 make_check_target="check"
 hostmakedepends="automake gettext glib-devel intltool libgraphicsmagick-devel

From 3d305a9cf7fe603bfd978a86294bd73f983849c7 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 21/35] ipe: revbump for poppler-23.09.0.

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index ec7b4b5dc3dcb..30cb18e219573 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.26
-revision=10
+revision=11
 _tools_commit=v7.2.24.1
 create_wrksrc=yes
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"

From fdf87aa666861687bc533b68402246bd942d5ac7 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 22/35] kitinerary: revbump for poppler-23.09.0.

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 31236a166ef2c..5575e4dfb57f5 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=23.08.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config
  qt5-host-tools qt5-qmake qt5-tools-devel"

From 42c95a4dad1496f8b41a392918ecf2908e06ab9c Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 23/35] libreoffice: revbump for poppler-23.09.0.

---
 srcpkgs/libreoffice/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libreoffice/template b/srcpkgs/libreoffice/template
index 6672dd787a0a9..e4cc15b3b9919 100644
--- a/srcpkgs/libreoffice/template
+++ b/srcpkgs/libreoffice/template
@@ -1,7 +1,7 @@
 # Template file for 'libreoffice'
 pkgname=libreoffice
 version=7.6.0.3
-revision=2
+revision=3
 build_style=meta
 make_build_target="build"
 hostmakedepends="automake flex gperf hyphen icu libtool openldap which gettext xz

From 49b957cadddede9baa6b34bd443d857c69659f95 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 24/35] osg: revbump for poppler-23.09.0.

---
 srcpkgs/osg/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/osg/template b/srcpkgs/osg/template
index a9ebbd287933b..8ef0efc599a1b 100644
--- a/srcpkgs/osg/template
+++ b/srcpkgs/osg/template
@@ -1,7 +1,7 @@
 # Template file for 'osg'
 pkgname=osg
 version=3.6.5
-revision=2
+revision=3
 build_style=cmake
 build_helper="qemu"
 # don't use /usr/lib64 on 64bit platforms

From 6ab485355900ea20862fb2996cf8f5e3ca8e5c9e Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 25/35] pdf2djvu: revbump for poppler-23.09.0.

---
 srcpkgs/pdf2djvu/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdf2djvu/template b/srcpkgs/pdf2djvu/template
index ef7433c0c98ae..5a6f3ddf4ed35 100644
--- a/srcpkgs/pdf2djvu/template
+++ b/srcpkgs/pdf2djvu/template
@@ -1,7 +1,7 @@
 # Template file for 'pdf2djvu'
 pkgname=pdf2djvu
 version=0.9.19
-revision=4
+revision=5
 build_style=gnu-configure
 hostmakedepends="pkg-config djvulibre gettext"
 makedepends="djvulibre-devel poppler-devel libgraphicsmagick-devel exiv2-devel libuuid-devel"

From 84211b726f26fb25445186d0b010f34cea52bc44 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 26/35] pdfgrep: revbump for poppler-23.09.0.

---
 srcpkgs/pdfgrep/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdfgrep/template b/srcpkgs/pdfgrep/template
index 478c20aa1a63e..545e509dfba9d 100644
--- a/srcpkgs/pdfgrep/template
+++ b/srcpkgs/pdfgrep/template
@@ -1,7 +1,7 @@
 # Template file for 'pdfgrep'
 pkgname=pdfgrep
 version=2.1.2
-revision=2
+revision=3
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="libgcrypt-devel poppler-cpp-devel pcre-devel"

From fa776f41c5c72be74096af708a1474092c2df512 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 27/35] pdfpc: revbump for poppler-23.09.0.

---
 srcpkgs/pdfpc/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdfpc/template b/srcpkgs/pdfpc/template
index 450a9f300730e..070875a30ed44 100644
--- a/srcpkgs/pdfpc/template
+++ b/srcpkgs/pdfpc/template
@@ -1,7 +1,7 @@
 # Template file for 'pdfpc'
 pkgname=pdfpc
 version=4.6.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config vala libgee08-devel"
 makedepends="gst-plugins-base1-devel gtk+3-devel libgee08-devel

From 5586d0fa59f274a3522683b747a733aac5a79d14 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 28/35] pdftag: revbump for poppler-23.09.0.

---
 srcpkgs/pdftag/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdftag/template b/srcpkgs/pdftag/template
index 91fda3c33dc84..775505090f205 100644
--- a/srcpkgs/pdftag/template
+++ b/srcpkgs/pdftag/template
@@ -1,7 +1,7 @@
 # Template file for 'pdftag'
 pkgname=pdftag
 version=1.0.5
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="glib-devel pkg-config vala"
 makedepends="gtk+3-devel poppler-glib-devel"

From d88df7d9400048e0c2c4a1a5bc95f94c69a4259a Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 29/35] scribus: revbump for poppler-23.09.0.

---
 srcpkgs/scribus/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 8a6f408500563..22630f1368191 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,7 +1,7 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=10
+revision=11
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
  -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"

From d9fe676e0ba3478134419be5a965458e79b36f18 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 30/35] tracker-miners: revbump for poppler-23.09.0.

---
 srcpkgs/tracker-miners/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tracker-miners/template b/srcpkgs/tracker-miners/template
index a6e5aa5777024..aa0f443927cdb 100644
--- a/srcpkgs/tracker-miners/template
+++ b/srcpkgs/tracker-miners/template
@@ -1,7 +1,7 @@
 # Template file for 'tracker-miners'
 pkgname=tracker-miners
 version=3.5.0
-revision=4
+revision=5
 build_style=meson
 build_helper=qemu
 # missing libgrss for miner_rss

From 8d5baf348e88a92bf0e62cebe8d7ba46a736b6c9 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 31/35] tumbler: revbump for poppler-23.09.0.

---
 srcpkgs/tumbler/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tumbler/template b/srcpkgs/tumbler/template
index 73cec71187c0e..6ffc745d07c23 100644
--- a/srcpkgs/tumbler/template
+++ b/srcpkgs/tumbler/template
@@ -1,7 +1,7 @@
 # Template file for 'tumbler'
 pkgname=tumbler
 version=4.18.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-locales-dir=/usr/share/locale
  --disable-gstreamer-thumbnailer --enable-poppler-thumbnailer"

From 9cae7cd21c8492aa613a028b877300d3c4f3e7c2 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 32/35] vips: revbump for poppler-23.09.0.

---
 srcpkgs/vips/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/vips/template b/srcpkgs/vips/template
index 6b08ed1088e38..53dee079ec882 100644
--- a/srcpkgs/vips/template
+++ b/srcpkgs/vips/template
@@ -1,7 +1,7 @@
 # Template file for 'vips'
 pkgname=vips
 version=8.14.4
-revision=1
+revision=2
 build_style=meson
 build_helper=gir
 # TODO: As of version 8.11 vips supports loading its support for OpenSlide,

From 7e43a6d9334d363fb2123189473b1fc0676ff580 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 33/35] xournalpp: revbump for poppler-23.09.0.

---
 srcpkgs/xournalpp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/xournalpp/template b/srcpkgs/xournalpp/template
index 6a75645c965bf..c90f2b5ff02c0 100644
--- a/srcpkgs/xournalpp/template
+++ b/srcpkgs/xournalpp/template
@@ -1,7 +1,7 @@
 # Template file for 'xournalpp'
 pkgname=xournalpp
 version=1.2.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config gettext"
 makedepends="libxml2-devel libcppunit-devel poppler-glib-devel gtk+3-devel

From 9dcff6ab79a5d7a2af64c9d70dad2e04c030f6b5 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 34/35] xreader: revbump for poppler-23.09.0.

---
 srcpkgs/xreader/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/xreader/template b/srcpkgs/xreader/template
index 3712f8751c094..953990e3858c2 100644
--- a/srcpkgs/xreader/template
+++ b/srcpkgs/xreader/template
@@ -1,7 +1,7 @@
 # Template file for 'xreader'
 pkgname=xreader
 version=3.8.2
-revision=1
+revision=2
 build_style=meson
 build_helper="gir"
 configure_args="-Dintrospection=$(vopt_if gir true false) -Dthumbnailer=false"

From 8f3db7e91d093db894b569fbe75ceda6a9a9a34a Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 35/35] zathura-pdf-poppler: revbump for poppler-23.09.0.

---
 srcpkgs/zathura-pdf-poppler/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/zathura-pdf-poppler/template b/srcpkgs/zathura-pdf-poppler/template
index 292cf08cd96b4..908202fd1c61f 100644
--- a/srcpkgs/zathura-pdf-poppler/template
+++ b/srcpkgs/zathura-pdf-poppler/template
@@ -1,7 +1,7 @@
 # Template file for 'zathura-pdf-poppler'
 pkgname=zathura-pdf-poppler
 version=0.3.1
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config"
 makedepends="poppler-devel poppler-glib-devel zathura-devel"

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] Poppler 23.09.0
  2023-09-17 21:02 [PR PATCH] Poppler 23.09.0 mhmdanas
@ 2023-09-17 21:04 ` mhmdanas
  2023-09-18 10:50 ` [PR REVIEW] " sgn
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mhmdanas @ 2023-09-17 21:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

There is an updated pull request by mhmdanas against master on the void-packages repository

https://github.com/mhmdanas/void-packages poppler-23.09.0
https://github.com/void-linux/void-packages/pull/46107

Poppler 23.09.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly** (and built all revdeps successfully)

[ci skip]

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/46107.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-23.09.0-46107.patch --]
[-- Type: text/x-diff, Size: 26153 bytes --]

From eea6d88fac103f9f4083821c936c483417a41a0a Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 01/35] poppler: update to 23.09.0.

---
 common/shlibs            | 2 +-
 srcpkgs/poppler/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index c9d59ef3b97ca..8c986286965cf 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -346,7 +346,7 @@ libMagickCore-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagickWand-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagick++-7.Q16HDRI.so.5 libmagick-7.0.11.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.130 libpoppler-23.08.0_1
+libpoppler.so.131 libpoppler-23.09.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 2be3e5ab35e47..f615aa5eccc76 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -4,7 +4,7 @@
 #
 # Revbump libreoffice on SO version bumps.
 pkgname=poppler
-version=23.08.0
+version=23.09.0
 revision=1
 _testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
 create_wrksrc=yes
@@ -25,7 +25,7 @@ homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz
  https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
-checksum="4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
+checksum="80d1d44dd8bdf4ac1a47d56c5065075eb9991790974b1ed7d14b972acde88e55
  ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
 
 build_options="gir boost"

From fc2249fa34e0fee2c60888b086e6554217448b48 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 02/35] poppler-qt5: update to 23.09.0.

---
 srcpkgs/poppler-qt5/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a48ed659920e..2b38a0b678831 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,7 +4,7 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=23.08.0
+version=23.09.0
 revision=1
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
@@ -21,7 +21,7 @@ license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz"
-checksum=4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
+checksum=80d1d44dd8bdf4ac1a47d56c5065075eb9991790974b1ed7d14b972acde88e55
 # fails to find a bunch of files
 make_check=no
 

From c22f57f425eec8d151a736f12a6a8b3fae3db6db Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:30 +0100
Subject: [PATCH 03/35] apvlv: revbump for poppler-23.09.0.

---
 srcpkgs/apvlv/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/apvlv/template b/srcpkgs/apvlv/template
index 8d343dbe33586..d3a92540aeb62 100644
--- a/srcpkgs/apvlv/template
+++ b/srcpkgs/apvlv/template
@@ -1,7 +1,7 @@
 # Template file for 'apvlv'
 pkgname=apvlv
 version=0.2.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DAPVLV_WITH_UMD=no -DAPVLV_WITH_DJVU=yes -DAPVLV_WITH_TXT=yes"
 hostmakedepends="pkg-config"

From 8f88c4f2caaf2e327e21835f0b5888d6c175501a Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:30 +0100
Subject: [PATCH 04/35] atril: revbump for poppler-23.09.0.

---
 srcpkgs/atril/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/atril/template b/srcpkgs/atril/template
index 467151a9dc7cb..f5e7db44a2a41 100644
--- a/srcpkgs/atril/template
+++ b/srcpkgs/atril/template
@@ -1,7 +1,7 @@
 # Template file for 'atril'
 pkgname=atril
 version=1.26.1
-revision=1
+revision=2
 build_style=gnu-configure
 build_helper="gir"
 configure_args="--disable-schemas-compile --enable-djvu --enable-synctex=no

From 6b893f1426cf9102bcc7a113a92e1ba8a08c4d85 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 05/35] bookworm: revbump for poppler-23.09.0.

---
 srcpkgs/bookworm/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/bookworm/template b/srcpkgs/bookworm/template
index 0205a6e624275..462031242c0ff 100644
--- a/srcpkgs/bookworm/template
+++ b/srcpkgs/bookworm/template
@@ -1,7 +1,7 @@
 # Template file for 'bookworm'
 pkgname=bookworm
 version=1.1.2
-revision=5
+revision=6
 build_style=meson
 hostmakedepends="pkg-config glib-devel gettext vala"
 makedepends="gtk+3-devel libgee08-devel granite-devel

From 09fe9e269320faf63f586170bf79fdbd3dea25d5 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 06/35] calligra: revbump for poppler-23.09.0.

---
 srcpkgs/calligra/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 5020e13a2eac7..421700baadd3c 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=17
+revision=18
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From ec1a1b555eac4a531fc1cec40bdd8c0129db2abe Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 07/35] citations: revbump for poppler-23.09.0.

---
 srcpkgs/citations/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/citations/template b/srcpkgs/citations/template
index a4162c34544cf..3aca1cb12372e 100644
--- a/srcpkgs/citations/template
+++ b/srcpkgs/citations/template
@@ -1,7 +1,7 @@
 # Template file for 'citations'
 pkgname=citations
 version=0.5.1
-revision=2
+revision=3
 build_style=meson
 build_helper=rust
 hostmakedepends="glib-devel gettext rust cargo pkg-config

From 611a808eea0d9fcf9dd9748573701bbe1cf77588 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 08/35] claws-mail: revbump for poppler-23.09.0.

---
 srcpkgs/claws-mail/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/claws-mail/template b/srcpkgs/claws-mail/template
index b989ebf1d8e43..775a351979aed 100644
--- a/srcpkgs/claws-mail/template
+++ b/srcpkgs/claws-mail/template
@@ -1,7 +1,7 @@
 # Template file for 'claws-mail'
 pkgname=claws-mail
 version=4.1.1
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--disable-static --disable-python-plugin --disable-perl-plugin
  --enable-enchant --enable-gnutls"

From c303e70ae6b971ec2d55ab39a32442ef82e336b0 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 09/35] cups-filters: revbump for poppler-23.09.0.

---
 srcpkgs/cups-filters/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/cups-filters/template b/srcpkgs/cups-filters/template
index 3f592bdda585a..373eac8dbeaad 100644
--- a/srcpkgs/cups-filters/template
+++ b/srcpkgs/cups-filters/template
@@ -1,7 +1,7 @@
 # Template file for 'cups-filters'
 pkgname=cups-filters
 version=1.28.17
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-static --with-rcdir=no --enable-avahi
  --with-browseremoteprotocols=DNSSD,CUPS

From 4b968a7d7a39de9ff52b7750a90c947d557c0056 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 10/35] diff-pdf: revbump for poppler-23.09.0.

---
 srcpkgs/diff-pdf/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/diff-pdf/template b/srcpkgs/diff-pdf/template
index 1b1c1b690814c..dff1f22362cbd 100644
--- a/srcpkgs/diff-pdf/template
+++ b/srcpkgs/diff-pdf/template
@@ -1,7 +1,7 @@
 # Template file for 'diff-pdf'
 pkgname=diff-pdf
 version=0.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-wx-config=wx-config-gtk3"
 hostmakedepends="pkg-config"

From 7ac3743dce21b98d7f8bd343f5090bd73300cf9c Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 11/35] efl: revbump for poppler-23.09.0.

---
 srcpkgs/efl/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/efl/template b/srcpkgs/efl/template
index 020d102b18634..2a0bbf6117896 100644
--- a/srcpkgs/efl/template
+++ b/srcpkgs/efl/template
@@ -1,7 +1,7 @@
 # Template file for 'efl'
 pkgname=efl
 version=1.26.2
-revision=7
+revision=8
 build_style=meson
 configure_args="
  -Dbuild-examples=false

From add29eb9febed8ac109fe40eba37d4a2bb6c360e Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 12/35] epdfview: revbump for poppler-23.09.0.

---
 srcpkgs/epdfview/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/epdfview/template b/srcpkgs/epdfview/template
index 2c6b5774b49d0..c4d377750459a 100644
--- a/srcpkgs/epdfview/template
+++ b/srcpkgs/epdfview/template
@@ -1,7 +1,7 @@
 # Template file for 'epdfview'
 pkgname=epdfview
 version=0.1.8
-revision=12
+revision=13
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="gtk+-devel poppler-glib-devel"

From a401059ccea083412a7fdffa4135619c49d4d766 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 13/35] evince: revbump for poppler-23.09.0.

---
 srcpkgs/evince/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/evince/template b/srcpkgs/evince/template
index 4568a1f329539..9e15f9e5fbdb9 100644
--- a/srcpkgs/evince/template
+++ b/srcpkgs/evince/template
@@ -1,7 +1,7 @@
 # Template file for 'evince'
 pkgname=evince
 version=44.3
-revision=1
+revision=2
 build_helper="gir"
 build_style=meson
 configure_args="$(vopt_bool gir introspection) $(vopt_bool gtk_doc gtk_doc)

From 7ab4452906502097808213e50c2dd7b083c68882 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 14/35] extractpdfmark: revbump for poppler-23.09.0.

---
 srcpkgs/extractpdfmark/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/extractpdfmark/template b/srcpkgs/extractpdfmark/template
index 3e924aae4ea82..1be7c9b222c73 100644
--- a/srcpkgs/extractpdfmark/template
+++ b/srcpkgs/extractpdfmark/template
@@ -1,7 +1,7 @@
 # Template file for 'extractpdfmark'
 pkgname=extractpdfmark
 version=1.1.1
-revision=1
+revision=2
 build_wrksrc=build
 build_style=gnu-configure
 configure_script="../configure"

From 2eb98ad484be5f1e6323eef9c06d2bc50bc39ee9 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 15/35] fbida: revbump for poppler-23.09.0.

---
 srcpkgs/fbida/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/fbida/template b/srcpkgs/fbida/template
index ac9d75dc1d3b4..782ef591c6c4e 100644
--- a/srcpkgs/fbida/template
+++ b/srcpkgs/fbida/template
@@ -1,7 +1,7 @@
 # Template file for 'fbida'
 pkgname=fbida
 version=2.14
-revision=3
+revision=4
 build_style=meson
 hostmakedepends="cmake perl pkg-config cairo-devel libjpeg-turbo-devel"
 # XXX ida needs motif-devel

From c32d22218b37e00e8b7669aa686efd6480d5bd01 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 16/35] gegl: revbump for poppler-23.09.0.

---
 srcpkgs/gegl/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gegl/template b/srcpkgs/gegl/template
index 5d4b070cd703e..b61f8abe041f6 100644
--- a/srcpkgs/gegl/template
+++ b/srcpkgs/gegl/template
@@ -1,7 +1,7 @@
 # Template file for 'gegl'
 pkgname=gegl
 version=0.4.46
-revision=2
+revision=3
 build_style=meson
 build_helper="gir"
 configure_args="-Ddocs=false -Dintrospection=true -Dvapigen=enabled

From 9b55dc2ee67d60282d3a2b61604a5dd6b635f5ab Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 17/35] gimp: revbump for poppler-23.09.0.

---
 srcpkgs/gimp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gimp/template b/srcpkgs/gimp/template
index 336e33ae83cce..9321de1ff9610 100644
--- a/srcpkgs/gimp/template
+++ b/srcpkgs/gimp/template
@@ -1,7 +1,7 @@
 # Template file for 'gimp'
 pkgname=gimp
 version=2.10.34
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-check-update --datadir=/usr/share"
 hostmakedepends="automake gegl gettext-devel glib-devel gtk+-devel intltool

From df113823150592cd78843f2f40866f0619a372fa Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 18/35] gloobus-preview: revbump for poppler-23.09.0.

---
 srcpkgs/gloobus-preview/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gloobus-preview/template b/srcpkgs/gloobus-preview/template
index 28dd6f126490a..9bf343bf89a48 100644
--- a/srcpkgs/gloobus-preview/template
+++ b/srcpkgs/gloobus-preview/template
@@ -1,7 +1,7 @@
 # Template file for 'gloobus-preview'
 pkgname=gloobus-preview
 version=2015.12.21
-revision=7
+revision=8
 build_style=gnu-configure
 hostmakedepends="automake libtool pkg-config python3 gettext-devel xz"
 makedepends="gettext-devel boost-devel gtk+3-devel gtksourceview-devel

From 5b20467af7bab22c1502f5ea40e2e928d4bc94bc Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 19/35] gummi: revbump for poppler-23.09.0.

---
 srcpkgs/gummi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gummi/template b/srcpkgs/gummi/template
index fe1ae455c5521..be5d402d225cd 100644
--- a/srcpkgs/gummi/template
+++ b/srcpkgs/gummi/template
@@ -1,7 +1,7 @@
 # Template file for 'gummi'
 pkgname=gummi
 version=0.8.3
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake intltool pkg-config glib-devel gtk+3-devel gettext-devel"
 makedepends="gtksourceview-devel glib-devel gtk+3-devel poppler-glib-devel

From adcb48086aeed2f7b7e90ebb9dd14717c32fa7db Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 20/35] inkscape: revbump for poppler-23.09.0.

---
 srcpkgs/inkscape/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 1e0e2c26b5c58..305b9936ddeae 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.3
-revision=3
+revision=4
 build_style=cmake
 make_check_target="check"
 hostmakedepends="automake gettext glib-devel intltool libgraphicsmagick-devel

From 3d305a9cf7fe603bfd978a86294bd73f983849c7 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 21/35] ipe: revbump for poppler-23.09.0.

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index ec7b4b5dc3dcb..30cb18e219573 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.26
-revision=10
+revision=11
 _tools_commit=v7.2.24.1
 create_wrksrc=yes
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"

From fdf87aa666861687bc533b68402246bd942d5ac7 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 22/35] kitinerary: revbump for poppler-23.09.0.

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 31236a166ef2c..5575e4dfb57f5 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=23.08.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config
  qt5-host-tools qt5-qmake qt5-tools-devel"

From 42c95a4dad1496f8b41a392918ecf2908e06ab9c Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 23/35] libreoffice: revbump for poppler-23.09.0.

---
 srcpkgs/libreoffice/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libreoffice/template b/srcpkgs/libreoffice/template
index 6672dd787a0a9..e4cc15b3b9919 100644
--- a/srcpkgs/libreoffice/template
+++ b/srcpkgs/libreoffice/template
@@ -1,7 +1,7 @@
 # Template file for 'libreoffice'
 pkgname=libreoffice
 version=7.6.0.3
-revision=2
+revision=3
 build_style=meta
 make_build_target="build"
 hostmakedepends="automake flex gperf hyphen icu libtool openldap which gettext xz

From 49b957cadddede9baa6b34bd443d857c69659f95 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 24/35] osg: revbump for poppler-23.09.0.

---
 srcpkgs/osg/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/osg/template b/srcpkgs/osg/template
index a9ebbd287933b..8ef0efc599a1b 100644
--- a/srcpkgs/osg/template
+++ b/srcpkgs/osg/template
@@ -1,7 +1,7 @@
 # Template file for 'osg'
 pkgname=osg
 version=3.6.5
-revision=2
+revision=3
 build_style=cmake
 build_helper="qemu"
 # don't use /usr/lib64 on 64bit platforms

From 6ab485355900ea20862fb2996cf8f5e3ca8e5c9e Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 25/35] pdf2djvu: revbump for poppler-23.09.0.

---
 srcpkgs/pdf2djvu/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdf2djvu/template b/srcpkgs/pdf2djvu/template
index ef7433c0c98ae..5a6f3ddf4ed35 100644
--- a/srcpkgs/pdf2djvu/template
+++ b/srcpkgs/pdf2djvu/template
@@ -1,7 +1,7 @@
 # Template file for 'pdf2djvu'
 pkgname=pdf2djvu
 version=0.9.19
-revision=4
+revision=5
 build_style=gnu-configure
 hostmakedepends="pkg-config djvulibre gettext"
 makedepends="djvulibre-devel poppler-devel libgraphicsmagick-devel exiv2-devel libuuid-devel"

From 84211b726f26fb25445186d0b010f34cea52bc44 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 26/35] pdfgrep: revbump for poppler-23.09.0.

---
 srcpkgs/pdfgrep/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdfgrep/template b/srcpkgs/pdfgrep/template
index 478c20aa1a63e..545e509dfba9d 100644
--- a/srcpkgs/pdfgrep/template
+++ b/srcpkgs/pdfgrep/template
@@ -1,7 +1,7 @@
 # Template file for 'pdfgrep'
 pkgname=pdfgrep
 version=2.1.2
-revision=2
+revision=3
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="libgcrypt-devel poppler-cpp-devel pcre-devel"

From fa776f41c5c72be74096af708a1474092c2df512 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 27/35] pdfpc: revbump for poppler-23.09.0.

---
 srcpkgs/pdfpc/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdfpc/template b/srcpkgs/pdfpc/template
index 450a9f300730e..070875a30ed44 100644
--- a/srcpkgs/pdfpc/template
+++ b/srcpkgs/pdfpc/template
@@ -1,7 +1,7 @@
 # Template file for 'pdfpc'
 pkgname=pdfpc
 version=4.6.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config vala libgee08-devel"
 makedepends="gst-plugins-base1-devel gtk+3-devel libgee08-devel

From 5586d0fa59f274a3522683b747a733aac5a79d14 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 28/35] pdftag: revbump for poppler-23.09.0.

---
 srcpkgs/pdftag/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdftag/template b/srcpkgs/pdftag/template
index 91fda3c33dc84..775505090f205 100644
--- a/srcpkgs/pdftag/template
+++ b/srcpkgs/pdftag/template
@@ -1,7 +1,7 @@
 # Template file for 'pdftag'
 pkgname=pdftag
 version=1.0.5
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="glib-devel pkg-config vala"
 makedepends="gtk+3-devel poppler-glib-devel"

From d88df7d9400048e0c2c4a1a5bc95f94c69a4259a Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 29/35] scribus: revbump for poppler-23.09.0.

---
 srcpkgs/scribus/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 8a6f408500563..22630f1368191 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,7 +1,7 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=10
+revision=11
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
  -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"

From d9fe676e0ba3478134419be5a965458e79b36f18 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 30/35] tracker-miners: revbump for poppler-23.09.0.

---
 srcpkgs/tracker-miners/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tracker-miners/template b/srcpkgs/tracker-miners/template
index a6e5aa5777024..aa0f443927cdb 100644
--- a/srcpkgs/tracker-miners/template
+++ b/srcpkgs/tracker-miners/template
@@ -1,7 +1,7 @@
 # Template file for 'tracker-miners'
 pkgname=tracker-miners
 version=3.5.0
-revision=4
+revision=5
 build_style=meson
 build_helper=qemu
 # missing libgrss for miner_rss

From 8d5baf348e88a92bf0e62cebe8d7ba46a736b6c9 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 31/35] tumbler: revbump for poppler-23.09.0.

---
 srcpkgs/tumbler/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tumbler/template b/srcpkgs/tumbler/template
index 73cec71187c0e..6ffc745d07c23 100644
--- a/srcpkgs/tumbler/template
+++ b/srcpkgs/tumbler/template
@@ -1,7 +1,7 @@
 # Template file for 'tumbler'
 pkgname=tumbler
 version=4.18.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-locales-dir=/usr/share/locale
  --disable-gstreamer-thumbnailer --enable-poppler-thumbnailer"

From 9cae7cd21c8492aa613a028b877300d3c4f3e7c2 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 32/35] vips: revbump for poppler-23.09.0.

---
 srcpkgs/vips/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/vips/template b/srcpkgs/vips/template
index 6b08ed1088e38..53dee079ec882 100644
--- a/srcpkgs/vips/template
+++ b/srcpkgs/vips/template
@@ -1,7 +1,7 @@
 # Template file for 'vips'
 pkgname=vips
 version=8.14.4
-revision=1
+revision=2
 build_style=meson
 build_helper=gir
 # TODO: As of version 8.11 vips supports loading its support for OpenSlide,

From 7e43a6d9334d363fb2123189473b1fc0676ff580 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 33/35] xournalpp: revbump for poppler-23.09.0.

---
 srcpkgs/xournalpp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/xournalpp/template b/srcpkgs/xournalpp/template
index 6a75645c965bf..c90f2b5ff02c0 100644
--- a/srcpkgs/xournalpp/template
+++ b/srcpkgs/xournalpp/template
@@ -1,7 +1,7 @@
 # Template file for 'xournalpp'
 pkgname=xournalpp
 version=1.2.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config gettext"
 makedepends="libxml2-devel libcppunit-devel poppler-glib-devel gtk+3-devel

From 3a966fd1157ebe8a9ef6ef77e820207e2f764b74 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 34/35] zathura-pdf-poppler: revbump for poppler-23.09.0.

---
 srcpkgs/zathura-pdf-poppler/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/zathura-pdf-poppler/template b/srcpkgs/zathura-pdf-poppler/template
index 292cf08cd96b4..908202fd1c61f 100644
--- a/srcpkgs/zathura-pdf-poppler/template
+++ b/srcpkgs/zathura-pdf-poppler/template
@@ -1,7 +1,7 @@
 # Template file for 'zathura-pdf-poppler'
 pkgname=zathura-pdf-poppler
 version=0.3.1
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config"
 makedepends="poppler-devel poppler-glib-devel zathura-devel"

From 38ab412567cd2a519eaca78927ce8e51921f147c Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 35/35] xreader: revbump for poppler-23.09.0.

---
 srcpkgs/xreader/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/xreader/template b/srcpkgs/xreader/template
index 3712f8751c094..953990e3858c2 100644
--- a/srcpkgs/xreader/template
+++ b/srcpkgs/xreader/template
@@ -1,7 +1,7 @@
 # Template file for 'xreader'
 pkgname=xreader
 version=3.8.2
-revision=1
+revision=2
 build_style=meson
 build_helper="gir"
 configure_args="-Dintrospection=$(vopt_if gir true false) -Dthumbnailer=false"

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR REVIEW] Poppler 23.09.0
  2023-09-17 21:02 [PR PATCH] Poppler 23.09.0 mhmdanas
  2023-09-17 21:04 ` [PR PATCH] [Updated] " mhmdanas
@ 2023-09-18 10:50 ` sgn
  2023-09-20 12:26 ` [PR PATCH] [Updated] " mhmdanas
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: sgn @ 2023-09-18 10:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 160 bytes --]

New review comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/46107#discussion_r1328547477

Comment:
Remove this line

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] Poppler 23.09.0
  2023-09-17 21:02 [PR PATCH] Poppler 23.09.0 mhmdanas
  2023-09-17 21:04 ` [PR PATCH] [Updated] " mhmdanas
  2023-09-18 10:50 ` [PR REVIEW] " sgn
@ 2023-09-20 12:26 ` mhmdanas
  2023-12-12 18:02 ` mhmdanas
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mhmdanas @ 2023-09-20 12:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

There is an updated pull request by mhmdanas against master on the void-packages repository

https://github.com/mhmdanas/void-packages poppler-23.09.0
https://github.com/void-linux/void-packages/pull/46107

Poppler 23.09.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly** (and built all revdeps successfully)

[ci skip]

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/46107.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-23.09.0-46107.patch --]
[-- Type: text/x-diff, Size: 26251 bytes --]

From 5048dbe5ba5866df0027fee1626bc596fc56e109 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 01/35] poppler: update to 23.09.0.

---
 common/shlibs            | 2 +-
 srcpkgs/poppler/template | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index c9d59ef3b97ca..8c986286965cf 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -346,7 +346,7 @@ libMagickCore-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagickWand-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagick++-7.Q16HDRI.so.5 libmagick-7.0.11.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.130 libpoppler-23.08.0_1
+libpoppler.so.131 libpoppler-23.09.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 2be3e5ab35e47..a5e237f9d79d4 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -1,10 +1,8 @@
 # Template file for 'poppler'
 #
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
-#
-# Revbump libreoffice on SO version bumps.
 pkgname=poppler
-version=23.08.0
+version=23.09.0
 revision=1
 _testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
 create_wrksrc=yes
@@ -25,7 +23,7 @@ homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz
  https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
-checksum="4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
+checksum="80d1d44dd8bdf4ac1a47d56c5065075eb9991790974b1ed7d14b972acde88e55
  ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
 
 build_options="gir boost"

From 3252935b8f8b19ae1ee33d7cf741e310e733599b Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 02/35] poppler-qt5: update to 23.09.0.

---
 srcpkgs/poppler-qt5/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a48ed659920e..2b38a0b678831 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,7 +4,7 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=23.08.0
+version=23.09.0
 revision=1
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
@@ -21,7 +21,7 @@ license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz"
-checksum=4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
+checksum=80d1d44dd8bdf4ac1a47d56c5065075eb9991790974b1ed7d14b972acde88e55
 # fails to find a bunch of files
 make_check=no
 

From e5a76155a9a7d4b519ec197b2260facef98ad905 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:30 +0100
Subject: [PATCH 03/35] apvlv: revbump for poppler-23.09.0.

---
 srcpkgs/apvlv/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/apvlv/template b/srcpkgs/apvlv/template
index 8d343dbe33586..d3a92540aeb62 100644
--- a/srcpkgs/apvlv/template
+++ b/srcpkgs/apvlv/template
@@ -1,7 +1,7 @@
 # Template file for 'apvlv'
 pkgname=apvlv
 version=0.2.0
-revision=1
+revision=2
 build_style=cmake
 configure_args="-DAPVLV_WITH_UMD=no -DAPVLV_WITH_DJVU=yes -DAPVLV_WITH_TXT=yes"
 hostmakedepends="pkg-config"

From 669d26800ebb40751a8581165a30d5828854b6ca Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:30 +0100
Subject: [PATCH 04/35] atril: revbump for poppler-23.09.0.

---
 srcpkgs/atril/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/atril/template b/srcpkgs/atril/template
index 467151a9dc7cb..f5e7db44a2a41 100644
--- a/srcpkgs/atril/template
+++ b/srcpkgs/atril/template
@@ -1,7 +1,7 @@
 # Template file for 'atril'
 pkgname=atril
 version=1.26.1
-revision=1
+revision=2
 build_style=gnu-configure
 build_helper="gir"
 configure_args="--disable-schemas-compile --enable-djvu --enable-synctex=no

From ef74cd7d0265c46073b0ce4c7f842a19798a01b5 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 05/35] bookworm: revbump for poppler-23.09.0.

---
 srcpkgs/bookworm/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/bookworm/template b/srcpkgs/bookworm/template
index 0205a6e624275..462031242c0ff 100644
--- a/srcpkgs/bookworm/template
+++ b/srcpkgs/bookworm/template
@@ -1,7 +1,7 @@
 # Template file for 'bookworm'
 pkgname=bookworm
 version=1.1.2
-revision=5
+revision=6
 build_style=meson
 hostmakedepends="pkg-config glib-devel gettext vala"
 makedepends="gtk+3-devel libgee08-devel granite-devel

From c8c94d6bf97dbf60d03d9b823223c2d6804184e6 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 06/35] calligra: revbump for poppler-23.09.0.

---
 srcpkgs/calligra/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/calligra/template b/srcpkgs/calligra/template
index 5020e13a2eac7..421700baadd3c 100644
--- a/srcpkgs/calligra/template
+++ b/srcpkgs/calligra/template
@@ -1,7 +1,7 @@
 # Template file for 'calligra'
 pkgname=calligra
 version=3.2.1
-revision=17
+revision=18
 build_style=cmake
 configure_args="-Wno-dev -DCALLIGRA_SHOULD_BUILD_UNMAINTAINED=ON
  -DBUILD_TESTING=OFF"

From a5a6dd37f84e9a43a08fd88d584f1aaa15fbaa85 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 07/35] citations: revbump for poppler-23.09.0.

---
 srcpkgs/citations/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/citations/template b/srcpkgs/citations/template
index a4162c34544cf..3aca1cb12372e 100644
--- a/srcpkgs/citations/template
+++ b/srcpkgs/citations/template
@@ -1,7 +1,7 @@
 # Template file for 'citations'
 pkgname=citations
 version=0.5.1
-revision=2
+revision=3
 build_style=meson
 build_helper=rust
 hostmakedepends="glib-devel gettext rust cargo pkg-config

From 0b7d3f412e8d0d342187f6b9d21e012855b5c56f Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 08/35] claws-mail: revbump for poppler-23.09.0.

---
 srcpkgs/claws-mail/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/claws-mail/template b/srcpkgs/claws-mail/template
index b989ebf1d8e43..775a351979aed 100644
--- a/srcpkgs/claws-mail/template
+++ b/srcpkgs/claws-mail/template
@@ -1,7 +1,7 @@
 # Template file for 'claws-mail'
 pkgname=claws-mail
 version=4.1.1
-revision=2
+revision=3
 build_style=gnu-configure
 configure_args="--disable-static --disable-python-plugin --disable-perl-plugin
  --enable-enchant --enable-gnutls"

From 3cf4e8f2200a5a18215edd2b826f1791fbda1692 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 09/35] cups-filters: revbump for poppler-23.09.0.

---
 srcpkgs/cups-filters/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/cups-filters/template b/srcpkgs/cups-filters/template
index 3f592bdda585a..373eac8dbeaad 100644
--- a/srcpkgs/cups-filters/template
+++ b/srcpkgs/cups-filters/template
@@ -1,7 +1,7 @@
 # Template file for 'cups-filters'
 pkgname=cups-filters
 version=1.28.17
-revision=3
+revision=4
 build_style=gnu-configure
 configure_args="--disable-static --with-rcdir=no --enable-avahi
  --with-browseremoteprotocols=DNSSD,CUPS

From 3bc30df0620c161587f2e5c45d8c35ab1e8ee0e0 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 10/35] diff-pdf: revbump for poppler-23.09.0.

---
 srcpkgs/diff-pdf/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/diff-pdf/template b/srcpkgs/diff-pdf/template
index 1b1c1b690814c..dff1f22362cbd 100644
--- a/srcpkgs/diff-pdf/template
+++ b/srcpkgs/diff-pdf/template
@@ -1,7 +1,7 @@
 # Template file for 'diff-pdf'
 pkgname=diff-pdf
 version=0.5.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-wx-config=wx-config-gtk3"
 hostmakedepends="pkg-config"

From 8da84b82ddd0f3886633879cc569fd5663b953e4 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 11/35] efl: revbump for poppler-23.09.0.

---
 srcpkgs/efl/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/efl/template b/srcpkgs/efl/template
index 020d102b18634..2a0bbf6117896 100644
--- a/srcpkgs/efl/template
+++ b/srcpkgs/efl/template
@@ -1,7 +1,7 @@
 # Template file for 'efl'
 pkgname=efl
 version=1.26.2
-revision=7
+revision=8
 build_style=meson
 configure_args="
  -Dbuild-examples=false

From e7ad9ec5d4001da8763f8d77124f5622879aaf37 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 12/35] epdfview: revbump for poppler-23.09.0.

---
 srcpkgs/epdfview/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/epdfview/template b/srcpkgs/epdfview/template
index 2c6b5774b49d0..c4d377750459a 100644
--- a/srcpkgs/epdfview/template
+++ b/srcpkgs/epdfview/template
@@ -1,7 +1,7 @@
 # Template file for 'epdfview'
 pkgname=epdfview
 version=0.1.8
-revision=12
+revision=13
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="gtk+-devel poppler-glib-devel"

From 9d4b0378badecbf16a2d3ef973cadffcbd79bb6f Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:31 +0100
Subject: [PATCH 13/35] evince: revbump for poppler-23.09.0.

---
 srcpkgs/evince/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/evince/template b/srcpkgs/evince/template
index 4568a1f329539..9e15f9e5fbdb9 100644
--- a/srcpkgs/evince/template
+++ b/srcpkgs/evince/template
@@ -1,7 +1,7 @@
 # Template file for 'evince'
 pkgname=evince
 version=44.3
-revision=1
+revision=2
 build_helper="gir"
 build_style=meson
 configure_args="$(vopt_bool gir introspection) $(vopt_bool gtk_doc gtk_doc)

From 104c3f4b01f62bf57e15ca54374521221856f7ea Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 14/35] extractpdfmark: revbump for poppler-23.09.0.

---
 srcpkgs/extractpdfmark/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/extractpdfmark/template b/srcpkgs/extractpdfmark/template
index 3e924aae4ea82..1be7c9b222c73 100644
--- a/srcpkgs/extractpdfmark/template
+++ b/srcpkgs/extractpdfmark/template
@@ -1,7 +1,7 @@
 # Template file for 'extractpdfmark'
 pkgname=extractpdfmark
 version=1.1.1
-revision=1
+revision=2
 build_wrksrc=build
 build_style=gnu-configure
 configure_script="../configure"

From 7640a56df00ec182f9d937610107ac61f44c17a6 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 15/35] fbida: revbump for poppler-23.09.0.

---
 srcpkgs/fbida/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/fbida/template b/srcpkgs/fbida/template
index ac9d75dc1d3b4..782ef591c6c4e 100644
--- a/srcpkgs/fbida/template
+++ b/srcpkgs/fbida/template
@@ -1,7 +1,7 @@
 # Template file for 'fbida'
 pkgname=fbida
 version=2.14
-revision=3
+revision=4
 build_style=meson
 hostmakedepends="cmake perl pkg-config cairo-devel libjpeg-turbo-devel"
 # XXX ida needs motif-devel

From aaa02511d7a8307fa212b45455121ebae6e11a2e Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 16/35] gegl: revbump for poppler-23.09.0.

---
 srcpkgs/gegl/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gegl/template b/srcpkgs/gegl/template
index 5d4b070cd703e..b61f8abe041f6 100644
--- a/srcpkgs/gegl/template
+++ b/srcpkgs/gegl/template
@@ -1,7 +1,7 @@
 # Template file for 'gegl'
 pkgname=gegl
 version=0.4.46
-revision=2
+revision=3
 build_style=meson
 build_helper="gir"
 configure_args="-Ddocs=false -Dintrospection=true -Dvapigen=enabled

From d75bde2137ea69b04121f75d5ec5bbd13f6ce6aa Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 17/35] gimp: revbump for poppler-23.09.0.

---
 srcpkgs/gimp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gimp/template b/srcpkgs/gimp/template
index 336e33ae83cce..9321de1ff9610 100644
--- a/srcpkgs/gimp/template
+++ b/srcpkgs/gimp/template
@@ -1,7 +1,7 @@
 # Template file for 'gimp'
 pkgname=gimp
 version=2.10.34
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-check-update --datadir=/usr/share"
 hostmakedepends="automake gegl gettext-devel glib-devel gtk+-devel intltool

From 8ec106f8ec25a00335c5a55a130120c28f93a990 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 18/35] gloobus-preview: revbump for poppler-23.09.0.

---
 srcpkgs/gloobus-preview/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gloobus-preview/template b/srcpkgs/gloobus-preview/template
index 28dd6f126490a..9bf343bf89a48 100644
--- a/srcpkgs/gloobus-preview/template
+++ b/srcpkgs/gloobus-preview/template
@@ -1,7 +1,7 @@
 # Template file for 'gloobus-preview'
 pkgname=gloobus-preview
 version=2015.12.21
-revision=7
+revision=8
 build_style=gnu-configure
 hostmakedepends="automake libtool pkg-config python3 gettext-devel xz"
 makedepends="gettext-devel boost-devel gtk+3-devel gtksourceview-devel

From ae86b7cd3069ef2f6ed4bba9a369b77e565b051b Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 19/35] gummi: revbump for poppler-23.09.0.

---
 srcpkgs/gummi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/gummi/template b/srcpkgs/gummi/template
index fe1ae455c5521..be5d402d225cd 100644
--- a/srcpkgs/gummi/template
+++ b/srcpkgs/gummi/template
@@ -1,7 +1,7 @@
 # Template file for 'gummi'
 pkgname=gummi
 version=0.8.3
-revision=1
+revision=2
 build_style=gnu-configure
 hostmakedepends="automake intltool pkg-config glib-devel gtk+3-devel gettext-devel"
 makedepends="gtksourceview-devel glib-devel gtk+3-devel poppler-glib-devel

From e9855bd0ad36a0cf840805289353c848c2906b68 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 20/35] inkscape: revbump for poppler-23.09.0.

---
 srcpkgs/inkscape/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 1e0e2c26b5c58..305b9936ddeae 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.3
-revision=3
+revision=4
 build_style=cmake
 make_check_target="check"
 hostmakedepends="automake gettext glib-devel intltool libgraphicsmagick-devel

From 30e6ce488f6bcbc953cde54dbf96bc267a1f0c14 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:32 +0100
Subject: [PATCH 21/35] ipe: revbump for poppler-23.09.0.

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index ec7b4b5dc3dcb..30cb18e219573 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.26
-revision=10
+revision=11
 _tools_commit=v7.2.24.1
 create_wrksrc=yes
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"

From f020e52a116af1e419ff7eae60b7b97a6b52d9ef Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 22/35] kitinerary: revbump for poppler-23.09.0.

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 31236a166ef2c..5575e4dfb57f5 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=23.08.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config
  qt5-host-tools qt5-qmake qt5-tools-devel"

From 7d531e8671d851b9d8a6785efb1243a088d1d25f Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 23/35] libreoffice: revbump for poppler-23.09.0.

---
 srcpkgs/libreoffice/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libreoffice/template b/srcpkgs/libreoffice/template
index 6672dd787a0a9..e4cc15b3b9919 100644
--- a/srcpkgs/libreoffice/template
+++ b/srcpkgs/libreoffice/template
@@ -1,7 +1,7 @@
 # Template file for 'libreoffice'
 pkgname=libreoffice
 version=7.6.0.3
-revision=2
+revision=3
 build_style=meta
 make_build_target="build"
 hostmakedepends="automake flex gperf hyphen icu libtool openldap which gettext xz

From f24897aa2f8bf64a8be864eab05bb98405d53657 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 24/35] osg: revbump for poppler-23.09.0.

---
 srcpkgs/osg/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/osg/template b/srcpkgs/osg/template
index a9ebbd287933b..8ef0efc599a1b 100644
--- a/srcpkgs/osg/template
+++ b/srcpkgs/osg/template
@@ -1,7 +1,7 @@
 # Template file for 'osg'
 pkgname=osg
 version=3.6.5
-revision=2
+revision=3
 build_style=cmake
 build_helper="qemu"
 # don't use /usr/lib64 on 64bit platforms

From 8a0c90e4892d483a2eea2a5081edea6204b0a95b Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 25/35] pdf2djvu: revbump for poppler-23.09.0.

---
 srcpkgs/pdf2djvu/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdf2djvu/template b/srcpkgs/pdf2djvu/template
index ef7433c0c98ae..5a6f3ddf4ed35 100644
--- a/srcpkgs/pdf2djvu/template
+++ b/srcpkgs/pdf2djvu/template
@@ -1,7 +1,7 @@
 # Template file for 'pdf2djvu'
 pkgname=pdf2djvu
 version=0.9.19
-revision=4
+revision=5
 build_style=gnu-configure
 hostmakedepends="pkg-config djvulibre gettext"
 makedepends="djvulibre-devel poppler-devel libgraphicsmagick-devel exiv2-devel libuuid-devel"

From 29617859f047b1d2e5154b4a28074343b5750ac3 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 26/35] pdfgrep: revbump for poppler-23.09.0.

---
 srcpkgs/pdfgrep/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdfgrep/template b/srcpkgs/pdfgrep/template
index 478c20aa1a63e..545e509dfba9d 100644
--- a/srcpkgs/pdfgrep/template
+++ b/srcpkgs/pdfgrep/template
@@ -1,7 +1,7 @@
 # Template file for 'pdfgrep'
 pkgname=pdfgrep
 version=2.1.2
-revision=2
+revision=3
 build_style=gnu-configure
 hostmakedepends="pkg-config"
 makedepends="libgcrypt-devel poppler-cpp-devel pcre-devel"

From 59aacb1d7ff9de45c339d0ba1794958657edbc0f Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 27/35] pdfpc: revbump for poppler-23.09.0.

---
 srcpkgs/pdfpc/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdfpc/template b/srcpkgs/pdfpc/template
index 450a9f300730e..070875a30ed44 100644
--- a/srcpkgs/pdfpc/template
+++ b/srcpkgs/pdfpc/template
@@ -1,7 +1,7 @@
 # Template file for 'pdfpc'
 pkgname=pdfpc
 version=4.6.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config vala libgee08-devel"
 makedepends="gst-plugins-base1-devel gtk+3-devel libgee08-devel

From 811cb1dc1b04972248a4aea403280ed6331929a8 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 28/35] pdftag: revbump for poppler-23.09.0.

---
 srcpkgs/pdftag/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdftag/template b/srcpkgs/pdftag/template
index 91fda3c33dc84..775505090f205 100644
--- a/srcpkgs/pdftag/template
+++ b/srcpkgs/pdftag/template
@@ -1,7 +1,7 @@
 # Template file for 'pdftag'
 pkgname=pdftag
 version=1.0.5
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="glib-devel pkg-config vala"
 makedepends="gtk+3-devel poppler-glib-devel"

From b406c3df6f456c9743ff080ed9c8f621b42a438b Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:33 +0100
Subject: [PATCH 29/35] scribus: revbump for poppler-23.09.0.

---
 srcpkgs/scribus/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 8a6f408500563..22630f1368191 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,7 +1,7 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=10
+revision=11
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
  -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"

From b7858c222e9d7c2ac36fbea0572a690ffb969895 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 30/35] tracker-miners: revbump for poppler-23.09.0.

---
 srcpkgs/tracker-miners/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tracker-miners/template b/srcpkgs/tracker-miners/template
index a6e5aa5777024..aa0f443927cdb 100644
--- a/srcpkgs/tracker-miners/template
+++ b/srcpkgs/tracker-miners/template
@@ -1,7 +1,7 @@
 # Template file for 'tracker-miners'
 pkgname=tracker-miners
 version=3.5.0
-revision=4
+revision=5
 build_style=meson
 build_helper=qemu
 # missing libgrss for miner_rss

From abac44e230c20117e59c478f481e59d72a7b4296 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 31/35] tumbler: revbump for poppler-23.09.0.

---
 srcpkgs/tumbler/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/tumbler/template b/srcpkgs/tumbler/template
index 73cec71187c0e..6ffc745d07c23 100644
--- a/srcpkgs/tumbler/template
+++ b/srcpkgs/tumbler/template
@@ -1,7 +1,7 @@
 # Template file for 'tumbler'
 pkgname=tumbler
 version=4.18.1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--with-locales-dir=/usr/share/locale
  --disable-gstreamer-thumbnailer --enable-poppler-thumbnailer"

From c62c42ad05d5466067f0753e0d52065eefdb4ddc Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 32/35] vips: revbump for poppler-23.09.0.

---
 srcpkgs/vips/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/vips/template b/srcpkgs/vips/template
index 6b08ed1088e38..53dee079ec882 100644
--- a/srcpkgs/vips/template
+++ b/srcpkgs/vips/template
@@ -1,7 +1,7 @@
 # Template file for 'vips'
 pkgname=vips
 version=8.14.4
-revision=1
+revision=2
 build_style=meson
 build_helper=gir
 # TODO: As of version 8.11 vips supports loading its support for OpenSlide,

From f7e193e6752fcbdf9e141e977e9a03023b2c8073 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 33/35] xournalpp: revbump for poppler-23.09.0.

---
 srcpkgs/xournalpp/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/xournalpp/template b/srcpkgs/xournalpp/template
index 6a75645c965bf..c90f2b5ff02c0 100644
--- a/srcpkgs/xournalpp/template
+++ b/srcpkgs/xournalpp/template
@@ -1,7 +1,7 @@
 # Template file for 'xournalpp'
 pkgname=xournalpp
 version=1.2.1
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="pkg-config gettext"
 makedepends="libxml2-devel libcppunit-devel poppler-glib-devel gtk+3-devel

From f50c1d8ceec97a74bbfee7dc99316e97a4948d2c Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 34/35] zathura-pdf-poppler: revbump for poppler-23.09.0.

---
 srcpkgs/zathura-pdf-poppler/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/zathura-pdf-poppler/template b/srcpkgs/zathura-pdf-poppler/template
index 292cf08cd96b4..908202fd1c61f 100644
--- a/srcpkgs/zathura-pdf-poppler/template
+++ b/srcpkgs/zathura-pdf-poppler/template
@@ -1,7 +1,7 @@
 # Template file for 'zathura-pdf-poppler'
 pkgname=zathura-pdf-poppler
 version=0.3.1
-revision=1
+revision=2
 build_style=meson
 hostmakedepends="pkg-config"
 makedepends="poppler-devel poppler-glib-devel zathura-devel"

From f430f317abd655cc8c0f4330ab7519c986f49c4c Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 22:00:34 +0100
Subject: [PATCH 35/35] xreader: revbump for poppler-23.09.0.

---
 srcpkgs/xreader/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/xreader/template b/srcpkgs/xreader/template
index 3712f8751c094..953990e3858c2 100644
--- a/srcpkgs/xreader/template
+++ b/srcpkgs/xreader/template
@@ -1,7 +1,7 @@
 # Template file for 'xreader'
 pkgname=xreader
 version=3.8.2
-revision=1
+revision=2
 build_style=meson
 build_helper="gir"
 configure_args="-Dintrospection=$(vopt_if gir true false) -Dthumbnailer=false"

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] Poppler 23.09.0
  2023-09-17 21:02 [PR PATCH] Poppler 23.09.0 mhmdanas
                   ` (2 preceding siblings ...)
  2023-09-20 12:26 ` [PR PATCH] [Updated] " mhmdanas
@ 2023-12-12 18:02 ` mhmdanas
  2023-12-14 15:16 ` [PR PATCH] [Updated] Poppler 23.12.0 sgn
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mhmdanas @ 2023-12-12 18:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

There is an updated pull request by mhmdanas against master on the void-packages repository

https://github.com/mhmdanas/void-packages poppler-23.09.0
https://github.com/void-linux/void-packages/pull/46107

Poppler 23.09.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **briefly** (and built all revdeps successfully)

[ci skip]

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/46107.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-23.09.0-46107.patch --]
[-- Type: text/x-diff, Size: 8063 bytes --]

From c2ce06f104a96bcc72d2e32315153db704eeb727 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 1/8] poppler: update to 23.12.0.

---
 common/shlibs            |  2 +-
 srcpkgs/poppler/template | 13 ++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 5757ec96c6601..4ce8355a7f7c0 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -345,7 +345,7 @@ libMagickCore-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagickWand-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagick++-7.Q16HDRI.so.5 libmagick-7.0.11.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.130 libpoppler-23.08.0_1
+libpoppler.so.133 libpoppler-23.12.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 2be3e5ab35e47..456e5c2fecb22 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -1,18 +1,17 @@
 # Template file for 'poppler'
 #
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
-#
-# Revbump libreoffice on SO version bumps.
 pkgname=poppler
-version=23.08.0
+version=23.12.0
 revision=1
-_testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
+_testVersion=400f3ff05b2b1c0ae17797a0bd50e75e35c1f1b1
 create_wrksrc=yes
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DENABLE_QT5=OFF -DENABLE_QT6=OFF -DENABLE_UTILS=ON
+ -DENABLE_BOOST=$(vopt_if boost ON OFF)
  -DTESTDATADIR='${XBPS_BUILDDIR}/poppler-${version}/testdatadir'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
@@ -25,8 +24,8 @@ homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz
  https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
-checksum="4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
- ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
+checksum="beba398c9d37a9b6d02486496635e08f1df3d437cfe61dab2593f47c4d14cdbb
+ 0d850a1d06944671c991be6822b7146ade401b06aad560ff39b254a028074525"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 9e53af9b53ca3fd7d27f61e4fc68944fdccd1eeb Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 2/8] poppler-qt5: update to 23.12.0.

---
 srcpkgs/poppler-qt5/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a48ed659920e..8dc1d149bf0c5 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,7 +4,7 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=23.08.0
+version=23.12.0
 revision=1
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
@@ -21,7 +21,7 @@ license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz"
-checksum=4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
+checksum=beba398c9d37a9b6d02486496635e08f1df3d437cfe61dab2593f47c4d14cdbb
 # fails to find a bunch of files
 make_check=no
 

From c6b4fd2d3abeae1c68539d17d111b5e03d940a18 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 3/8] inkscape: revbump for poppler-23.12.0.

---
 srcpkgs/inkscape/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 916822078cd27..a23bf4e87e61c 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.3.2
-revision=1
+revision=2
 build_style=cmake
 make_check_target="check"
 hostmakedepends="automake gettext glib-devel intltool libgraphicsmagick-devel

From a06269fff2eaecb5f117e96827a29ee08145cb33 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 4/8] ipe: revbump for poppler-23.12.0.

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index 65b92385af994..06347934d9897 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.26
-revision=10
+revision=11
 _tools_commit=v7.2.24.1
 create_wrksrc=yes
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"

From def3d6bc460de7acba60308946fede55b3e35ea9 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 5/8] kitinerary: revbump for poppler-23.12.0.

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 31236a166ef2c..5575e4dfb57f5 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=23.08.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config
  qt5-host-tools qt5-qmake qt5-tools-devel"

From 10fbbb250f2a777eb7277346d3bb1365bbbd0ee7 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 6/8] libreoffice: revbump for poppler-23.12.0.

---
 srcpkgs/libreoffice/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/libreoffice/template b/srcpkgs/libreoffice/template
index e4cc15b3b9919..423b49c0eb625 100644
--- a/srcpkgs/libreoffice/template
+++ b/srcpkgs/libreoffice/template
@@ -1,7 +1,7 @@
 # Template file for 'libreoffice'
 pkgname=libreoffice
 version=7.6.0.3
-revision=3
+revision=4
 build_style=meta
 make_build_target="build"
 hostmakedepends="automake flex gperf hyphen icu libtool openldap which gettext xz

From c19429acffe87f59d25058a4d3237c755df5477c Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 7/8] pdf2djvu: revbump for poppler-23.12.0.

---
 srcpkgs/pdf2djvu/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdf2djvu/template b/srcpkgs/pdf2djvu/template
index 5a6f3ddf4ed35..982ce2458751c 100644
--- a/srcpkgs/pdf2djvu/template
+++ b/srcpkgs/pdf2djvu/template
@@ -1,7 +1,7 @@
 # Template file for 'pdf2djvu'
 pkgname=pdf2djvu
 version=0.9.19
-revision=5
+revision=6
 build_style=gnu-configure
 hostmakedepends="pkg-config djvulibre gettext"
 makedepends="djvulibre-devel poppler-devel libgraphicsmagick-devel exiv2-devel libuuid-devel"

From 66b4bd8dfc7fc4228537f24122755461b2e5a147 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 8/8] scribus: revbump for poppler-23.12.0.

---
 srcpkgs/scribus/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 22630f1368191..6fd86197b85cc 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,7 +1,7 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=11
+revision=12
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
  -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] Poppler 23.12.0
  2023-09-17 21:02 [PR PATCH] Poppler 23.09.0 mhmdanas
                   ` (3 preceding siblings ...)
  2023-12-12 18:02 ` mhmdanas
@ 2023-12-14 15:16 ` sgn
  2023-12-14 15:18 ` sgn
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: sgn @ 2023-12-14 15:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1287 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/mhmdanas/void-packages poppler-23.09.0
https://github.com/void-linux/void-packages/pull/46107

Poppler 23.12.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES** (and built all revdeps successfully)

[ci skip]

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/46107.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-23.09.0-46107.patch --]
[-- Type: text/x-diff, Size: 185071 bytes --]

From 8e0d2f95db873c4619f089900b41fd558c5c4c4b Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 1/8] poppler: update to 23.12.0.

---
 common/shlibs            |  2 +-
 srcpkgs/poppler/template | 13 ++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 66d0045a2898f..393b7436cefa2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -345,7 +345,7 @@ libMagickCore-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagickWand-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagick++-7.Q16HDRI.so.5 libmagick-7.0.11.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.130 libpoppler-23.08.0_1
+libpoppler.so.133 libpoppler-23.12.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 2be3e5ab35e47..456e5c2fecb22 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -1,18 +1,17 @@
 # Template file for 'poppler'
 #
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
-#
-# Revbump libreoffice on SO version bumps.
 pkgname=poppler
-version=23.08.0
+version=23.12.0
 revision=1
-_testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
+_testVersion=400f3ff05b2b1c0ae17797a0bd50e75e35c1f1b1
 create_wrksrc=yes
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DENABLE_QT5=OFF -DENABLE_QT6=OFF -DENABLE_UTILS=ON
+ -DENABLE_BOOST=$(vopt_if boost ON OFF)
  -DTESTDATADIR='${XBPS_BUILDDIR}/poppler-${version}/testdatadir'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
@@ -25,8 +24,8 @@ homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz
  https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
-checksum="4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
- ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
+checksum="beba398c9d37a9b6d02486496635e08f1df3d437cfe61dab2593f47c4d14cdbb
+ 0d850a1d06944671c991be6822b7146ade401b06aad560ff39b254a028074525"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 7fde63053384f7c48fece7447f976d2597653984 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 2/8] poppler-qt5: update to 23.12.0.

---
 srcpkgs/poppler-qt5/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a48ed659920e..8dc1d149bf0c5 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,7 +4,7 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=23.08.0
+version=23.12.0
 revision=1
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
@@ -21,7 +21,7 @@ license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz"
-checksum=4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
+checksum=beba398c9d37a9b6d02486496635e08f1df3d437cfe61dab2593f47c4d14cdbb
 # fails to find a bunch of files
 make_check=no
 

From 60324c04159585411e3fd10f578b4f966d8e4e06 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 3/8] inkscape: revbump for poppler-23.12.0.

---
 srcpkgs/inkscape/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 916822078cd27..a23bf4e87e61c 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.3.2
-revision=1
+revision=2
 build_style=cmake
 make_check_target="check"
 hostmakedepends="automake gettext glib-devel intltool libgraphicsmagick-devel

From 9bf5d2641b2933c1409a721e910b41d0fb133475 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 4/8] ipe: revbump for poppler-23.12.0.

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index 65b92385af994..06347934d9897 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.26
-revision=10
+revision=11
 _tools_commit=v7.2.24.1
 create_wrksrc=yes
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"

From 991ecd0a466d6b94fede8b71402c6137df017cef Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 5/8] kitinerary: revbump for poppler-23.12.0.

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 31236a166ef2c..5575e4dfb57f5 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=23.08.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config
  qt5-host-tools qt5-qmake qt5-tools-devel"

From d0632ce4b2a7dd01c3b422581c45d217d311102c Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 6/8] pdf2djvu: revbump for poppler-23.12.0.

Close: #46107
---
 srcpkgs/pdf2djvu/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdf2djvu/template b/srcpkgs/pdf2djvu/template
index 5a6f3ddf4ed35..982ce2458751c 100644
--- a/srcpkgs/pdf2djvu/template
+++ b/srcpkgs/pdf2djvu/template
@@ -1,7 +1,7 @@
 # Template file for 'pdf2djvu'
 pkgname=pdf2djvu
 version=0.9.19
-revision=5
+revision=6
 build_style=gnu-configure
 hostmakedepends="pkg-config djvulibre gettext"
 makedepends="djvulibre-devel poppler-devel libgraphicsmagick-devel exiv2-devel libuuid-devel"

From b4d16c7eba506c6d09de9df5777caea6fe60acbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 14 Dec 2023 14:01:26 +0700
Subject: [PATCH 7/8] scribus: for poppler 23.12.0

---
 ...r-22.03.0-force-poppler-0.86-minimum.patch |  526 ++++++
 .../0002-poppler-22.03.0-memleak.patch        |   94 +
 .../0005-podofo-0.10-find-podofo.patch        |   37 +
 ...-swap-podofo-poppler-dep-check-order.patch |  109 ++
 .../0007-podofo-0.10-minimum-0.9.0.patch      |   22 +
 .../0008-podofo-0.10-drop-old-compat.patch    |   48 +
 ...dofo-0.10-avoid-confusion-with-m_doc.patch |   67 +
 .../0010-podofo-0.10-indentation-fix.patch    |   22 +
 .../patches/0011-podofo-0.10-code-style.patch |  141 ++
 .../0012-podofo-0.10-preparation.patch        |  514 ++++++
 ...013-podofo-0.10-compat-podofo-0.10.x.patch | 1602 +++++++++++++++++
 ...0014-podofo-0.10-compat-podofo-0.9.6.patch |  853 +++++++++
 .../patches/0015-podofo-0.10-cmake-fix.patch  |   22 +
 .../0016-podofo-0.10-use-pkgconfig.patch      |  107 ++
 .../patches/cmake-buildtype-none.patch        |    7 +-
 srcpkgs/scribus/template                      |    4 +-
 16 files changed, 4170 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch
 create mode 100644 srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch
 create mode 100644 srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch
 create mode 100644 srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch
 create mode 100644 srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch
 create mode 100644 srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch
 create mode 100644 srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch
 create mode 100644 srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch
 create mode 100644 srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch
 create mode 100644 srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch
 create mode 100644 srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch

diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch
new file mode 100644
index 0000000000000..f205f45dea3d5
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch
@@ -0,0 +1,526 @@
+From e013e8126d2100e8e56dea5b836ad43275429389 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:48:29 +0000
+Subject: [PATCH] Enforce poppler version >= 0.86.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24985 11d20701-8431-0410-a711-e3c959e3b870
+---
+ cmake/modules/Findpoppler.cmake          |   4 +-
+ scribus/plugins/import/pdf/importpdf.cpp |  65 ++-----------
+ scribus/plugins/import/pdf/slaoutput.cpp | 114 -----------------------
+ scribus/plugins/import/pdf/slaoutput.h   |   7 --
+ 4 files changed, 10 insertions(+), 180 deletions(-)
+
+--- a/cmake/modules/Findpoppler.cmake
++++ b/cmake/modules/Findpoppler.cmake
+@@ -1,8 +1,8 @@
+ #include(FindPkgConfig)
+ find_package(PkgConfig QUIET)
+-pkg_search_module(poppler libpoppler>=0.62.0 poppler>=0.62.0)
++pkg_search_module(poppler libpoppler>=0.86.0 poppler>=0.86.0)
+ if (poppler_FOUND)
+-	pkg_search_module(poppler_cpp REQUIRED libpoppler-cpp>=0.62.0 poppler-cpp>=0.62.0)
++	pkg_search_module(poppler_cpp REQUIRED libpoppler-cpp>=0.86.0 poppler-cpp>=0.86.0)
+ endif(poppler_FOUND)
+  
+ find_path(poppler_INCLUDE_DIR
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -75,20 +75,15 @@ PdfPlug::PdfPlug(ScribusDoc* doc, int fl
+ 
+ QImage PdfPlug::readThumbnail(const QString& fName)
+ {
+-	QString pdfFile = QDir::toNativeSeparators(fName);
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
+ 	globalParams.reset(new GlobalParams());
+-#else
+-	std::unique_ptr<GlobalParams> globalParamsPtr(new GlobalParams());
+-	globalParams = globalParamsPtr.get();
+-#endif
++	globalParams->setErrQuiet(gTrue);
+ 
+-#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
++	QString pdfFile = QDir::toNativeSeparators(fName);
++#if defined(Q_OS_WIN32)
+ 	auto fname = new GooString(pdfFile.toUtf8().data());
+ #else
+ 	auto fname = new GooString(QFile::encodeName(pdfFile).data());
+ #endif
+-	globalParams->setErrQuiet(gTrue);
+ 
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+ 	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
+@@ -333,19 +328,15 @@ bool PdfPlug::convert(const QString& fn)
+ 		qApp->processEvents();
+ 	}
+ 
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
+ 	globalParams.reset(new GlobalParams());
+-#else
+-	std::unique_ptr<GlobalParams> globalParamsPtr(new GlobalParams());
+-	globalParams = globalParamsPtr.get();
+-#endif
+-#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
++	globalParams->setErrQuiet(gTrue);
++
++#if defined(Q_OS_WIN32)
+ 	auto fname = new GooString(fn.toUtf8().data());
+ #else
+ 	auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
+-	globalParams->setErrQuiet(gTrue);
+-//	globalParams->setPrintCommands(gTrue);
++
+ 	QList<OptionalContentGroup*> ocgGroups;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+ 	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
+@@ -365,7 +356,7 @@ bool PdfPlug::convert(const QString& fn)
+ 			QString text = QInputDialog::getText(mw, tr("Open PDF-File"), tr("Password"), QLineEdit::Normal, "", &ok);
+ 			if (ok && !text.isEmpty())
+ 			{
+-#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
++#if defined(Q_OS_WIN32)
+ 				auto fname = new GooString(fn.toUtf8().data());
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+@@ -383,9 +374,6 @@ bool PdfPlug::convert(const QString& fn)
+ 			{
+ 				if (m_progressDialog)
+ 					m_progressDialog->close();
+-#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
+-				delete globalParams;
+-#endif
+ 				return false;
+ 			}
+ 			if (m_progressDialog)
+@@ -495,7 +483,6 @@ bool PdfPlug::convert(const QString& fn)
+ 							}
+ 							else
+ 							{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 69, 0)
+ 								const auto& ocgs = ocg->getOCGs ();
+ 								for (const auto& ocg : ocgs)
+ 								{
+@@ -507,25 +494,11 @@ bool PdfPlug::convert(const QString& fn)
+ 										ocgNames.append(ocgName);
+ 									}
+ 								}
+-#else
+-								GooList *ocgs = ocg->getOCGs ();
+-								for (int i = 0; i < ocgs->getLength (); ++i)
+-								{
+-									OptionalContentGroup *oc = (OptionalContentGroup *)ocgs->get(i);
+-									QString ocgName = UnicodeParsedString(oc->getName());
+-									if (!ocgNames.contains(ocgName))
+-									{
+-										ocgGroups.prepend(oc);
+-										ocgNames.append(ocgName);
+-									}
+-								}
+-#endif
+ 							}
+ 						}
+ 					}
+ 					else
+ 					{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 69, 0)
+ 						const auto& ocgs = ocg->getOCGs ();
+ 						for (const auto& ocg : ocgs)
+ 						{
+@@ -537,19 +510,6 @@ bool PdfPlug::convert(const QString& fn)
+ 								ocgNames.append(ocgName);
+ 							}
+ 						}
+-#else
+-						GooList *ocgs = ocg->getOCGs ();
+-						for (int i = 0; i < ocgs->getLength (); ++i)
+-						{
+-							OptionalContentGroup *oc = (OptionalContentGroup *)ocgs->get(i);
+-							QString ocgName = UnicodeParsedString(oc->getName());
+-							if (!ocgNames.contains(ocgName))
+-							{
+-								ocgGroups.prepend(oc);
+-								ocgNames.append(ocgName);
+-							}
+-						}
+-#endif
+ 					}
+ 				}
+ 
+@@ -788,13 +748,8 @@ bool PdfPlug::convert(const QString& fn)
+ 							names = catDict.dictLookup("OpenAction");
+ 							if (names.isDict())
+ 							{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 								std::unique_ptr<LinkAction> linkActionUPtr = LinkAction::parseAction(&names, pdfDoc->getCatalog()->getBaseURI());
+ 								LinkAction *linkAction = linkActionUPtr.get();
+-#else
+-								LinkAction *linkAction = nullptr;
+-								linkAction = LinkAction::parseAction(&names, pdfDoc->getCatalog()->getBaseURI());
+-#endif
+ 								if (linkAction && (linkAction->getKind() == actionJavaScript))
+ 								{
+ 									LinkJavaScript *jsa = (LinkJavaScript*) linkAction;
+@@ -862,11 +817,7 @@ bool PdfPlug::convert(const QString& fn)
+ 		}
+ 		pdfDoc.reset();
+ 	}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
+ 	globalParams.reset();
+-#else
+-	globalParams = nullptr;
+-#endif
+ 
+ //	qDebug() << "converting finished";
+ //	qDebug() << "Imported" << m_elements.count() << "Elements";
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -332,15 +332,9 @@ LinkAction* SlaOutputDev::SC_getAction(A
+ }
+ 
+ /* Replacement for the crippled Poppler function LinkAction* AnnotWidget::getAdditionalAction(AdditionalActionsType type) */
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *ano)
+ {
+ 	std::unique_ptr<LinkAction> linkAction;
+-#else
+-LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *ano)
+-{
+-	LinkAction *linkAction = nullptr;
+-#endif
+ 	Object obj;
+ 	Ref refa = ano->getRef();
+ 
+@@ -467,11 +461,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 				if (dst->isPageRef())
+ 				{
+ 					Ref dstr = dst->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 					pagNum = pdfDoc->findPage(dstr);
+-#else
+-					pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 				}
+ 				else
+ 					pagNum = dst->getPageNum();
+@@ -485,11 +475,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 			POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 			if (ndst)
+ 			{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 				std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-				LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 				if (dstn)
+ 				{
+ 					if (dstn->getKind() == destXYZ)
+@@ -497,11 +483,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 						if (dstn->isPageRef())
+ 						{
+ 							Ref dstr = dstn->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 							pagNum = pdfDoc->findPage(dstr);
+-#else
+-							pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 						}
+ 						else
+ 							pagNum = dstn->getPageNum();
+@@ -533,11 +515,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 			POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 			if (ndst)
+ 			{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 				std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-				LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 				if (dstn)
+ 				{
+ 					if (dstn->getKind() == destXYZ)
+@@ -985,11 +963,7 @@ void SlaOutputDev::handleActions(PageIte
+ 					if (dst->isPageRef())
+ 					{
+ 						Ref dstr = dst->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 						pagNum = pdfDoc->findPage(dstr);
+-#else
+-						pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 					}
+ 					else
+ 						pagNum = dst->getPageNum();
+@@ -1005,11 +979,7 @@ void SlaOutputDev::handleActions(PageIte
+ 				POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 				if (ndst)
+ 				{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 					std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-					LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 					if (dstn)
+ 					{
+ 						if (dstn->getKind() == destXYZ)
+@@ -1017,11 +987,7 @@ void SlaOutputDev::handleActions(PageIte
+ 							if (dstn->isPageRef())
+ 							{
+ 								Ref dstr = dstn->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 								pagNum = pdfDoc->findPage(dstr);
+-#else
+-								pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 							}
+ 							else
+ 								pagNum = dstn->getPageNum();
+@@ -1061,11 +1027,7 @@ void SlaOutputDev::handleActions(PageIte
+ 				POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 				if (ndst)
+ 				{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 					std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-					LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 					if (dstn)
+ 					{
+ 						if (dstn->getKind() == destXYZ)
+@@ -1139,143 +1101,91 @@ void SlaOutputDev::handleActions(PageIte
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setD_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("E", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setE_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("X", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setX_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("Fo", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setFo_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("Bl", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setBl_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("C", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setC_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("F", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setF_act(UnicodeParsedString(jsa->getScript()));
+@@ -1283,22 +1193,14 @@ void SlaOutputDev::handleActions(PageIte
+ 				ite->annotation().setFormat(5);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("K", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setK_act(UnicodeParsedString(jsa->getScript()));
+@@ -1306,33 +1208,21 @@ void SlaOutputDev::handleActions(PageIte
+ 				ite->annotation().setFormat(5);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("V", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setV_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ }
+ 
+@@ -1342,11 +1232,7 @@ void SlaOutputDev::startDoc(PDFDoc *doc,
+ 	catalog = catA;
+ 	pdfDoc = doc;
+ 	updateGUICounter = 0;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 84, 0)
+ 	m_fontEngine = new SplashFontEngine(true, false, false, true);
+-#else
+-	m_fontEngine = new SplashFontEngine(globalParams->getEnableFreeType(), false, false, true);
+-#endif
+ }
+ 
+ void SlaOutputDev::startPage(int pageNum, GfxState *, XRef *)
+--- a/scribus/plugins/import/pdf/slaoutput.h
++++ b/scribus/plugins/import/pdf/slaoutput.h
+@@ -30,9 +30,6 @@ for which a new license (GPL+exception)
+ #include "selection.h"
+ #include "vgradient.h"
+ 
+-#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 73, 0)
+-#include <poppler/goo/gtypes.h>
+-#endif
+ #include <poppler/Object.h>
+ #include <poppler/OutputDev.h>
+ #include <poppler/Gfx.h>
+@@ -163,11 +160,7 @@ public:
+ 	virtual ~SlaOutputDev();
+ 
+ 	LinkAction* SC_getAction(AnnotWidget *ano);
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 	std::unique_ptr<LinkAction> SC_getAdditionalAction(const char *key, AnnotWidget *ano);
+-#else
+-	LinkAction* SC_getAdditionalAction(const char *key, AnnotWidget *ano);
+-#endif
+ 	static GBool annotations_callback(Annot *annota, void *user_data);
+ 	bool handleTextAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
+ 	bool handleLinkAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch
new file mode 100644
index 0000000000000..d40f35ad966e9
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch
@@ -0,0 +1,94 @@
+From 48263954a7dee0be815b00f417ae365ab26cdd85 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Thu, 3 Mar 2022 00:18:06 +0000
+Subject: [PATCH] #16764: Better patch, avoid a memory leak
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24989 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 34 +++++++++---------------
+ scribus/util_os.cpp                      |  2 ++
+ 2 files changed, 15 insertions(+), 21 deletions(-)
+
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -58,6 +58,7 @@ for which a new license (GPL+exception)
+ #include "util.h"
+ #include "util_formats.h"
+ #include "util_math.h"
++#include "util_os.h"
+ 
+ #include "ui/customfdialog.h"
+ #include "ui/missing.h"
+@@ -79,15 +80,12 @@ QImage PdfPlug::readThumbnail(const QStr
+ 	globalParams->setErrQuiet(gTrue);
+ 
+ 	QString pdfFile = QDir::toNativeSeparators(fName);
+-#if defined(Q_OS_WIN32)
+-	auto fname = new GooString(pdfFile.toUtf8().data());
+-#else
+-	auto fname = new GooString(QFile::encodeName(pdfFile).data());
+-#endif
+-
++	QByteArray encodedFileName = os_is_win() ? pdfFile.toUtf8() : QFile::encodeName(pdfFile);
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+-	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++	auto fname = std::make_unique<GooString>(encodedFileName.data());
++	PDFDoc pdfDoc{ std::move(fname) };
+ #else
++	auto fname = new GooString(encodedFileName.data());
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
+ #endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+@@ -331,17 +329,14 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams.reset(new GlobalParams());
+ 	globalParams->setErrQuiet(gTrue);
+ 
+-#if defined(Q_OS_WIN32)
+-	auto fname = new GooString(fn.toUtf8().data());
+-#else
+-	auto fname = new GooString(QFile::encodeName(fn).data());
+-#endif
+-
+ 	QList<OptionalContentGroup*> ocgGroups;
++	QByteArray encodedFileName = os_is_win() ? fn.toUtf8() : QFile::encodeName(fn);
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+-	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++	auto fname = std::make_unique<GooString>(encodedFileName.data());
++	auto pdfDoc = std::make_unique<PDFDoc>(std::move(fname));
+ #else
+-	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++	auto fname = new GooString(encodedFileName.data());
++	auto pdfDoc = std::make_unique<PDFDoc>(fname, nullptr, nullptr, nullptr);
+ #endif
+ 	if (pdfDoc)
+ 	{
+@@ -356,15 +351,12 @@ bool PdfPlug::convert(const QString& fn)
+ 			QString text = QInputDialog::getText(mw, tr("Open PDF-File"), tr("Password"), QLineEdit::Normal, "", &ok);
+ 			if (ok && !text.isEmpty())
+ 			{
+-#if defined(Q_OS_WIN32)
+-				auto fname = new GooString(fn.toUtf8().data());
+-#else
+-				auto fname = new GooString(QFile::encodeName(fn).data());
+-#endif
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				auto fname = std::make_unique<GooString>(encodedFileName.data());
+ 				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
+-				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++				pdfDoc.reset(new PDFDoc(std::move(fname), userPW, userPW, nullptr));
+ #else
++				auto fname = new GooString(encodedFileName.data());
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
+ #endif
+--- a/scribus/util_os.cpp
++++ b/scribus/util_os.cpp
+@@ -22,6 +22,8 @@ for which a new license (GPL+exception)
+ 
+ #include <QtGlobal>
+ 
++#include "util_os.h"
++
+ bool os_is_osx()
+ {
+ #ifdef Q_OS_MACOS
diff --git a/srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch b/srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch
new file mode 100644
index 0000000000000..261428153a96f
--- /dev/null
+++ b/srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch
@@ -0,0 +1,37 @@
+From 3d02faaa2e17eef67826abd52d56b4a9b2b9c1ba Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Sun, 4 Jun 2023 17:00:34 +0000
+Subject: [PATCH 01/13] Update CMake PoDoFo finder to allow for PoDoFo 0.10.0
+ podofo-config.h location
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25493 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit bd70705c05bd383d1a9b3ab12224988ff8475722)
+---
+ cmake/modules/FindLIBPODOFO.cmake | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+--- a/cmake/modules/FindLIBPODOFO.cmake
++++ b/cmake/modules/FindLIBPODOFO.cmake
+@@ -32,7 +32,14 @@ find_library(LIBPODOFO_LIBRARY
+ 
+ if(LIBPODOFO_INCLUDE_DIR AND LIBPODOFO_LIBRARY)
+ 	if(NOT LIBPODOFO_CONFIG_H)
+-		set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h")
++		#PoDoFo before 0.10.0
++		if (EXISTS "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h")
++			set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h. PoDoFo <=0.10.0")
++		endif()
++		#PoDoFo 0.10.0 or higher
++		if (EXISTS "${LIBPODOFO_INCLUDE_DIR}/podofo/auxiliary/podofo_config.h")
++			set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/auxiliary/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h. PoDoFo >=0.10.0")
++		endif()
+ 	endif()
+ 
+ 	file(STRINGS "${LIBPODOFO_CONFIG_H}" PODOFO_MAJOR_VER_LINE REGEX "^#define[ \t]+PODOFO_VERSION_MAJOR[ \t]+[0-9]+$")
+@@ -79,4 +86,6 @@ if(NOT LIBPODOFO_FIND_QUIETLY)
+ 		message("podofo lib: not found")
+ 	endif(LIBPODOFO_LIBRARY)
+ 	message("PoDoFo cflags: ${useshared}")
++	message("PoDoFo config file ${LIBPODOFO_CONFIG_H}")
++	message("PoDoFo version ${LIBPODOFO_VERSION}")
+ endif(NOT LIBPODOFO_FIND_QUIETLY)
diff --git a/srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch b/srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch
new file mode 100644
index 0000000000000..47c644f418b22
--- /dev/null
+++ b/srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch
@@ -0,0 +1,109 @@
+From 45ed6b8664675d78de1b3dbde2c9684111805811 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 5 Jun 2023 20:57:47 +0000
+Subject: [PATCH 02/13] Swap dependency checking for podofo and poppler to the
+ beginning to force C++17 when their versions require it
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25500 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 81b3cf609ff01400f6f804c98ee58febc4494908)
+---
+ CMakeLists_Dependencies.cmake | 74 +++++++++++++++++++++--------------
+ 1 file changed, 44 insertions(+), 30 deletions(-)
+
+--- a/CMakeLists_Dependencies.cmake
++++ b/CMakeLists_Dependencies.cmake
+@@ -1,6 +1,48 @@
+ ##############################################################################################################
+ ########## Find Dependencies                                                                        ##########
+ 
++#<<PoDoFo for AI PDF import
++option(WITH_PODOFO "Enable support for PDF embedded in AI" ON)
++if (WITH_PODOFO)
++	find_package(LIBPODOFO)
++	if (LIBPODOFO_FOUND)
++		message("PoDoFo found OK")
++		set(HAVE_PODOFO ON)
++		if(LIBPODOFO_VERSION VERSION_GREATER "0.10.0")
++			message(STATUS "PoDoFo Version:" ${LIBPODOFO_VERSION})
++			if (CMAKE_CXX_STANDARD LESS 17)
++				message(STATUS "C++17 is the minimum C++ standard since podofo 0.10.0")
++				message(STATUS "Enabling C++17 compiler features")
++				set(CMAKE_CXX_STANDARD 17)
++			endif()
++		endif()
++	else()
++		message("PoDoFo NOT found - Disabling support for PDF embedded in AI")
++	endif()
++endif()
++#>>PoDoFo for AI PDF import
++
++#<<Poppler for PDF import
++find_package(poppler REQUIRED)
++if (poppler_FOUND)
++	set(HAVE_POPPLER ON)
++	message(STATUS "Found poppler")
++	message(STATUS "Found poppler libs: ${poppler_LIBRARY}")
++	message(STATUS "Found poppler includes: ${poppler_INCLUDE_DIR}")
++	if (poppler_VERSION VERSION_GREATER_EQUAL 22.01.0)
++		message(STATUS "Poppler Version:" ${poppler_VERSION})
++		if (CMAKE_CXX_STANDARD LESS 17)
++			message(STATUS "C++17 is the minimum C++ standard since poppler 22.01.0")
++			message(STATUS "Enabling C++17 compiler features")
++			set(CMAKE_CXX_STANDARD 17)
++		endif()
++	endif()
++else()
++	message(FATAL_ERROR "Could not find poppler library")
++endif()
++#>>Poppler for PDF import
++
++
+ #<< Qt
+ #Qt less than 6
+ set(CMAKE_PREFIX_PATH "${QT_PREFIX}/lib/cmake")
+@@ -257,18 +299,7 @@ if (WANT_HUNSPELL)
+ endif()
+ #>>HUNSPELL for Spelling support
+ 
+-#<<PoDoFo for AI PDF import
+-option(WITH_PODOFO "Enable support for PDF embedded in AI" ON)
+-if (WITH_PODOFO)
+-	find_package(LIBPODOFO)
+-	if (LIBPODOFO_FOUND)
+-		message("PoDoFo found OK")
+-		set(HAVE_PODOFO ON)
+-	else()
+-		message("PoDoFo NOT found - Disabling support for PDF embedded in AI")
+-	endif()
+-endif()
+-#>>PoDoFo for AI PDF import
++
+ 
+ #<<Boost for 2Geom Tools
+ option(WITH_BOOST "Enable support for Boost based enhancements" ON)
+@@ -298,24 +329,7 @@ else()
+ endif()
+ #>> GraphicsMagick for image import
+ 
+-#<<Poppler for PDF import
+-find_package(poppler REQUIRED)
+-if (poppler_FOUND)
+-	set(HAVE_POPPLER ON)
+-	message(STATUS "Found poppler")
+-	message(STATUS "Found poppler libs: ${poppler_LIBRARY}")
+-	message(STATUS "Found poppler includes: ${poppler_INCLUDE_DIR}")
+-	if (poppler_VERSION VERSION_GREATER_EQUAL 22.01.0)
+-		message(STATUS "Poppler Version:" ${poppler_VERSION})
+-		message(STATUS "C++17 is the minimum C++ standard since poppler 22.01.0")
+-		if (CMAKE_CXX_STANDARD LESS 17)
+-			message(FATAL_ERROR "Please set -DWANT_CPP17=ON on your CMake command line")
+-		endif()
+-	endif()
+-else()
+-	message(FATAL_ERROR "Could not find poppler library")
+-endif()
+-#>>Poppler for PDF import
++
+ 
+ # librevenge for MsPub import
+ pkg_check_modules(LIBREVENGE librevenge-0.0)
diff --git a/srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch b/srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch
new file mode 100644
index 0000000000000..d5503bf50d7e6
--- /dev/null
+++ b/srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch
@@ -0,0 +1,22 @@
+From 2a2c95fda05bbb089c12807261b7a9339635b488 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 5 Jun 2023 21:32:27 +0000
+Subject: [PATCH 03/13] Bump minimum podofo version to 0.9.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25506 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 9233e1e20a006155e90e2893cb2a133949ec7a68)
+---
+ CMakeLists_Dependencies.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/CMakeLists_Dependencies.cmake
++++ b/CMakeLists_Dependencies.cmake
+@@ -4,7 +4,7 @@
+ #<<PoDoFo for AI PDF import
+ option(WITH_PODOFO "Enable support for PDF embedded in AI" ON)
+ if (WITH_PODOFO)
+-	find_package(LIBPODOFO)
++	find_package(LIBPODOFO 0.9.0)
+ 	if (LIBPODOFO_FOUND)
+ 		message("PoDoFo found OK")
+ 		set(HAVE_PODOFO ON)
diff --git a/srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch b/srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch
new file mode 100644
index 0000000000000..9cbfd8e3b9abf
--- /dev/null
+++ b/srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch
@@ -0,0 +1,48 @@
+From 60007314a17cfd9ef4d81689868ca1b4e91d5c89 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Mon, 5 Jun 2023 21:37:40 +0000
+Subject: [PATCH 04/13] Code cleanup now possible thanks to podofo >= 0.9.0
+ requirement
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25509 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit a43ad2030f6a6a7ccc1d7fc6cdcd7a652e1263c3)
+---
+ scribus/pdflib_core.cpp | 8 --------
+ 1 file changed, 8 deletions(-)
+
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9861,16 +9861,12 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			char * mbuffer = nullptr;
+ 			long mlen = 0;
+ 
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 7, 99))
+ 			// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
+ 			PoDoFo::PdfMemoryOutputStream oStream(1);
+ 			stream->GetCopy(&oStream);
+ 			oStream.Close();
+ 			mlen = oStream.GetLength();
+ 			mbuffer = oStream.TakeBuffer();
+-#else
+-			stream->GetCopy(&mbuffer, &mlen);
+-#endif
+ 			if (mbuffer[mlen-1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+@@ -10158,16 +10154,12 @@ void PDFLibCore::copyPoDoFoObject(const
+ 		char * mbuffer = nullptr;
+ 		long mlen = 0;
+ 
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 7, 99))
+ 		// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
+ 		PoDoFo::PdfMemoryOutputStream oStream(1);
+ 		stream->GetCopy(&oStream);
+ 		oStream.Close();
+ 		mlen = oStream.GetLength();
+ 		mbuffer = oStream.TakeBuffer();
+-#else
+-		stream->GetCopy(&mbuffer, &mlen);
+-#endif
+ 		if (mbuffer[mlen-1] == '\n')
+ 			--mlen;
+ 		PutDoc("\nstream\n");
diff --git a/srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch b/srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch
new file mode 100644
index 0000000000000..d545d347e28e1
--- /dev/null
+++ b/srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch
@@ -0,0 +1,67 @@
+From 99e2d400ad6ad7fbf4e2ad1a4277521eaad46d28 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Sun, 4 Jun 2023 21:31:53 +0000
+Subject: [PATCH 05/13] Rename m_doc in pdf_analyser to avoid confusion with
+ m_doc in other code
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25495 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit b5aeed8093e06cf3df456f5ad26f76f6ca442bff)
+---
+ scribus/pdf_analyzer.cpp | 12 ++++++------
+ scribus/pdf_analyzer.h   |  2 +-
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -75,11 +75,11 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 		nameMapInited = true;
+ 	}
+ 
+-	m_doc = nullptr;
++	m_pdfdoc = nullptr;
+ 
+ 	PdfError::EnableDebug( false );
+ 	try {
+-		m_doc = new PdfMemDocument(filename.toLocal8Bit().data());
++		m_pdfdoc = new PdfMemDocument(filename.toLocal8Bit().data());
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -91,14 +91,14 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 
+ PDFAnalyzer::~PDFAnalyzer()
+ {
+-	delete m_doc;
++	delete m_pdfdoc;
+ }
+ 
+ bool PDFAnalyzer::inspectPDF(int pageNum, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
+-	if (!m_doc)
++	if (!m_pdfdoc)
+ 		return false;
+-	PdfPage* page = m_doc->GetPage(pageNum);
++	PdfPage* page = m_pdfdoc->GetPage(pageNum);
+ 	return page?inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs):false;
+ }
+ 
+@@ -725,7 +725,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		if (arr[0].IsReference())
+ 		{
+ 			PdfReference ref = arr[0].GetReference();
+-			PdfObject* fontObject = m_doc->GetObjects().GetObject(ref);
++		PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
+ 			if (fontObject)
+ 			{
+ 				PDFFont font = getFontInfo(fontObject);
+--- a/scribus/pdf_analyzer.h
++++ b/scribus/pdf_analyzer.h
+@@ -162,7 +162,7 @@ public:
+ #ifdef HAVE_PODOFO
+ private:
+ 	// pointer to the PoDoFo Pdf's object
+-	PoDoFo::PdfMemDocument* m_doc;
++	PoDoFo::PdfMemDocument* m_pdfdoc;
+ 
+ 	// Path to the analyzed file
+ 	QString m_filename;
diff --git a/srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch b/srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch
new file mode 100644
index 0000000000000..f6c890ebf60d9
--- /dev/null
+++ b/srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch
@@ -0,0 +1,22 @@
+From ed854091944c93a74cdb3a4dbd6ed14e95ab6a9c Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Mon, 5 Jun 2023 21:03:08 +0000
+Subject: [PATCH 06/13] Small indentation fix
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25503 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit fd576ca6d40856ca3cfb32482b24fa15783665d5)
+---
+ scribus/pdf_analyzer.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -725,7 +725,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		if (arr[0].IsReference())
+ 		{
+ 			PdfReference ref = arr[0].GetReference();
+-		PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
++			PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
+ 			if (fontObject)
+ 			{
+ 				PDFFont font = getFontInfo(fontObject);
diff --git a/srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch b/srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch
new file mode 100644
index 0000000000000..973eb17f714b5
--- /dev/null
+++ b/srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch
@@ -0,0 +1,141 @@
+From 9cd60ef7831fff69f2dacc2bf216c3537b2cd6e9 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Sat, 12 Aug 2023 21:12:49 +0000
+Subject: [PATCH 07/13] PDFAnalyzer: code style fixes and cleanups
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25573 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 9be7a29f08a00bb3c10024cd9a31a82742d42e22)
+---
+ scribus/pdf_analyzer.cpp | 56 +++++++++++++++++++++-------------------
+ 1 file changed, 30 insertions(+), 26 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -78,7 +78,8 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 	m_pdfdoc = nullptr;
+ 
+ 	PdfError::EnableDebug( false );
+-	try {
++	try
++	{
+ 		m_pdfdoc = new PdfMemDocument(filename.toLocal8Bit().data());
+ 	}
+ 	catch (PdfError & e)
+@@ -99,12 +100,13 @@ bool PDFAnalyzer::inspectPDF(int pageNum
+ 	if (!m_pdfdoc)
+ 		return false;
+ 	PdfPage* page = m_pdfdoc->GetPage(pageNum);
+-	return page?inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs):false;
++	return page ? inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs) : false;
+ }
+ 
+ PDFColorSpace PDFAnalyzer::getCSType(PdfObject* cs)
+ {
+-	try {
++	try
++	{
+ 		// colorspace is either a name or an array
+ 		if (cs && cs->IsName())
+ 		{
+@@ -165,20 +167,21 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ bool PDFAnalyzer::inspectCanvas(PdfCanvas* canvas, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
+ 	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
+-	PdfObject* colorSpaceRes;
+-	PdfObject* xObjects;
+-	PdfObject* transGroup;
+-	PdfObject* extGState;
+-	PdfObject* fontRes;
++	PdfObject* colorSpaceRes { nullptr };
++	PdfObject* xObjects { nullptr };
++	PdfObject* transGroup { nullptr };
++	PdfObject* extGState { nullptr };
++	PdfObject* fontRes { nullptr };
+ 	QMap<PdfName, PDFColorSpace> processedNamedCS;
+ 	QMap<PdfName, PDFFont> processedNamedFont;
+ 	QList<PdfName> processedNamedXObj;
+ 	QList<PdfName> processedNamedGS;
+-	try {
++	try
++	{
+ 		// get hold of a PdfObject pointer of this canvas
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
+-		PdfObject* canvasObject = page?(page->GetObject()):((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
+ 
+ 		// find a resource with ColorSpace entry
+ 		PdfObject* resources = canvas->GetResources();
+@@ -186,13 +189,13 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		{
+ 			resources = par->GetIndirectKey("Resources");
+ 		}
+-		colorSpaceRes = resources?resources->GetIndirectKey("ColorSpace"):nullptr;
+-		xObjects = resources?resources->GetIndirectKey("XObject"):nullptr;
+-		extGState = resources?resources->GetIndirectKey("ExtGState"):nullptr;
+-		fontRes = resources?resources->GetIndirectKey("Font"):nullptr;
++		colorSpaceRes = resources ? resources->GetIndirectKey("ColorSpace") : nullptr;
++		xObjects = resources ? resources->GetIndirectKey("XObject") : nullptr;
++		extGState = resources ? resources->GetIndirectKey("ExtGState") : nullptr;
++		fontRes = resources ? resources->GetIndirectKey("Font") : nullptr;
+ 
+ 		// getting the transparency group of this content stream (if available)
+-		transGroup = canvasObject?canvasObject->GetIndirectKey("Group"):nullptr;
++		transGroup = canvasObject ? canvasObject->GetIndirectKey("Group") : nullptr;
+ 		if (transGroup)
+ 		{
+ 			PdfObject* subtype = transGroup->GetIndirectKey("S");
+@@ -219,7 +222,8 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		return false;
+ 	}
+ 
+-	try {
++	try
++	{
+ 		// start parsing the content stream
+ 		PdfContentsTokenizer tokenizer(canvas);
+ 		EPdfContentsType t;
+@@ -502,7 +506,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						if (args.size() == 1 && args[0].IsName() && xObjects)
+ 						{
+ 							PdfObject* xObject = xObjects->GetIndirectKey(args[0].GetName());
+-							PdfObject* subtypeObject = xObject?xObject->GetIndirectKey("Subtype"):nullptr;
++							PdfObject* subtypeObject = xObject ? xObject->GetIndirectKey("Subtype") : nullptr;
+ 							if (subtypeObject && subtypeObject->IsName())
+ 							{
+ 								if (subtypeObject->GetName() == "Image")
+@@ -557,10 +561,10 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						PdfName cs("CS");
+ 						if (args.contains(colorspace) || args.contains(cs))
+ 						{
+-							int csIdx = args.contains(colorspace)?args.indexOf(colorspace):args.indexOf(cs);
+-							if (args[csIdx+1].IsName())
++							int csIdx = args.contains(colorspace) ? args.indexOf(colorspace) : args.indexOf(cs);
++							if (args[csIdx + 1].IsName())
+ 							{
+-								PdfName csName = args[csIdx+1].GetName();
++								PdfName csName = args[csIdx + 1].GetName();
+ 								if ((csName == "G" || csName == "DeviceGray") && !usedColorSpaces.contains(CS_DeviceGray))
+ 									usedColorSpaces.append(CS_DeviceGray);
+ 								else if ((csName == "RGB" || csName == "DeviceRGB") && !usedColorSpaces.contains(CS_DeviceRGB))
+@@ -594,14 +598,14 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						PdfName w("W");
+ 						if ((args.contains(height) || args.contains(h)) && (args.contains(width) || args.contains(w)))
+ 						{
+-							int heightIdx = args.contains(height)?args.indexOf(height):args.indexOf(h);
+-							int widthIdx = args.contains(width)?args.indexOf(width):args.indexOf(w);
+-							double height = args[heightIdx+1].GetReal();
+-							double width = args[widthIdx+1].GetReal();
++							int heightIdx = args.contains(height) ? args.indexOf(height) : args.indexOf(h);
++							int widthIdx = args.contains(width) ? args.indexOf(width) : args.indexOf(w);
++							double height = args[heightIdx + 1].GetReal();
++							double width = args[widthIdx + 1].GetReal();
+ 							PDFImage img;
+ 							img.imgName = "Inline Image";
+-							img.dpiX = qRound(width/(currGS.ctm.m11()/72));
+-							img.dpiY = qRound(height/(currGS.ctm.m22()/72));
++							img.dpiX = qRound(width / (currGS.ctm.m11() / 72));
++							img.dpiY = qRound(height / (currGS.ctm.m22() / 72));
+ 							imgs.append(img);
+ 						}
+ 						inlineImgDict = false;
diff --git a/srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch b/srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch
new file mode 100644
index 0000000000000..654d870140683
--- /dev/null
+++ b/srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch
@@ -0,0 +1,514 @@
+From bb6c0716035bcdc9fd4bd536d1ed6f01a1c6e9fa Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Sat, 12 Aug 2023 23:28:11 +0000
+Subject: [PATCH 08/13] Preparation work for PoDoFo 0.10.0x support: get rid of
+ GetIndirectKey() calls
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25579 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit fbd5eb474e0e6f522c6089756424592ecf0dc0a4)
+---
+ scribus/pdf_analyzer.cpp               | 204 ++++++++++++++-----------
+ scribus/pdflib_core.cpp                |  28 ++--
+ scribus/plugins/import/ai/importai.cpp |  21 ++-
+ 3 files changed, 148 insertions(+), 105 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -167,11 +167,10 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ bool PDFAnalyzer::inspectCanvas(PdfCanvas* canvas, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
+ 	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
+-	PdfObject* colorSpaceRes { nullptr };
+-	PdfObject* xObjects { nullptr };
+-	PdfObject* transGroup { nullptr };
+-	PdfObject* extGState { nullptr };
+-	PdfObject* fontRes { nullptr };
++	PdfDictionary* colorSpacesDict { nullptr };
++	PdfDictionary* xObjectsDict { nullptr };
++	PdfDictionary* extGStatesDict { nullptr };
++	PdfDictionary* fontsDict { nullptr };
+ 	QMap<PdfName, PDFColorSpace> processedNamedCS;
+ 	QMap<PdfName, PDFFont> processedNamedFont;
+ 	QList<PdfName> processedNamedXObj;
+@@ -182,30 +181,41 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
+ 		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++		PdfDictionary* canvasDict = (canvasObject && canvasObject->IsDictionary()) ? &(canvasObject->GetDictionary()) : nullptr;
+ 
+ 		// find a resource with ColorSpace entry
+ 		PdfObject* resources = canvas->GetResources();
+-		for (PdfObject* par = canvasObject; par && !resources; par = par->GetIndirectKey("Parent"))
++		for (PdfDictionary* par = canvasDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+-			resources = par->GetIndirectKey("Resources");
++			resources = par->FindKey("Resources");
++			PdfObject* parentObj = par->FindKey("Parent");
++			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
+ 		}
+-		colorSpaceRes = resources ? resources->GetIndirectKey("ColorSpace") : nullptr;
+-		xObjects = resources ? resources->GetIndirectKey("XObject") : nullptr;
+-		extGState = resources ? resources->GetIndirectKey("ExtGState") : nullptr;
+-		fontRes = resources ? resources->GetIndirectKey("Font") : nullptr;
++
++		PdfDictionary* resourcesDict = (resources && resources->IsDictionary()) ? &(resources->GetDictionary()) : nullptr;
++		PdfObject* colorSpaceRes = resourcesDict ? resourcesDict->FindKey("ColorSpace") : nullptr;
++		PdfObject* xObjects = resourcesDict ? resourcesDict->FindKey("XObject") : nullptr;
++		PdfObject* extGState = resourcesDict ? resourcesDict->FindKey("ExtGState") : nullptr;
++		PdfObject* fontRes = resourcesDict ? resourcesDict->FindKey("Font") : nullptr;
++
++		colorSpacesDict = (colorSpaceRes && colorSpaceRes->IsDictionary()) ? &(colorSpaceRes->GetDictionary()) : nullptr;
++		xObjectsDict = (xObjects && xObjects->IsDictionary()) ? &(xObjects->GetDictionary()) : nullptr;
++		extGStatesDict = (extGState && extGState->IsDictionary()) ? &(extGState->GetDictionary()) : nullptr;
++		fontsDict = (fontRes && fontRes->IsDictionary()) ? &(fontRes->GetDictionary()) : nullptr;
+ 
+ 		// getting the transparency group of this content stream (if available)
+-		transGroup = canvasObject ? canvasObject->GetIndirectKey("Group") : nullptr;
+-		if (transGroup)
++		PdfObject* transGroup = canvasDict ? canvasDict->FindKey("Group") : nullptr;
++		PdfDictionary* transGroupDict = (transGroup && transGroup->IsDictionary()) ? &(transGroup->GetDictionary()) : nullptr;
++		if (transGroupDict)
+ 		{
+-			PdfObject* subtype = transGroup->GetIndirectKey("S");
++			const PdfObject* subtype = transGroupDict->FindKey("S");
+ 			if (subtype && subtype->GetName() == "Transparency")
+ 			{
+ 				// having transparency group means there's transparency in the PDF
+ 				hasTransparency = true;
+ 
+ 				// reporting the color space used in transparency group (Section 7.5.5, PDF 1.6 Spec)
+-				PdfObject* cs = transGroup->GetIndirectKey("CS");
++				PdfObject* cs = transGroupDict->FindKey("CS");
+ 				if (cs)
+ 				{
+ 					PDFColorSpace retval = getCSType(cs);
+@@ -380,9 +390,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -449,9 +459,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -503,28 +513,29 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedXObj.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && xObjects)
++						if (args.size() == 1 && args[0].IsName() && xObjectsDict)
+ 						{
+-							PdfObject* xObject = xObjects->GetIndirectKey(args[0].GetName());
+-							PdfObject* subtypeObject = xObject ? xObject->GetIndirectKey("Subtype") : nullptr;
++							PdfObject* xObject = xObjectsDict->FindKey(args[0].GetName());
++							PdfDictionary* xObjectDict = (xObject && xObject->IsDictionary()) ? &(xObject->GetDictionary()) : nullptr;
++							PdfObject* subtypeObject = xObjectDict ? xObjectDict->FindKey("Subtype") : nullptr;
+ 							if (subtypeObject && subtypeObject->IsName())
+ 							{
+ 								if (subtypeObject->GetName() == "Image")
+ 								{
+-									PdfObject* imgColorSpace = xObject->GetIndirectKey("ColorSpace");
++									PdfObject* imgColorSpace = xObjectDict->FindKey("ColorSpace");
+ 									if (imgColorSpace)
+ 									{
+ 										PDFColorSpace retval = getCSType(imgColorSpace);
+ 										if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 											usedColorSpaces.append(retval);
+ 									}
+-									PdfObject* sMaskObj = xObject->GetIndirectKey("SMask");
++									PdfObject* sMaskObj = xObjectDict->FindKey("SMask");
+ 									if (sMaskObj)
+ 										hasTransparency = true;
+ 									PDFImage img;
+ 									img.imgName = args[0].GetName().GetEscapedName().c_str();
+-									double width = xObject->GetIndirectKey("Width")->GetReal();
+-									double height = xObject->GetIndirectKey("Height")->GetReal();
++									double width = xObjectDict->FindKey("Width")->GetReal();
++									double height = xObjectDict->FindKey("Height")->GetReal();
+ 									img.dpiX = qRound(width/(currGS.ctm.m11()/72));
+ 									img.dpiY = qRound(height/(currGS.ctm.m22()/72));
+ 									imgs.append(img);
+@@ -573,9 +584,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 									usedColorSpaces.append(CS_DeviceCMYK);
+ 								else if (!processedNamedCS.contains(csName))
+ 								{
+-									if (colorSpaceRes && colorSpaceRes->GetIndirectKey(csName))
++									if (colorSpacesDict && colorSpacesDict->FindKey(csName))
+ 									{
+-										PdfObject* csEntry = colorSpaceRes->GetIndirectKey(csName);
++										PdfObject* csEntry = colorSpacesDict->FindKey(csName);
+ 										if (csEntry)
+ 										{
+ 											PDFColorSpace retval = getCSType(csEntry);
+@@ -615,9 +626,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedGS.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && extGState)
++						if (args.size() == 1 && args[0].IsName() && extGStatesDict)
+ 						{
+-							PdfObject* extGStateObj = extGState->GetIndirectKey(args[0].GetName());
++							PdfObject* extGStateObj = extGStatesDict->FindKey(args[0].GetName());
+ 							if (extGStateObj)
+ 							{
+ 								inspectExtGStateObj(extGStateObj, usedColorSpaces, hasTransparency, usedFonts, currGS);
+@@ -646,9 +657,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					}
+ 					else
+ 					{
+-						if (args.size() == 2 && args[0].IsName() && fontRes)
++						if (args.size() == 2 && args[0].IsName() && fontsDict)
+ 						{
+-							PdfObject* fontObj = fontRes->GetIndirectKey(args[0].GetName());
++							PdfObject* fontObj = fontsDict->FindKey(args[0].GetName());
+ 							if (fontObj)
+ 							{
+ 								PDFFont retval = getFontInfo(fontObj);
+@@ -687,9 +698,11 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 	}
+ 	return true;
+ }
++
+ void PDFAnalyzer::inspectExtGStateObj(PdfObject* extGStateObj, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, PDFGraphicState & currGS)
+ {
+-	PdfObject* bmObj = extGStateObj->GetIndirectKey("BM");
++	PdfDictionary* extGStateDict = extGStateObj->IsDictionary() ? &(extGStateObj->GetDictionary()) : nullptr;
++	PdfObject* bmObj = extGStateDict ? extGStateDict->FindKey("BM") : nullptr;
+ 	if (bmObj && bmObj->IsName())
+ 	{
+ 		currGS.blendModes.clear();
+@@ -706,23 +719,27 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		if (arr[0].IsName() && !(arr[0].GetName() == "Normal" || arr[0].GetName() == "Compatible"))
+ 			hasTransparency = true;
+ 	}
+-	PdfObject* caObj = extGStateObj->GetIndirectKey("ca");
++
++	PdfObject* caObj = extGStateDict ? extGStateDict->FindKey("ca") : nullptr;
+ 	if (caObj && (caObj->IsReal() || caObj->IsNumber()))
+ 	{
+ 		currGS.fillAlphaConstant = caObj->GetReal();
+ 		if (caObj->GetReal() < 1)
+ 			hasTransparency = true;
+ 	}
+-	PdfObject* cAObj = extGStateObj->GetIndirectKey("CA");
++
++	PdfObject* cAObj = extGStateDict ? extGStateDict->FindKey("CA") : nullptr;
+ 	if (cAObj && (cAObj->IsReal() || cAObj->IsNumber()))
+ 	{
+ 		if (cAObj->GetReal() < 1)
+-		hasTransparency = true;
++			hasTransparency = true;
+ 	}
+-	PdfObject* sMaskObj = extGStateObj->GetIndirectKey("SMask");
++
++	PdfObject* sMaskObj = extGStateDict ? extGStateDict->FindKey("SMask") : nullptr;
+ 	if (sMaskObj && !(sMaskObj->IsName() && sMaskObj->GetName() == "None"))
+ 		hasTransparency = true;
+-	PdfObject* fontObj = extGStateObj->GetIndirectKey("Font");
++
++	PdfObject* fontObj = extGStateDict ? extGStateDict->FindKey("Font") : nullptr;
+ 	if (fontObj && fontObj->IsArray())
+ 	{
+ 		PdfArray arr = fontObj->GetArray();
+@@ -740,19 +757,24 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 
+ 		}
+ 	}
+-	PdfObject* lwObj = extGStateObj->GetIndirectKey("LW");
++
++	PdfObject* lwObj = extGStateDict ? extGStateDict->FindKey("LW") : nullptr;
+ 	if (lwObj)
+ 		currGS.lineWidth = lwObj->GetReal();
+-	PdfObject* lcObj = extGStateObj->GetIndirectKey("LC");
++
++	PdfObject* lcObj = extGStateDict ? extGStateDict->FindKey("LC") : nullptr;
+ 	if (lcObj)
+ 		currGS.lineCap = lcObj->GetNumber();
+-	PdfObject* ljObj = extGStateObj->GetIndirectKey("LJ");
++
++	PdfObject* ljObj = extGStateDict ? extGStateDict->FindKey("LJ") : nullptr;
+ 	if (ljObj)
+ 		currGS.lineJoin = ljObj->GetNumber();
+-	PdfObject* mlObj = extGStateObj->GetIndirectKey("ML");
++
++	PdfObject* mlObj = extGStateDict ? extGStateDict->FindKey("ML") : nullptr;
+ 	if (mlObj)
+ 		currGS.miterLimit = mlObj->GetReal();
+-	PdfObject* dObj = extGStateObj->GetIndirectKey("D");
++
++	PdfObject* dObj = extGStateDict ? extGStateDict->FindKey("D") : nullptr;
+ 	if (dObj)
+ 	{
+ 		PdfObject dObjA = dObj->GetArray()[0];
+@@ -767,56 +789,64 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ PDFFont PDFAnalyzer::getFontInfo(PdfObject* fontObj)
+ {
+ 	PDFFont currFont;
+-	PdfObject* subtype = fontObj->GetIndirectKey("Subtype");
+-	if (subtype && subtype->IsName())
++	const PdfDictionary* fontDict = fontObj->IsDictionary() ? &(fontObj->GetDictionary()) : nullptr;
++	if (!fontDict)
++		return currFont;
++
++	const PdfObject* subtype = fontDict->FindKey("Subtype");
++	if (!subtype || !subtype->IsName())
++		return currFont;
++
++	const PdfObject* fontDesc = fontDict->FindKey("FontDescriptor");
++	if (subtype->GetName() == "Type1")
++		currFont.fontType = F_Type1;
++	else if (subtype->GetName() == "MMType1")
++		currFont.fontType = F_MMType1;
++	else if (subtype->GetName() == "TrueType")
++		currFont.fontType = F_TrueType;
++	else if (subtype->GetName() == "Type3")
++	{
++		currFont.fontType = F_Type3;
++		currFont.isEmbedded = true;
++		fontDesc = nullptr;
++	}
++	else if (subtype->GetName() == "Type0")
+ 	{
+-		PdfObject* fontDesc = fontObj->GetIndirectKey("FontDescriptor");
+-		if (subtype->GetName() == "Type1")
+-			currFont.fontType = F_Type1;
+-		else if (subtype->GetName() == "MMType1")
+-			currFont.fontType = F_MMType1;
+-		else if (subtype->GetName() == "TrueType")
+-			currFont.fontType = F_TrueType;
+-		else if (subtype->GetName() == "Type3")
+-		{
+-			currFont.fontType = F_Type3;
+-			currFont.isEmbedded = true;
+-			fontDesc = nullptr;
+-		}
+-		else if (subtype->GetName() == "Type0")
++		const PdfObject* descendantFonts = fontDict->FindKey("DescendantFonts");
++		if (descendantFonts && descendantFonts->IsArray())
+ 		{
+-			PdfObject* descendantFonts = fontObj->GetIndirectKey("DescendantFonts");
+-			if (descendantFonts && descendantFonts->IsArray())
++			const PdfReference& refDescFont = descendantFonts->GetArray()[0].GetReference();
++			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
++			PdfDictionary* descendantFontDict = (descendantFont && descendantFont->IsDictionary()) ? &(descendantFont->GetDictionary()) : nullptr;
++			const PdfObject* subtypeDescFont = descendantFontDict->FindKey("Subtype");
++			fontDesc = &(descendantFontDict->MustGetKey("FontDescriptor"));
++			if (subtypeDescFont && subtypeDescFont->IsName())
+ 			{
+-				PdfReference refDescFont = descendantFonts->GetArray()[0].GetReference();
+-				PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
+-				PdfObject* subtypeDescFont = descendantFont->GetIndirectKey("Subtype");
+-				fontDesc = descendantFont->MustGetIndirectKey("FontDescriptor");
+-				if (subtypeDescFont && subtypeDescFont->IsName())
+-				{
+-					if (subtypeDescFont->GetName() == "CIDFontType0")
+-						currFont.fontType = F_CIDFontType0;
+-					else if (subtypeDescFont->GetName() == "CIDFontType2")
+-						currFont.fontType = F_CIDFontType2;
+-				}
++				if (subtypeDescFont->GetName() == "CIDFontType0")
++					currFont.fontType = F_CIDFontType0;
++				else if (subtypeDescFont->GetName() == "CIDFontType2")
++					currFont.fontType = F_CIDFontType2;
+ 			}
+ 		}
+-		if (fontDesc)
++	}
++
++	const PdfDictionary* fontDescDict = (fontDesc && fontDesc->IsDictionary()) ? &(fontDesc->GetDictionary()) : nullptr;
++	if (fontDescDict)
++	{
++		const PdfObject* fontFile = fontDescDict->FindKey("FontFile");
++		const PdfObject* fontFile2 = fontDescDict->FindKey("FontFile2");
++		const PdfObject* fontFile3 = fontDescDict->FindKey("FontFile3");
++		if (fontFile && fontFile->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile2 && fontFile2->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile3 && fontFile3->HasStream())
+ 		{
+-			PdfObject* fontFile = fontDesc->GetIndirectKey("FontFile");
+-			PdfObject* fontFile2 = fontDesc->GetIndirectKey("FontFile2");
+-			PdfObject* fontFile3 = fontDesc->GetIndirectKey("FontFile3");
+-			if (fontFile && fontFile->HasStream())
+-				currFont.isEmbedded = true;
+-			if (fontFile2 && fontFile2->HasStream())
+-				currFont.isEmbedded = true;
+-			if (fontFile3 && fontFile3->HasStream())
+-			{
+-				currFont.isEmbedded = true;
+-				PdfObject* ff3Subtype = fontFile3->GetIndirectKey("Subtype");
+-				if (ff3Subtype && ff3Subtype->IsName() && ff3Subtype->GetName() == "OpenType")
+-					currFont.isOpenType = true;
+-			}
++			currFont.isEmbedded = true;
++			const PdfDictionary* fontFile3Dict = fontFile3->IsDictionary() ? &(fontFile3->GetDictionary()) : nullptr;
++			const PdfObject* ff3Subtype = fontFile3Dict ? fontFile3Dict->FindKey("Subtype") : nullptr;
++			if (ff3Subtype && ff3Subtype->IsName() && ff3Subtype->GetName() == "OpenType")
++				currFont.isOpenType = true;
+ 		}
+ 	}
+ 	return currFont;
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9800,16 +9800,20 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 		PoDoFo::PdfObject* pageObj   = page ? page->GetObject() : nullptr;
+ 		PoDoFo::PdfObject* contents  = page ? page->GetContents() : nullptr;
+ 		PoDoFo::PdfObject* resources = page ? page->GetResources() : nullptr;
+-		for (PoDoFo::PdfObject* par = pageObj; par && !resources; par = par->GetIndirectKey("Parent"))
++		PoDoFo::PdfDictionary* pageObjDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
++		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+-			resources = par->GetIndirectKey("Resources");
++			resources = par->FindKey("Resources");
++			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
++			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
+ 		}
+ 		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Dictionary)
+ 		{
++			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
+ 			PoDoFo::PdfStream* stream = contents->GetStream();
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+-			PoDoFo::PdfObject* nextObj;
++			PoDoFo::PdfObject* nextObj { nullptr };
+ 			PdfId xObj = writer.newObject();
+ 			PdfId xResources = writer.newObject();
+ 			PdfId xParents = 0;
+@@ -9844,14 +9848,16 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			nextObj = page->GetObject()->GetIndirectKey("Group");
++			PoDoFo::PdfObject* pageObj = page->GetObject();
++			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+ 			/*
+-			PoDoFo::PdfObject parents = page->GetObject()->GetIndirectKey("StructParents");
++			PoDoFo::PdfObject parents = pageDict->FindKey("StructParents");
+ 			if (parents)
+ 			{
+ 				xParents = writer.newObject();
+@@ -9870,13 +9876,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			if (mbuffer[mlen-1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+-			nextObj = contents->GetIndirectKey("Filter");
++			nextObj = contentsDict.FindKey("Filter");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Filter ");
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+-			nextObj = contents->GetIndirectKey("DecodeParms");
++			nextObj = contentsDict.FindKey("DecodeParms");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/DecodeParms ");
+@@ -9967,7 +9973,9 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			nextObj = page->GetObject()->GetIndirectKey("Group");
++			PoDoFo::PdfObject* pageObj = page->GetObject();
++			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+@@ -10012,13 +10020,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ //				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+ /*
+- nextObj = contents->GetIndirectKey("Filter");
++			nextObj = contentsDict.FindKey("Filter");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Filter ");
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+-			nextObj = contents->GetIndirectKey("DecodeParms");
++			nextObj = contentsDict.FindKey("DecodeParms");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/DecodeParms ");
+--- a/scribus/plugins/import/ai/importai.cpp
++++ b/scribus/plugins/import/ai/importai.cpp
+@@ -587,36 +587,41 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		PoDoFo::PdfPage *curPage = doc.GetPage(0);
+ 		if (curPage != nullptr)
+ 		{
+-			PoDoFo::PdfObject *piece = curPage->GetObject()->GetIndirectKey("PieceInfo");
++			PoDoFo::PdfObject* pageObj = curPage->GetObject();
++			PoDoFo::PdfDictionary* pageDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
++			PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
+ 			if (piece != nullptr)
+ 			{
+-				PoDoFo::PdfObject *illy = piece->GetIndirectKey("Illustrator");
++				PoDoFo::PdfDictionary* pieceDict = piece->IsDictionary() ? &(piece->GetDictionary()) : nullptr;
++				PoDoFo::PdfObject *illy = pieceDict ? pieceDict->FindKey("Illustrator") : nullptr;
+ 				if (illy != nullptr)
+ 				{
+-					PoDoFo::PdfObject *priv = illy->GetIndirectKey("Private");
++					PoDoFo::PdfDictionary* illyDict = illy->IsDictionary() ? &(illy->GetDictionary()) : nullptr;
++					PoDoFo::PdfObject *priv = illyDict ? illyDict->FindKey("Private") : nullptr;
+ 					if (priv == nullptr)
+ 						priv = illy;
+ 					int num = 0;
+-					PoDoFo::PdfObject *numBl = priv->GetIndirectKey("NumBlock");
++					PoDoFo::PdfDictionary* privDict = priv->IsDictionary() ? &(priv->GetDictionary()) : nullptr;
++					PoDoFo::PdfObject *numBl = privDict ? privDict->FindKey("NumBlock") : nullptr;
+ 					if (numBl != nullptr)
+ 						num = numBl->GetNumber() + 1;
+ 					if (num == 0)
+ 						num = 99999;
+ 					QString name = "AIPrivateData%1";
+ 					QString Key = name.arg(1);
+-					PoDoFo::PdfObject *data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++					PoDoFo::PdfObject *data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
+ 					if (data == nullptr)
+ 					{
+ 						name = "AIPDFPrivateData%1";
+ 						Key = name.arg(1);
+-						data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++						data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
+ 					}
+ 					if (data != nullptr)
+ 					{
+ 						if (num == 2)
+ 						{
+ 							Key = name.arg(1);
+-							data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 							PoDoFo::PdfStream const *stream = data->GetStream();
+ 							PoDoFo::PdfMemoryOutputStream oStream(1);
+ 							stream->GetFilteredCopy(&oStream);
+@@ -631,7 +636,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 							for (int a = 2; a < num; a++)
+ 							{
+ 								Key = name.arg(a);
+-								data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 								if (data == nullptr)
+ 									break;
+ 								PoDoFo::PdfStream const *stream = data->GetStream();
diff --git a/srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch b/srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch
new file mode 100644
index 0000000000000..5810becb56446
--- /dev/null
+++ b/srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch
@@ -0,0 +1,1602 @@
+From bbaa1944d83a2c68e49927d5bcc462cd870beb2d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Tue, 15 Aug 2023 02:43:52 +0000
+Subject: [PATCH 09/13] #16948: Fix build with podofo 0.10.x
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25601 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 33580ae8371e993b6e199e710950702c78d7dde1)
+---
+ scribus/documentchecker.cpp                   |  18 +-
+ .../imagedataloaders/scimgdataloader_pdf.cpp  |  12 +-
+ scribus/pdf_analyzer.cpp                      | 533 +++++++++++++++++-
+ scribus/pdflib_core.cpp                       | 480 +++++++++++++---
+ scribus/pdflib_core.h                         |   4 +-
+ scribus/plugins/import/ai/importai.cpp        |  41 +-
+ 6 files changed, 985 insertions(+), 103 deletions(-)
+
+--- a/scribus/documentchecker.cpp
++++ b/scribus/documentchecker.cpp
+@@ -109,7 +109,7 @@ bool DocumentChecker::checkDocument(Scri
+ void DocumentChecker::checkPages(ScribusDoc *currDoc, const CheckerPrefs& checkerSettings)
+ {
+ 	errorCodes pageError;
+-	for (int i=0; i < currDoc->DocPages.count(); ++i )
++	for (int i = 0; i < currDoc->DocPages.count(); ++i)
+ 	{
+ 		pageError.clear();
+ 		if (checkerSettings.checkAppliedMasterDifferentSide)
+@@ -127,11 +127,11 @@ void DocumentChecker::checkPages(Scribus
+ 			}
+ 			else
+ 			{
+-				if (pageLoc==LeftPage && masterPageLocation==1)
++				if (pageLoc == LeftPage && masterPageLocation == 1)
+ 					error = false;
+-				else if (pageLoc==RightPage && masterPageLocation==0)
++				else if (pageLoc == RightPage && masterPageLocation == 0)
+ 					error = false;
+-				else if (pageLoc==MiddlePage && masterPageLocation==2)
++				else if (pageLoc == MiddlePage && masterPageLocation == 2)
+ 					error = false;
+ 				else
+ 					error = true;
+@@ -596,7 +596,7 @@ void DocumentChecker::checkItems(Scribus
+ 								}
+ 								if (checkerSettings.checkNotCMYKOrSpot)
+ 								{
+-									for (int i=0; i<usedColorSpaces.size(); ++i)
++									for (int i = 0; i < usedColorSpaces.size(); ++i)
+ 									{
+ 										if (usedColorSpaces[i] == CS_DeviceRGB || usedColorSpaces[i] == CS_ICCBased || usedColorSpaces[i] == CS_CalGray
+ 											|| usedColorSpaces[i] == CS_CalRGB || usedColorSpaces[i] == CS_Lab)
+@@ -608,7 +608,7 @@ void DocumentChecker::checkItems(Scribus
+ 								}
+ 								if (checkerSettings.checkDeviceColorsAndOutputIntent && currDoc->HasCMS)
+ 								{
+-									for (int i=0; i<usedColorSpaces.size(); ++i)
++									for (int i = 0; i < usedColorSpaces.size(); ++i)
+ 									{
+ 										if (currPrintProfCS == ColorSpace_Cmyk && (usedColorSpaces[i] == CS_DeviceRGB || usedColorSpaces[i] == CS_DeviceGray))
+ 										{
+@@ -627,7 +627,7 @@ void DocumentChecker::checkItems(Scribus
+ 								itemError.insert(Transparency, 0);
+ 							if (checkerSettings.checkFontNotEmbedded || checkerSettings.checkFontIsOpenType)
+ 							{
+-								for (int i=0; i<usedFonts.size(); ++i)
++								for (int i = 0; i < usedFonts.size(); ++i)
+ 								{
+ 									PDFFont currentFont = usedFonts[i];
+ 									if (!currentFont.isEmbedded && checkerSettings.checkFontNotEmbedded)
+@@ -638,7 +638,7 @@ void DocumentChecker::checkItems(Scribus
+ 							}
+ 							if (checkerSettings.checkResolution)
+ 							{
+-								for (int i=0; i<imgs.size(); ++i)
++								for (int i = 0; i < imgs.size(); ++i)
+ 								{
+ 									if ((imgs[i].dpiX < checkerSettings.minResolution) || (imgs[i].dpiY < checkerSettings.minResolution))
+ 										itemError.insert(ImageDPITooLow, 0);
+@@ -655,7 +655,7 @@ void DocumentChecker::checkItems(Scribus
+ 				if ( currItem->frameOverflows() && (checkerSettings.checkOverflow) && (!((currItem->isAnnotation()) && ((currItem->annotation().Type() == Annotation::Combobox) || (currItem->annotation().Type() == Annotation::Listbox)))))
+ 					itemError.insert(TextOverflow, 0);
+ 
+-				if (checkerSettings.checkEmptyTextFrames && (currItem->itemText.length()==0 || currItem->frameUnderflows()))
++				if (checkerSettings.checkEmptyTextFrames && (currItem->itemText.length() == 0 || currItem->frameUnderflows()))
+ 				{
+ 					bool isEmptyAnnotation = (currItem->isAnnotation() && 
+ 					                         ((currItem->annotation().Type() == Annotation::Link) ||
+--- a/scribus/imagedataloaders/scimgdataloader_pdf.cpp
++++ b/scribus/imagedataloaders/scimgdataloader_pdf.cpp
+@@ -55,10 +55,16 @@ bool ScImgDataLoader_PDF::loadPicture(co
+ #ifdef HAVE_PODOFO
+ 	try
+ 	{
+-		PoDoFo::PdfError::EnableDebug( false );
+-		PoDoFo::PdfError::EnableLogging( false );
+-		PoDoFo::PdfMemDocument doc( fn.toLocal8Bit().data() );
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PoDoFo::PdfMemDocument doc;
++		doc.Load(fn.toLocal8Bit().data());
++		m_imageInfoRecord.numberOfPages = doc.GetPages().GetCount();
++#else
++		PoDoFo::PdfError::EnableDebug(false);
++		PoDoFo::PdfError::EnableLogging(false);
++		PoDoFo::PdfMemDocument doc(fn.toLocal8Bit().data());
+ 		m_imageInfoRecord.numberOfPages = doc.GetPageCount();
++#endif
+ 		if (page > m_imageInfoRecord.numberOfPages)
+ 		{
+ 			qDebug() << "Incorrect page number specified!";
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -30,6 +30,10 @@ for which a new license (GPL+exception)
+ #ifdef HAVE_PODOFO
+ using namespace PoDoFo;
+ 
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
++#define IsRealStrict IsReal
++#endif
++
+ static QHash<QString, PDFContentStreamKeyword> kwNameMap;
+ 
+ // we gonna need a map from string values to the defined enum of pdf keywords
+@@ -77,10 +81,13 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 
+ 	m_pdfdoc = nullptr;
+ 
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+ 	PdfError::EnableDebug( false );
++#endif
+ 	try
+ 	{
+-		m_pdfdoc = new PdfMemDocument(filename.toLocal8Bit().data());
++		m_pdfdoc = new PdfMemDocument();
++		m_pdfdoc->Load(filename.toLocal8Bit().data());
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -99,7 +106,12 @@ bool PDFAnalyzer::inspectPDF(int pageNum
+ {
+ 	if (!m_pdfdoc)
+ 		return false;
++
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++	PdfPage* page = &(m_pdfdoc->GetPages().GetPageAt(pageNum));
++#else
+ 	PdfPage* page = m_pdfdoc->GetPage(pageNum);
++#endif
+ 	return page ? inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs) : false;
+ }
+ 
+@@ -139,7 +151,13 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ 					PdfObject* pBase = &base;
+ 					if (base.IsReference())
+ 					{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++						PdfDocument* pdfdoc = cs->GetDocument();
++						PdfIndirectObjectList& pdf_iol = pdfdoc->GetObjects();
++						pBase = pdf_iol.GetObject(base.GetReference());
++#else
+ 						pBase = cs->GetOwner()->GetObject(base.GetReference());
++#endif
+ 					}
+ #if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 9, 7))
+ 					pBase->SetOwner(cs->GetOwner());
+@@ -180,11 +198,21 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		// get hold of a PdfObject pointer of this canvas
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PdfObject* canvasObject = page ? &(page->GetObject()) : &(dynamic_cast<PdfXObject*>(canvas)->GetObject());
++
++#else
+ 		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++#endif
+ 		PdfDictionary* canvasDict = (canvasObject && canvasObject->IsDictionary()) ? &(canvasObject->GetDictionary()) : nullptr;
+ 
+ 		// find a resource with ColorSpace entry
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PdfResources* canvasRsrc = canvas->GetResources();
++		PdfObject* resources = &(canvasRsrc->GetObject());
++#else
+ 		PdfObject* resources = canvas->GetResources();
++#endif
+ 		for (PdfDictionary* par = canvasDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+ 			resources = par->FindKey("Resources");
+@@ -234,6 +262,468 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 
+ 	try
+ 	{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		// start parsing the content stream
++		PdfContentReaderArgs tokenizerArgs = { PdfContentReaderFlags::DontFollowXObjectForms };
++		PdfContentStreamReader tokenizer(*canvas, tokenizerArgs);
++		PdfContent pdfContent;
++		PdfVariant var;
++		bool readToken;
++
++		int tokenNumber = 0;
++		bool inlineImgDict = false;
++		QList<PdfVariant> args;
++		QStack<PDFGraphicState> gsStack;
++		PDFGraphicState currGS;
++		while ((readToken = tokenizer.TryReadNext(pdfContent)))
++		{
++			++tokenNumber;
++			if (pdfContent.Type == PdfContentType::Operator)
++			{
++				args.clear();
++				int stackSize = pdfContent.Stack.size();
++				for (size_t i = 0; i < stackSize; ++i)
++					args.append(pdfContent.Stack[stackSize - 1 - i]);
++				switch (pdfContent.Operator)
++				{
++				case PdfOperator::q:
++					gsStack.push(currGS);
++					break;
++				case PdfOperator::Q:
++					currGS = gsStack.pop();
++					break;
++				case PdfOperator::cm:
++				{
++					if (args.size() == 6)
++					{
++						double mt[6];
++						for (int i = 0; i < 6; ++i)
++						{
++							mt[i] = args[i].GetReal();
++						}
++						QTransform transMatrix(mt[0], mt[1], mt[2], mt[3], mt[4], mt[5]);
++						currGS.ctm = transMatrix * currGS.ctm;
++					}
++				}
++				break;
++				case PdfOperator::w:
++					currGS.lineWidth = args[0].GetReal();
++					break;
++				case PdfOperator::J:
++					currGS.lineCap = args[0].GetNumber();
++					break;
++				case PdfOperator::j:
++					currGS.lineJoin = args[0].GetNumber();
++					break;
++				case PdfOperator::M:
++					currGS.lineJoin = args[0].GetReal();
++					break;
++				case PdfOperator::d:
++				{
++					currGS.dashPattern.first.clear();
++					PdfArray dashArr = args[0].GetArray();
++					for (uint i = 0; i < dashArr.size(); ++i)
++						currGS.dashPattern.first.append(dashArr[i].GetNumber());
++					currGS.dashPattern.second = args[1].GetNumber();
++				}
++				break;
++				case PdfOperator::g:
++					if (!usedColorSpaces.contains(CS_DeviceGray))
++						usedColorSpaces.append(CS_DeviceGray);
++					currGS.fillCS = CS_DeviceGray;
++					currGS.fillColor.clear();
++					currGS.fillColor.append(args[0].GetReal());
++					break;
++				case PdfOperator::G:
++					if (!usedColorSpaces.contains(CS_DeviceGray))
++						usedColorSpaces.append(CS_DeviceGray);
++					currGS.strokeCS = CS_DeviceGray;
++					currGS.strokeColor.clear();
++					currGS.strokeColor.append(args[0].GetReal());
++					break;
++				case PdfOperator::rg:
++					if (!usedColorSpaces.contains(CS_DeviceRGB))
++						usedColorSpaces.append(CS_DeviceRGB);
++					currGS.fillCS = CS_DeviceRGB;
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.fillColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::RG:
++					if (!usedColorSpaces.contains(CS_DeviceRGB))
++						usedColorSpaces.append(CS_DeviceRGB);
++					currGS.strokeCS = CS_DeviceRGB;
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.strokeColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::k:
++					if (!usedColorSpaces.contains(CS_DeviceCMYK))
++						usedColorSpaces.append(CS_DeviceCMYK);
++					currGS.fillCS = CS_DeviceCMYK;
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.fillColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::K:
++					if (!usedColorSpaces.contains(CS_DeviceCMYK))
++						usedColorSpaces.append(CS_DeviceCMYK);
++					currGS.strokeCS = CS_DeviceCMYK;
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.strokeColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::cs:
++				{
++					if (args.size() == 1 && args[0].IsName())
++					{
++						if (args[0].GetName() == "DeviceGray")
++						{
++							currGS.fillCS = CS_DeviceGray;
++							currGS.fillColor.clear();
++							currGS.fillColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceGray))
++								usedColorSpaces.append(CS_DeviceGray);
++						}
++						else if (args[0].GetName() == "DeviceRGB")
++						{
++							currGS.fillCS = CS_DeviceRGB;
++							currGS.fillColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.fillColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceRGB))
++								usedColorSpaces.append(CS_DeviceRGB);
++						}
++						else if (args[0].GetName() == "DeviceCMYK")
++						{
++							currGS.fillCS = CS_DeviceCMYK;
++							currGS.fillColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.fillColor.append(0);
++							currGS.fillColor.append(1);
++							if (!usedColorSpaces.contains(CS_DeviceCMYK))
++								usedColorSpaces.append(CS_DeviceCMYK);
++						}
++						else if (args[0].GetName() == "Pattern")
++						{
++							currGS.fillCS = CS_Pattern;
++							if (!usedColorSpaces.contains(CS_Pattern))
++								usedColorSpaces.append(CS_Pattern);
++						}
++						else
++						{
++							if (processedNamedCS.contains(args[0].GetName()))
++							{
++								currGS.fillCS = processedNamedCS.value(args[0].GetName());
++							}
++							else
++							{
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								{
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PDFColorSpace retval = getCSType(csEntry);
++									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++										usedColorSpaces.append(retval);
++									currGS.fillCS = retval;
++									processedNamedCS.insert(args[0].GetName(), retval);
++								}
++								else
++								{
++									qDebug() << "Supplied colorspace is undefined! File:" << m_filename;
++									return false;
++								}
++							}
++						}
++					}
++					else
++					{
++						qDebug() << "Wrong syntax in specifying color space! File:" << m_filename;
++						return false;
++					}
++				}
++				break;
++				case PdfOperator::CS:
++				{
++					if (args.size() == 1 && args[0].IsName())
++					{
++						if (args[0].GetName() == "DeviceGray")
++						{
++							currGS.strokeCS = CS_DeviceGray;
++							currGS.strokeColor.clear();
++							currGS.strokeColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceGray))
++								usedColorSpaces.append(CS_DeviceGray);
++						}
++						else if (args[0].GetName() == "DeviceRGB")
++						{
++							currGS.fillCS = CS_DeviceRGB;
++							currGS.strokeColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.strokeColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceRGB))
++								usedColorSpaces.append(CS_DeviceRGB);
++						}
++						else if (args[0].GetName() == "DeviceCMYK")
++						{
++							currGS.fillCS = CS_DeviceCMYK;
++							currGS.strokeColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.strokeColor.append(0);
++							currGS.strokeColor.append(1);
++							if (!usedColorSpaces.contains(CS_DeviceCMYK))
++								usedColorSpaces.append(CS_DeviceCMYK);
++						}
++						else if (args[0].GetName() == "Pattern")
++						{
++							currGS.fillCS = CS_Pattern;
++							if (!usedColorSpaces.contains(CS_Pattern))
++								usedColorSpaces.append(CS_Pattern);
++						}
++						else
++						{
++							if (processedNamedCS.contains(args[0].GetName()))
++							{
++								currGS.strokeCS = processedNamedCS.value(args[0].GetName());
++							}
++							else
++							{
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								{
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PDFColorSpace retval = getCSType(csEntry);
++									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++										usedColorSpaces.append(retval);
++									currGS.strokeCS = retval;
++									processedNamedCS.insert(args[0].GetName(), retval);
++								}
++								else
++								{
++									qDebug() << "Supplied colorspace is undefined! File:" << m_filename;
++									return false;
++								}
++							}
++						}
++					}
++					else
++					{
++						qDebug() << "Wrong syntax in specifying color space! File:" << m_filename;
++						return false;
++					}
++				}
++				break;
++				case PdfOperator::sc:
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.fillColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::SC:
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.strokeColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::scn:
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++					{
++						if (args[i].IsRealStrict() || args[i].IsNumber())
++							currGS.fillColor.append(args[i].GetReal());
++					}
++					break;
++				case PdfOperator::SCN:
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++					{
++						if (args[i].IsRealStrict() || args[i].IsNumber())
++							currGS.strokeColor.append(args[i].GetReal());
++					}
++					break;
++				case PdfOperator::Do: // image or form XObject
++					// Handled in PdfContentType::DoXObject
++					break;
++				case PdfOperator::BI:
++					inlineImgDict = true;
++					break;
++				case PdfOperator::ID:
++					if (inlineImgDict)
++					{
++						PdfName colorspace("ColorSpace");
++						PdfName cs("CS");
++						if (args.contains(colorspace) || args.contains(cs))
++						{
++							int csIdx = args.contains(colorspace) ? args.indexOf(colorspace) : args.indexOf(cs);
++							if (args[csIdx + 1].IsName())
++							{
++								PdfName csName = args[csIdx + 1].GetName();
++								if ((csName == "G" || csName == "DeviceGray") && !usedColorSpaces.contains(CS_DeviceGray))
++									usedColorSpaces.append(CS_DeviceGray);
++								else if ((csName == "RGB" || csName == "DeviceRGB") && !usedColorSpaces.contains(CS_DeviceRGB))
++									usedColorSpaces.append(CS_DeviceRGB);
++								else if ((csName == "CMYK" || csName == "DeviceCMYK") && !usedColorSpaces.contains(CS_DeviceCMYK))
++									usedColorSpaces.append(CS_DeviceCMYK);
++								else if (!processedNamedCS.contains(csName))
++								{
++									if (colorSpacesDict && colorSpacesDict->FindKey(csName))
++									{
++										PdfObject* csEntry = colorSpacesDict->FindKey(csName);
++										if (csEntry)
++										{
++											PDFColorSpace retval = getCSType(csEntry);
++											if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++												usedColorSpaces.append(retval);
++											processedNamedCS.insert(csName, retval);
++										}
++									}
++									else
++									{
++										qDebug() << "Supplied colorspace for inline image is undefined!";
++										return false;
++									}
++								}
++							}
++						}
++						PdfName height("Height");
++						PdfName h("H");
++						PdfName width("Width");
++						PdfName w("W");
++						if ((args.contains(height) || args.contains(h)) && (args.contains(width) || args.contains(w)))
++						{
++							int heightIdx = args.contains(height) ? args.indexOf(height) : args.indexOf(h);
++							int widthIdx = args.contains(width) ? args.indexOf(width) : args.indexOf(w);
++							double height = args[heightIdx + 1].GetReal();
++							double width = args[widthIdx + 1].GetReal();
++							PDFImage img;
++							img.imgName = "Inline Image";
++							img.dpiX = qRound(width / (currGS.ctm.m11() / 72));
++							img.dpiY = qRound(height / (currGS.ctm.m22() / 72));
++							imgs.append(img);
++						}
++						inlineImgDict = false;
++					}
++					break;
++				case PdfOperator::gs:
++				{
++					if (!processedNamedGS.contains(args[0].GetName()))
++					{
++						if (args.size() == 1 && args[0].IsName() && extGStatesDict)
++						{
++							PdfObject* extGStateObj = extGStatesDict->FindKey(args[0].GetName());
++							if (extGStateObj)
++							{
++								inspectExtGStateObj(extGStateObj, usedColorSpaces, hasTransparency, usedFonts, currGS);
++							}
++							else
++							{
++								qDebug() << "Named graphic state used with gs operator is undefined in current ExtGState. File:" << m_filename;
++								return false;
++							}
++							processedNamedGS.append(args[0].GetName());
++						}
++						else
++						{
++							qDebug() << "Wrong syntax in applying extended graphic state (gs operator) or there's no ExtGState defined! File:" << m_filename;
++							return false;
++						}
++					}
++				}
++				break;
++				case PdfOperator::Tf:
++				{
++					if (processedNamedFont.contains(args[0].GetName()))
++					{
++						currGS.font.first = processedNamedFont.value(args[0].GetName());
++						currGS.font.second = args[1].GetReal();
++					}
++					else
++					{
++						if (args.size() == 2 && args[0].IsName() && fontsDict)
++						{
++							PdfObject* fontObj = fontsDict->FindKey(args[0].GetName());
++							if (fontObj)
++							{
++								PDFFont retval = getFontInfo(fontObj);
++								usedFonts.append(retval);
++								processedNamedFont.insert(args[0].GetName(), retval);
++								currGS.font.first = retval;
++								currGS.font.second = args[1].GetReal();
++							}
++							else
++							{
++								qDebug() << "The specified font cannot be found in current Resources! File:" << m_filename;
++								return false;
++							}
++						}
++						else
++						{
++							qDebug() << "Wrong syntax in use of Tf operator or there's no Font defined in current Resources dictionary! File:" << m_filename;
++							return false;
++						}
++					}
++				}
++				break;
++				case PdfOperator::Unknown:
++				default:
++					break;
++				}
++				args.clear();
++			}
++			if (pdfContent.Type == PdfContentType::DoXObject)
++			{
++				args.clear();
++				int stackSize = pdfContent.Stack.size();
++				for (size_t i = 0; i < stackSize; ++i)
++					args.append(pdfContent.Stack[stackSize - 1 - i]);
++				if (!processedNamedXObj.contains(args[0].GetName()))
++				{
++					if (args.size() == 1 && args[0].IsName() && xObjectsDict)
++					{
++						PdfObject* xObject = xObjectsDict->FindKey(args[0].GetName());
++						PdfDictionary* xObjectDict = (xObject && xObject->IsDictionary()) ? &(xObject->GetDictionary()) : nullptr;
++						PdfObject* subtypeObject = xObjectDict ? xObjectDict->FindKey("Subtype") : nullptr;
++						if (subtypeObject && subtypeObject->IsName())
++						{
++							if (subtypeObject->GetName() == "Image")
++							{
++								PdfObject* imgColorSpace = xObjectDict->FindKey("ColorSpace");
++								if (imgColorSpace)
++								{
++									PDFColorSpace retval = getCSType(imgColorSpace);
++									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++										usedColorSpaces.append(retval);
++								}
++								PdfObject* sMaskObj = xObjectDict->FindKey("SMask");
++								if (sMaskObj)
++									hasTransparency = true;
++								PDFImage img;
++								img.imgName = args[0].GetName().GetEscapedName().c_str();
++								double width = xObjectDict->FindKey("Width")->GetReal();
++								double height = xObjectDict->FindKey("Height")->GetReal();
++								img.dpiX = qRound(width / (currGS.ctm.m11() / 72));
++								img.dpiY = qRound(height / (currGS.ctm.m22() / 72));
++								imgs.append(img);
++							}
++							else if (subtypeObject->GetName() == "Form")
++							{
++								std::unique_ptr<PdfXObjectForm> xObj;
++								PdfXObject::TryCreateFromObject(*xObject, xObj);
++								inspectCanvas(xObj.get(), usedColorSpaces, hasTransparency, usedFonts, imgs); // recursive call
++							}
++						}
++						else
++						{
++							qDebug() << "Supplied external object is undefined! File:" << m_filename;
++							return false;
++						}
++						processedNamedXObj.append(args[0].GetName());
++					}
++					else
++					{
++						qDebug() << "Wrong syntax for Do operator or there's no XObject defined! File:" << m_filename;
++						return false;
++					}
++				}
++			}
++		}
++#else
+ 		// start parsing the content stream
+ 		PdfContentsTokenizer tokenizer(canvas);
+ 		EPdfContentsType t;
+@@ -269,7 +759,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					if (args.size() == 6)
+ 					{
+ 						double mt[6];
+-						for (int i=0; i<6; ++i)
++						for (int i = 0; i < 6; ++i)
+ 						{
+ 							mt[i] = args[i].GetReal();
+ 						}
+@@ -294,7 +784,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					currGS.dashPattern.first.clear();
+ 					PdfArray dashArr = args[0].GetArray();
+-					for (uint i=0; i<dashArr.size(); ++i)
++					for (uint i = 0; i < dashArr.size(); ++i)
+ 						currGS.dashPattern.first.append(dashArr[i].GetNumber());
+ 					currGS.dashPattern.second = args[1].GetNumber();
+ 					}
+@@ -318,7 +808,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceRGB);
+ 					currGS.fillCS = CS_DeviceRGB;
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.fillColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_RG:
+@@ -326,7 +816,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceRGB);
+ 					currGS.strokeCS = CS_DeviceRGB;
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.strokeColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_k:
+@@ -334,7 +824,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceCMYK);
+ 					currGS.fillCS = CS_DeviceCMYK;
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.fillColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_K:
+@@ -342,7 +832,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceCMYK);
+ 					currGS.strokeCS = CS_DeviceCMYK;
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.strokeColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_cs:
+@@ -361,7 +851,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceRGB;
+ 							currGS.fillColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.fillColor.append(0);
+ 							if (!usedColorSpaces.contains(CS_DeviceRGB))
+ 								usedColorSpaces.append(CS_DeviceRGB);
+@@ -370,7 +860,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceCMYK;
+ 							currGS.fillColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.fillColor.append(0);
+ 							currGS.fillColor.append(1);
+ 							if (!usedColorSpaces.contains(CS_DeviceCMYK))
+@@ -430,7 +920,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceRGB;
+ 							currGS.strokeColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.strokeColor.append(0);
+ 							if (!usedColorSpaces.contains(CS_DeviceRGB))
+ 								usedColorSpaces.append(CS_DeviceRGB);
+@@ -439,7 +929,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceCMYK;
+ 							currGS.strokeColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.strokeColor.append(0);
+ 							currGS.strokeColor.append(1);
+ 							if (!usedColorSpaces.contains(CS_DeviceCMYK))
+@@ -485,17 +975,17 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					break;
+ 				case KW_sc:
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.fillColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_SC:
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.strokeColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_scn:
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 					{
+ 						if (args[i].IsReal() || args[i].IsNumber())
+ 							currGS.fillColor.append(args[i].GetReal());
+@@ -503,7 +993,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					break;
+ 				case KW_SCN:
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 					{
+ 						if (args[i].IsReal() || args[i].IsNumber())
+ 							currGS.strokeColor.append(args[i].GetReal());
+@@ -689,6 +1179,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 				args.clear();
+ 			}
+ 		}
++#endif
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -714,14 +1205,14 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 	{
+ 		PdfArray arr = bmObj->GetArray();
+ 		currGS.blendModes.clear();
+-		for(uint i=0; i<arr.GetSize(); ++i)
++		for (uint i = 0; i < arr.GetSize(); ++i)
+ 			currGS.blendModes.append(arr[i].GetName().GetEscapedName().c_str());
+ 		if (arr[0].IsName() && !(arr[0].GetName() == "Normal" || arr[0].GetName() == "Compatible"))
+ 			hasTransparency = true;
+ 	}
+ 
+ 	PdfObject* caObj = extGStateDict ? extGStateDict->FindKey("ca") : nullptr;
+-	if (caObj && (caObj->IsReal() || caObj->IsNumber()))
++	if (caObj && (caObj->IsRealStrict() || caObj->IsNumber()))
+ 	{
+ 		currGS.fillAlphaConstant = caObj->GetReal();
+ 		if (caObj->GetReal() < 1)
+@@ -729,7 +1220,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 	}
+ 
+ 	PdfObject* cAObj = extGStateDict ? extGStateDict->FindKey("CA") : nullptr;
+-	if (cAObj && (cAObj->IsReal() || cAObj->IsNumber()))
++	if (cAObj && (cAObj->IsRealStrict() || cAObj->IsNumber()))
+ 	{
+ 		if (cAObj->GetReal() < 1)
+ 			hasTransparency = true;
+@@ -780,7 +1271,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		PdfObject dObjA = dObj->GetArray()[0];
+ 		PdfArray dashArr = dObjA.GetArray();
+ 		currGS.dashPattern.first.clear();
+-		for (uint i=0; i<dashArr.GetSize(); ++i)
++		for (uint i = 0; i < dashArr.GetSize(); ++i)
+ 			currGS.dashPattern.first.append(dashArr[i].GetNumber());
+ 		PdfObject dObjB = dObj->GetArray()[1];
+ 		currGS.dashPattern.second = dObjB.GetNumber();
+@@ -816,7 +1307,11 @@ PDFFont PDFAnalyzer::getFontInfo(PdfObje
+ 		if (descendantFonts && descendantFonts->IsArray())
+ 		{
+ 			const PdfReference& refDescFont = descendantFonts->GetArray()[0].GetReference();
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++			PdfObject* descendantFont = descendantFonts->GetDocument()->GetObjects().GetObject(refDescFont);
++#else
+ 			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
++#endif
+ 			PdfDictionary* descendantFontDict = (descendantFont && descendantFont->IsDictionary()) ? &(descendantFont->GetDictionary()) : nullptr;
+ 			const PdfObject* subtypeDescFont = descendantFontDict->FindKey("Subtype");
+ 			fontDesc = &(descendantFontDict->MustGetKey("FontDescriptor"));
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9783,22 +9783,298 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 	QScopedPointer<PoDoFo::PdfMemDocument> doc;
+ 	try
+ 	{
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PoDoFo::PdfError::EnableDebug(false);
+ 		PoDoFo::PdfError::EnableLogging(false);
+-		doc.reset(new PoDoFo::PdfMemDocument(fn.toLocal8Bit().data()));
++#endif
++		doc.reset(new PoDoFo::PdfMemDocument());
++		doc->Load(fn.toLocal8Bit().data());
+ 	}
+-	catch(PoDoFo::PdfError& e)
++	catch (PoDoFo::PdfError& e)
+ 	{
+ 		qDebug() << "PoDoFo error, falling back to raster!";
+ 		e.PrintErrorMsg();
+ 		return false;
+ 	}
+ 
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	try
+ 	{
+-		PoDoFo::PdfPage*   page      = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
+-		PoDoFo::PdfObject* pageObj   = page ? page->GetObject() : nullptr;
+-		PoDoFo::PdfObject* contents  = page ? page->GetContents() : nullptr;
++		PoDoFo::PdfPage& page = doc->GetPages().GetPageAt(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
++		PoDoFo::PdfObject& pageObj = page.GetObject();
++		PoDoFo::PdfObject* contents = page.GetContents() ? &(page.GetContents()->GetObject()) : nullptr;
++		PoDoFo::PdfObject* resources = page.GetResources() ? &(page.GetResources()->GetObject()) : nullptr;
++		PoDoFo::PdfDictionary* pageObjDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
++		{
++			resources = par->FindKey("Resources");
++			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
++			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
++		}
++		if (contents && contents->GetDataType() == PoDoFo::PdfDataType::Dictionary)
++		{
++			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
++			PoDoFo::PdfObjectStream* stream = contents->GetStream();
++			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
++			QList<PoDoFo::PdfReference> referencedObjects;
++			PoDoFo::PdfObject* nextObj { nullptr };
++			PdfId xObj = writer.newObject();
++			PdfId xResources = writer.newObject();
++			PdfId xParents = 0;
++			importedObjects[page.GetObject().GetIndirectReference()] = xObj;
++			writer.startObj(xObj);
++			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
++			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
++			int rotation = page.GetRotationRaw();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
++			QTransform pageM;
++			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
++			pageM.rotate(rotation);
++			if (rotation == 90)
++				pageM.translate(0.0, -imgHeight);
++			else if (rotation == 180)
++				pageM.translate(-imgWidth, -imgHeight);
++			else if (rotation == 270)
++				pageM.translate(-imgWidth, 0.0);
++			pageM.scale(imgWidth, imgHeight);
++			pageM = pageM.inverted();
++			PutDoc("\n/BBox [" + Pdf::toPdf(pageRect.GetLeft()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetLeft() + pageRect.Width));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
++			PutDoc("]");
++			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
++			PutDoc("]");
++			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
++			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			if (nextObj)
++			{
++				PutDoc("\n/Group "); // PDF 1.4
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++			/*
++			PoDoFo::PdfObject parents = pageDict->FindKey("StructParents");
++			if (parents)
++			{
++				xParents = writer.newObject();
++				PutDoc("\n/StructParents " + Pdf::toPdf(xParents)); // required if page uses structured content
++			}
++			*/
++
++			const char* mbuffer = nullptr;
++			long mlen = 0;
++			PoDoFo::charbuff strBuff = stream->GetCopy(true);
++			mlen = strBuff.size();
++			mbuffer = strBuff.c_str();
++			if (mbuffer[mlen - 1] == '\n')
++				--mlen;
++			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
++			nextObj = contentsDict.FindKey("Filter");
++			if (nextObj)
++			{
++				PutDoc("\n/Filter ");
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++			nextObj = contentsDict.FindKey("DecodeParms");
++			if (nextObj)
++			{
++				PutDoc("\n/DecodeParms ");
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++			PutDoc("\n>>\nstream\n");
++			{
++				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
++				EncodeArrayToStream(buffer, xObj);
++			}  // disconnect QByteArray from raw data
++			PutDoc("\nendstream");
++			writer.endObj(xObj);
++			// write resources
++			if (resources)
++			{
++				copyPoDoFoObject(resources, xResources, importedObjects);
++			}
++			else
++			{
++				writer.startObj(xResources);
++				PutDoc("<< >>");
++				writer.endObj(xResources);
++			}
++			if (xParents)
++			{
++				// create structured parents
++			}
++			// write referenced objects
++			PoDoFo::PdfIndirectObjectList& allObjects = contents->GetDocument()->GetObjects();
++			for (int i = 0; i < referencedObjects.size(); ++i)
++			{
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects.GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
++			}
++
++			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
++			imgInfo.ResNum = ResCount;
++			ResCount++;
++			// Avoid a divide-by-zero if width/height are less than 1 point:
++			imgInfo.Width = qMax(1, (int) imgWidth);
++			imgInfo.Height = qMax(1, (int) imgHeight);
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
++			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
++			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
++			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
++			imgInfo.sya = sy * imgHeight / imgInfo.Height;
++
++			return true;
++		}
++		if (contents && contents->GetDataType() == PoDoFo::PdfDataType::Array)//Page contents might be an array
++		{
++			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
++			QList<PoDoFo::PdfReference> referencedObjects;
++			PoDoFo::PdfObject* nextObj;
++			PdfId xObj = writer.newObject();
++			PdfId xResources = writer.newObject();
++			PdfId xParents = 0;
++			importedObjects[page.GetObject().GetIndirectReference()] = xObj;
++			writer.startObj(xObj);
++			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
++			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
++			int rotation = page.GetRotationRaw();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
++			QTransform pageM;
++			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
++			pageM.rotate(rotation);
++			if (rotation == 90)
++				pageM.translate(0.0, -imgHeight);
++			else if (rotation == 180)
++				pageM.translate(-imgWidth, -imgHeight);
++			else if (rotation == 270)
++				pageM.translate(-imgWidth, 0.0);
++			pageM.scale(imgWidth, imgHeight);
++			pageM = pageM.inverted();
++			PutDoc("\n/BBox [" + Pdf::toPdf(pageRect.GetLeft()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetLeft() + pageRect.Width));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
++			PutDoc("]");
++			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
++			PutDoc("]");
++			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
++			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			if (nextObj)
++			{
++				PutDoc("\n/Group "); // PDF 1.4
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++
++			const char* mbuffer = nullptr;
++			long mlen = 0;
++			PoDoFo::charbuff strBuffer;
++			PoDoFo::StringStreamDevice strStreamDev(strBuffer);
++			PoDoFo::PdfArray carray(page.GetContents()->GetObject().GetArray());
++			for (unsigned int ci = 0; ci < carray.size(); ++ci)
++			{
++				if (carray[ci].HasStream())
++				{
++					carray[ci].GetStream()->CopyTo(strStreamDev, false);
++				}
++				else if (carray[ci].IsReference())
++				{
++					nextObj = doc->GetObjects().GetObject(carray[ci].GetReference());
++
++					while (nextObj != nullptr)
++					{
++						if (nextObj->IsReference())
++						{
++							nextObj = doc->GetObjects().GetObject(nextObj->GetReference());
++						}
++						else if (nextObj->HasStream())
++						{
++							nextObj->GetStream()->CopyTo(strStreamDev, false);
++							break;
++						}
++					}
++				}
++			}
++			// end of copy
++			mlen = strBuffer.size();
++			mbuffer = strBuffer.c_str();
++
++			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
++			PutDoc("\n>>\nstream\n");
++			{
++				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
++				EncodeArrayToStream(buffer, xObj);
++			}  // disconnect QByteArray from raw data
++			PutDoc("\nendstream");
++			writer.endObj(xObj);
++			// write resources
++			if (resources)
++			{
++				copyPoDoFoObject(resources, xResources, importedObjects);
++			}
++			else
++			{
++				writer.startObj(xResources);
++				PutDoc("<< >>");
++				writer.endObj(xResources);
++			}
++			if (xParents)
++			{
++				// create structured parents
++			}
++			// write referenced objects
++			PoDoFo::PdfIndirectObjectList& allObjects = contents->GetDocument()->GetObjects();
++			for (int i = 0; i < referencedObjects.size(); ++i)
++			{
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects.GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
++			}
++
++			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
++			imgInfo.ResNum = ResCount;
++			ResCount++;
++			// Avoid a divide-by-zero if width/height are less than 1 point:
++			imgInfo.Width = qMax(1, (int) imgWidth);
++			imgInfo.Height = qMax(1, (int) imgHeight);
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
++			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
++			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
++			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
++			imgInfo.sya = sy * imgHeight / imgInfo.Height;
++
++			return true;
++		}
++	}
++	catch (PoDoFo::PdfError& e)
++	{
++		fatalError = true;
++		qDebug() << "PoDoFo error!";
++		e.PrintErrorMsg();
++		return false;
++	}
++#else
++	try
++	{
++		PoDoFo::PdfPage* page = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
++		PoDoFo::PdfObject* pageObj = page ? page->GetObject() : nullptr;
++		PoDoFo::PdfObject* contents = page ? page->GetContents() : nullptr;
+ 		PoDoFo::PdfObject* resources = page ? page->GetResources() : nullptr;
+ 		PoDoFo::PdfDictionary* pageObjDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+ 		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
+@@ -9807,13 +10083,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
+ 			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
+ 		}
+-		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Dictionary)
++		if (contents && contents->GetDataType() == PoDoFo::ePdfDataType_Dictionary)
+ 		{
+ 			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
+ 			PoDoFo::PdfStream* stream = contents->GetStream();
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+-			PoDoFo::PdfObject* nextObj { nullptr };
++			const PoDoFo::PdfObject* nextObj { nullptr };
+ 			PdfId xObj = writer.newObject();
+ 			PdfId xResources = writer.newObject();
+ 			PdfId xParents = 0;
+@@ -9822,7 +10098,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9841,14 +10117,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-								 + Pdf::toPdf(pageM.m12()) + " "
+-								 + Pdf::toPdf(pageM.m21()) + " "
+-								 + Pdf::toPdf(pageM.m22()) + " "
+-								 + Pdf::toPdf(pageM.dx())  + " "
+-								 + Pdf::toPdf(pageM.dy())  + " ");
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfObject* pageObj = page->GetObject();
+ 			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+ 			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+@@ -9864,16 +10139,16 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				PutDoc("\n/StructParents " + Pdf::toPdf(xParents)); // required if page uses structured content
+ 			}
+ 			*/
+-			char * mbuffer = nullptr;
+-			long mlen = 0;
+ 
+ 			// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
++			char* mbuffer = nullptr;
++			long mlen = 0;
+ 			PoDoFo::PdfMemoryOutputStream oStream(1);
+ 			stream->GetCopy(&oStream);
+ 			oStream.Close();
+ 			mlen = oStream.GetLength();
+ 			mbuffer = oStream.TakeBuffer();
+-			if (mbuffer[mlen-1] == '\n')
++			if (mbuffer[mlen - 1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+ 			nextObj = contentsDict.FindKey("Filter");
+@@ -9893,7 +10168,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 				EncodeArrayToStream(buffer, xObj);
+ 			}  // disconnect QByteArray from raw data
+-			free (mbuffer);
++			free(mbuffer);
+ 			PutDoc("\nendstream");
+ 			writer.endObj(xObj);
+ 			// write resources
+@@ -9915,18 +10190,19 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PoDoFo::PdfVecObjects* allObjects = contents->GetOwner();
+ 			for (int i=0; i < referencedObjects.size(); ++i)
+ 			{
+-				nextObj = allObjects->GetObject(referencedObjects[i]);
+-				copyPoDoFoObject(nextObj, importedObjects[nextObj->Reference()], importedObjects);
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects->GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
+ 			}
+ 
+ 			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
+ 			imgInfo.ResNum = ResCount;
+ 			ResCount++;
+ 			// Avoid a divide-by-zero if width/height are less than 1 point:
+-			imgInfo.Width  = qMax(1, (int) imgWidth);
++			imgInfo.Width = qMax(1, (int) imgWidth);
+ 			imgInfo.Height = qMax(1, (int) imgHeight);
+-			imgInfo.xa  = sx * imgWidth / imgInfo.Width;
+-			imgInfo.ya  = sy * imgHeight / imgInfo.Height;
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
+ 			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
+ 			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
+ 			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
+@@ -9934,7 +10210,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 
+ 			return true;
+ 		}
+-		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Array)//Page contents might be an array
++		if (contents && contents->GetDataType() == PoDoFo::ePdfDataType_Array)//Page contents might be an array
+ 		{
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+@@ -9947,7 +10223,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9966,14 +10242,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-								 + Pdf::toPdf(pageM.m12()) + " "
+-								 + Pdf::toPdf(pageM.m21()) + " "
+-								 + Pdf::toPdf(pageM.m22()) + " "
+-								 + Pdf::toPdf(pageM.dx())  + " "
+-								 + Pdf::toPdf(pageM.dy())  + " ");
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfObject* pageObj = page->GetObject();
+ 			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+ 			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+@@ -9982,11 +10257,10 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+ 
+-			char * mbuffer = nullptr;
+-			long mlen = 0;
+ 			// copied from podofoimpose
+-			PoDoFo::PdfMemoryOutputStream outMemStream (1);
+-//			PoDoFo::PdfFilteredEncodeStream outMemStream (outMemStreamRaw, ePdfFilter_FlateDecode, false);
++			char* mbuffer = nullptr;
++			long mlen = 0;
++			PoDoFo::PdfMemoryOutputStream outMemStream(1);
+ 			PoDoFo::PdfArray carray(page->GetContents()->GetArray());
+ 			for (unsigned int ci = 0; ci < carray.size(); ++ci)
+ 			{
+@@ -10000,7 +10274,6 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 
+ 					while (nextObj != nullptr)
+ 					{
+-
+ 						if (nextObj->IsReference())
+ 						{
+ 							nextObj = doc->GetObjects().GetObject(nextObj->GetReference());
+@@ -10016,29 +10289,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			// end of copy
+ 			mlen = outMemStream.GetLength();
+ 			mbuffer = outMemStream.TakeBuffer();
+-//			if (mbuffer[mlen-1] == '\n')
+-//				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+-/*
+-			nextObj = contentsDict.FindKey("Filter");
+-			if (nextObj)
+-			{
+-				PutDoc("\n/Filter ");
+-				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+-			}
+-			nextObj = contentsDict.FindKey("DecodeParms");
+-			if (nextObj)
+-			{
+-				PutDoc("\n/DecodeParms ");
+-				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+-			}
+-*/
+ 			PutDoc("\n>>\nstream\n");
+ 			{
+ 				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 				EncodeArrayToStream(buffer, xObj);
+ 			}  // disconnect QByteArray from raw data
+-			free (mbuffer);
++			free(mbuffer);
+ 			PutDoc("\nendstream");
+ 			writer.endObj(xObj);
+ 			// write resources
+@@ -10058,20 +10315,21 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			}
+ 			// write referenced objects
+ 			PoDoFo::PdfVecObjects* allObjects = contents->GetOwner();
+-			for (int i=0; i < referencedObjects.size(); ++i)
++			for (int i = 0; i < referencedObjects.size(); ++i)
+ 			{
+-				nextObj = allObjects->GetObject(referencedObjects[i]);
+-				copyPoDoFoObject(nextObj, importedObjects[nextObj->Reference()], importedObjects);
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects->GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
+ 			}
+ 
+ 			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
+ 			imgInfo.ResNum = ResCount;
+ 			ResCount++;
+ 			// Avoid a divide-by-zero if width/height are less than 1 point:
+-			imgInfo.Width  = qMax(1, (int) imgWidth);
++			imgInfo.Width = qMax(1, (int) imgWidth);
+ 			imgInfo.Height = qMax(1, (int) imgHeight);
+-			imgInfo.xa  = sx * imgWidth / imgInfo.Width;
+-			imgInfo.ya  = sy * imgHeight / imgInfo.Height;
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
+ 			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
+ 			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
+ 			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
+@@ -10079,24 +10337,76 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 
+ 			return true;
+ 		}
+-
+ 	}
+-	catch(PoDoFo::PdfError& e)
++	catch (PoDoFo::PdfError& e)
+ 	{
+ 		fatalError = true;
+ 		qDebug() << "PoDoFo error!";
+ 		e.PrintErrorMsg();
+ 		return false;
+ 	}
+-#endif
++#endif // PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0)
++
++#endif // HAVE_PODOFO
+ 	return false;
+ }
+ 
+ 
+ #if HAVE_PODOFO
+ 
+-void PDFLibCore::copyPoDoFoDirect(const PoDoFo::PdfVariant* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, PdfId>& importedObjects)
++void PDFLibCore::copyPoDoFoDirect(const PoDoFo::PdfObject* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, PdfId>& importedObjects)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++	switch (obj->GetDataType())
++	{
++	case PoDoFo::PdfDataType::Reference:
++	{
++		const PoDoFo::PdfReference& reference(obj->GetReference());
++		PdfId objNr;
++		if (!importedObjects.contains(reference))
++		{
++			objNr = writer.newObject();
++			importedObjects[reference] = objNr;
++			referencedObjects.append(reference);
++		}
++		else
++		{
++			objNr = importedObjects[reference];
++		}
++		PutDoc(" " + Pdf::toPdf(objNr) + " 0 R");
++		break;
++	}
++	case PoDoFo::PdfDataType::Array:
++	{
++		const PoDoFo::PdfArray& array(obj->GetArray());
++		PutDoc("[");
++		for (uint i = 0; i < array.size(); ++i)
++			copyPoDoFoDirect(&(array[i]), referencedObjects, importedObjects);
++		PutDoc("]");
++		break;
++	}
++	case PoDoFo::PdfDataType::Dictionary:
++	{
++		const PoDoFo::PdfDictionary& dict(obj->GetDictionary());
++		PutDoc("<<");
++		for (auto k = dict.begin(); k != dict.end(); ++k)
++		{
++			std::string str("\n/" + k->first.GetEscapedName());
++			PutDoc(QByteArray::fromRawData(str.data(), str.size()));
++			copyPoDoFoDirect(&k->second, referencedObjects, importedObjects);
++		}
++		PutDoc(" >>");
++		break;
++	}
++	default:
++	{
++		std::string str;
++		obj->GetVariant().ToString(str);
++		str = " " + str;
++		PutDoc(QByteArray::fromRawData(str.data(), str.size()));
++	}
++	}
++#else
+ 	switch (obj->GetDataType())
+ 	{
+ 		case PoDoFo::ePdfDataType_Reference:
+@@ -10147,11 +10457,41 @@ void PDFLibCore::copyPoDoFoDirect(const
+ 			PutDoc(QByteArray::fromRawData(str.data(), str.size()));
+ 		}
+ 	}
+-
++#endif
+ }
+ 
+ void PDFLibCore::copyPoDoFoObject(const PoDoFo::PdfObject* obj, PdfId scObjID, QMap<PoDoFo::PdfReference, PdfId>& importedObjects)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++	const PoDoFo::PdfIndirectObjectList& allObjects = obj->GetDocument()->GetObjects();
++	QList<PoDoFo::PdfReference> referencedObjects;
++	writer.startObj(scObjID);
++	copyPoDoFoDirect(obj, referencedObjects, importedObjects);
++	if (obj->HasStream())
++	{
++		const PoDoFo::PdfObjectStream* stream = obj->GetStream();
++		PoDoFo::charbuff strBuff = stream->GetCopy(true);
++		const char* mbuffer = strBuff.c_str();
++		size_t mlen = strBuff.size();
++		if (mbuffer[mlen - 1] == '\n')
++			--mlen;
++		PutDoc("\nstream\n");
++		{
++			QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
++			EncodeArrayToStream(buffer, scObjID);
++		}
++		PutDoc("\nendstream");
++	}
++	PutDoc("");
++	writer.endObj(scObjID);
++	// recurse:
++	for (int i = 0; i < referencedObjects.size(); ++i)
++	{
++		const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++		const PoDoFo::PdfObject* nextObj = allObjects.GetObject(pdfRef);
++		copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
++	}
++#else
+ 	PoDoFo::PdfVecObjects* allObjects = obj->GetOwner();
+ 	QList<PoDoFo::PdfReference> referencedObjects;
+ 	writer.startObj(scObjID);
+@@ -10159,7 +10499,7 @@ void PDFLibCore::copyPoDoFoObject(const
+ 	if (obj->HasStream())
+ 	{
+ 		const PoDoFo::PdfStream* stream = obj->GetStream();
+-		char * mbuffer = nullptr;
++		char* mbuffer = nullptr;
+ 		long mlen = 0;
+ 
+ 		// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
+@@ -10168,14 +10508,14 @@ void PDFLibCore::copyPoDoFoObject(const
+ 		oStream.Close();
+ 		mlen = oStream.GetLength();
+ 		mbuffer = oStream.TakeBuffer();
+-		if (mbuffer[mlen-1] == '\n')
++		if (mbuffer[mlen - 1] == '\n')
+ 			--mlen;
+ 		PutDoc("\nstream\n");
+ 		{
+ 			QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 			EncodeArrayToStream(buffer, scObjID);
+ 		}  // disconnect QByteArray from raw data
+-		free (mbuffer);
++		free(mbuffer);
+ 		PutDoc("\nendstream");
+ 	}
+ 	PutDoc("");
+@@ -10183,9 +10523,11 @@ void PDFLibCore::copyPoDoFoObject(const
+ 	// recurse:
+ 	for (int i=0; i < referencedObjects.size(); ++i)
+ 	{
+-		PoDoFo::PdfObject* nextObj = allObjects->GetObject(referencedObjects[i]);
+-		copyPoDoFoObject(nextObj, importedObjects[nextObj->Reference()], importedObjects);
++		const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++		const PoDoFo::PdfObject* nextObj = allObjects->GetObject(pdfRef);
++		copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
+ 	}
++#endif
+ }
+ #endif
+ 
+--- a/scribus/pdflib_core.h
++++ b/scribus/pdflib_core.h
+@@ -225,8 +225,8 @@ private:
+ 	bool    PDF_Image(PageItem* c, const QString& fn, double sx, double sy, double x, double y, bool fromAN = false, const QString& Profil = "", bool Embedded = false, eRenderIntent Intent = Intent_Relative_Colorimetric, QByteArray* output = nullptr);
+ 	bool    PDF_EmbeddedPDF(PageItem* c, const QString& fn, double sx, double sy, double x, double y, ShIm& imgInfo, bool &fatalError);
+ #if HAVE_PODOFO
+-	void copyPoDoFoObject(const PoDoFo::PdfObject* obj, uint scObjID, QMap<PoDoFo::PdfReference, uint>& importedObjects);
+-	void copyPoDoFoDirect(const PoDoFo::PdfVariant* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, uint>& importedObjects);
++	void copyPoDoFoObject(const PoDoFo::PdfObject* obj, PdfId scObjID, QMap<PoDoFo::PdfReference, uint>& importedObjects);
++	void copyPoDoFoDirect(const PoDoFo::PdfObject* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, uint>& importedObjects);
+ #endif
+ 
+ 	quint32 encode32dVal(double val) const;
+--- a/scribus/plugins/import/ai/importai.cpp
++++ b/scribus/plugins/import/ai/importai.cpp
+@@ -581,13 +581,24 @@ bool AIPlug::extractFromPDF(const QStrin
+ 	}
+ 	try
+ 	{
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PoDoFo::PdfError::EnableDebug( false );
+ 		PoDoFo::PdfError::EnableLogging( false );
+-		PoDoFo::PdfMemDocument doc( infile.toLocal8Bit().data() );
++#endif
++		PoDoFo::PdfMemDocument doc;
++		doc.Load(infile.toLocal8Bit().data());
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PoDoFo::PdfPage* curPage = &(doc.GetPages().GetPageAt(0));
++#else
+ 		PoDoFo::PdfPage *curPage = doc.GetPage(0);
++#endif
+ 		if (curPage != nullptr)
+ 		{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++			PoDoFo::PdfObject* pageObj = &(curPage->GetObject());
++#else
+ 			PoDoFo::PdfObject* pageObj = curPage->GetObject();
++#endif
+ 			PoDoFo::PdfDictionary* pageDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+ 			PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
+ 			if (piece != nullptr)
+@@ -618,6 +629,33 @@ bool AIPlug::extractFromPDF(const QStrin
+ 					}
+ 					if (data != nullptr)
+ 					{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++						if (num == 2)
++						{
++							Key = name.arg(1);
++							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							PoDoFo::PdfObjectStream const* stream = data->GetStream();
++							PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++							qint64 bLen = strBuffer.size();
++							const char* Buffer = strBuffer.c_str();
++							outf.write(Buffer, bLen);
++						}
++						else
++						{
++							for (int a = 2; a < num; a++)
++							{
++								Key = name.arg(a);
++								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++								if (data == nullptr)
++									break;
++								PoDoFo::PdfObjectStream const* stream = data->GetStream();
++								PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++								qint64 bLen = strBuffer.size();
++								const char* Buffer = strBuffer.c_str();
++								outf.write(Buffer, bLen);
++							}
++						}
++#else
+ 						if (num == 2)
+ 						{
+ 							Key = name.arg(1);
+@@ -649,6 +687,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 								free( Buffer );
+ 							}
+ 						}
++#endif
+ 					}
+ 					ret = true;
+ 				}
diff --git a/srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch b/srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch
new file mode 100644
index 0000000000000..750d8fa0a9440
--- /dev/null
+++ b/srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch
@@ -0,0 +1,853 @@
+From 000d73d22b362a010bd4c80e6076343bc62119f3 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 16 Aug 2023 20:54:40 +0000
+Subject: [PATCH 10/13] #17005: Restore compatibility with podofo <= 0.9.6
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25604 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 6ca4984f122b46a6ab03300efab6b858b5c77a2d)
+---
+ scribus/pdf_analyzer.cpp               | 274 +++++++++++++++++++++----
+ scribus/pdflib_core.cpp                |  80 ++++----
+ scribus/plugins/import/ai/importai.cpp | 134 +++++++-----
+ 3 files changed, 350 insertions(+), 138 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -30,10 +30,6 @@ for which a new license (GPL+exception)
+ #ifdef HAVE_PODOFO
+ using namespace PoDoFo;
+ 
+-#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+-#define IsRealStrict IsReal
+-#endif
+-
+ static QHash<QString, PDFContentStreamKeyword> kwNameMap;
+ 
+ // we gonna need a map from string values to the defined enum of pdf keywords
+@@ -184,6 +180,7 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ 
+ bool PDFAnalyzer::inspectCanvas(PdfCanvas* canvas, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
+ 	PdfDictionary* colorSpacesDict { nullptr };
+ 	PdfDictionary* xObjectsDict { nullptr };
+@@ -198,21 +195,12 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		// get hold of a PdfObject pointer of this canvas
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PdfObject* canvasObject = page ? &(page->GetObject()) : &(dynamic_cast<PdfXObject*>(canvas)->GetObject());
+-
+-#else
+-		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
+-#endif
+ 		PdfDictionary* canvasDict = (canvasObject && canvasObject->IsDictionary()) ? &(canvasObject->GetDictionary()) : nullptr;
+ 
+ 		// find a resource with ColorSpace entry
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PdfResources* canvasRsrc = canvas->GetResources();
+ 		PdfObject* resources = &(canvasRsrc->GetObject());
+-#else
+-		PdfObject* resources = canvas->GetResources();
+-#endif
+ 		for (PdfDictionary* par = canvasDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+ 			resources = par->FindKey("Resources");
+@@ -262,26 +250,24 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 
+ 	try
+ 	{
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 		// start parsing the content stream
+ 		PdfContentReaderArgs tokenizerArgs = { PdfContentReaderFlags::DontFollowXObjectForms };
+ 		PdfContentStreamReader tokenizer(*canvas, tokenizerArgs);
+ 		PdfContent pdfContent;
+ 		PdfVariant var;
+-		bool readToken;
+ 
+ 		int tokenNumber = 0;
+ 		bool inlineImgDict = false;
+ 		QList<PdfVariant> args;
+ 		QStack<PDFGraphicState> gsStack;
+ 		PDFGraphicState currGS;
+-		while ((readToken = tokenizer.TryReadNext(pdfContent)))
++		while (tokenizer.TryReadNext(pdfContent))
+ 		{
+ 			++tokenNumber;
+ 			if (pdfContent.Type == PdfContentType::Operator)
+ 			{
+ 				args.clear();
+-				int stackSize = pdfContent.Stack.size();
++				size_t stackSize = pdfContent.Stack.size();
+ 				for (size_t i = 0; i < stackSize; ++i)
+ 					args.append(pdfContent.Stack[stackSize - 1 - i]);
+ 				switch (pdfContent.Operator)
+@@ -669,7 +655,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 			if (pdfContent.Type == PdfContentType::DoXObject)
+ 			{
+ 				args.clear();
+-				int stackSize = pdfContent.Stack.size();
++				size_t stackSize = pdfContent.Stack.size();
+ 				for (size_t i = 0; i < stackSize; ++i)
+ 					args.append(pdfContent.Stack[stackSize - 1 - i]);
+ 				if (!processedNamedXObj.contains(args[0].GetName()))
+@@ -723,7 +709,73 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 				}
+ 			}
+ 		}
++	}
++	catch (PdfError & e)
++	{
++		qDebug() << "Error in parsing content stream File:" << m_filename;
++		e.PrintErrorMsg();
++		return false;
++	}
++	return true;
+ #else
++	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
++	PdfObject* colorSpaceRes { nullptr };
++	PdfObject* xObjects { nullptr };
++	PdfObject* transGroup { nullptr };
++	PdfObject* extGState { nullptr };
++	PdfObject* fontRes { nullptr };
++	QMap<PdfName, PDFColorSpace> processedNamedCS;
++	QMap<PdfName, PDFFont> processedNamedFont;
++	QList<PdfName> processedNamedXObj;
++	QList<PdfName> processedNamedGS;
++	try
++	{
++		// get hold of a PdfObject pointer of this canvas
++		// needed for the finding resources code below to work
++		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
++		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++
++		// find a resource with ColorSpace entry
++		PdfObject* resources = canvas->GetResources();
++		for (PdfObject* par = canvasObject; par && !resources; par = par->GetIndirectKey("Parent"))
++		{
++			resources = par->GetIndirectKey("Resources");
++		}
++		colorSpaceRes = resources ? resources->GetIndirectKey("ColorSpace") : nullptr;
++		xObjects = resources ? resources->GetIndirectKey("XObject") : nullptr;
++		extGState = resources ? resources->GetIndirectKey("ExtGState") : nullptr;
++		fontRes = resources ? resources->GetIndirectKey("Font") : nullptr;
++
++		// getting the transparency group of this content stream (if available)
++		transGroup = canvasObject ? canvasObject->GetIndirectKey("Group") : nullptr;
++		if (transGroup)
++		{
++			PdfObject* subtype = transGroup->GetIndirectKey("S");
++			if (subtype && subtype->GetName() == "Transparency")
++			{
++				// having transparency group means there's transparency in the PDF
++				hasTransparency = true;
++
++				// reporting the color space used in transparency group (Section 7.5.5, PDF 1.6 Spec)
++				PdfObject* cs = transGroup->GetIndirectKey("CS");
++				if (cs)
++				{
++					PDFColorSpace retval = getCSType(cs);
++					if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++						usedColorSpaces.append(retval);
++				}
++			}
++		}
++	}
++	catch (PdfError & e)
++	{
++		qDebug() << "Error in analyzing stream's resources. File:" << m_filename;
++		e.PrintErrorMsg();
++		return false;
++	}
++
++	try
++	{
+ 		// start parsing the content stream
+ 		PdfContentsTokenizer tokenizer(canvas);
+ 		EPdfContentsType t;
+@@ -880,9 +932,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -949,9 +1001,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -1003,29 +1055,28 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedXObj.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && xObjectsDict)
++						if (args.size() == 1 && args[0].IsName() && xObjects)
+ 						{
+-							PdfObject* xObject = xObjectsDict->FindKey(args[0].GetName());
+-							PdfDictionary* xObjectDict = (xObject && xObject->IsDictionary()) ? &(xObject->GetDictionary()) : nullptr;
+-							PdfObject* subtypeObject = xObjectDict ? xObjectDict->FindKey("Subtype") : nullptr;
++							PdfObject* xObject = xObjects->GetIndirectKey(args[0].GetName());
++							PdfObject* subtypeObject = xObject ? xObject->GetIndirectKey("Subtype") : nullptr;
+ 							if (subtypeObject && subtypeObject->IsName())
+ 							{
+ 								if (subtypeObject->GetName() == "Image")
+ 								{
+-									PdfObject* imgColorSpace = xObjectDict->FindKey("ColorSpace");
++									PdfObject* imgColorSpace = xObject->GetIndirectKey("ColorSpace");
+ 									if (imgColorSpace)
+ 									{
+ 										PDFColorSpace retval = getCSType(imgColorSpace);
+ 										if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 											usedColorSpaces.append(retval);
+ 									}
+-									PdfObject* sMaskObj = xObjectDict->FindKey("SMask");
++									PdfObject* sMaskObj = xObject->GetIndirectKey("SMask");
+ 									if (sMaskObj)
+ 										hasTransparency = true;
+ 									PDFImage img;
+ 									img.imgName = args[0].GetName().GetEscapedName().c_str();
+-									double width = xObjectDict->FindKey("Width")->GetReal();
+-									double height = xObjectDict->FindKey("Height")->GetReal();
++									double width = xObject->GetIndirectKey("Width")->GetReal();
++									double height = xObject->GetIndirectKey("Height")->GetReal();
+ 									img.dpiX = qRound(width/(currGS.ctm.m11()/72));
+ 									img.dpiY = qRound(height/(currGS.ctm.m22()/72));
+ 									imgs.append(img);
+@@ -1074,9 +1125,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 									usedColorSpaces.append(CS_DeviceCMYK);
+ 								else if (!processedNamedCS.contains(csName))
+ 								{
+-									if (colorSpacesDict && colorSpacesDict->FindKey(csName))
++									if (colorSpaceRes && colorSpaceRes->GetIndirectKey(csName))
+ 									{
+-										PdfObject* csEntry = colorSpacesDict->FindKey(csName);
++										PdfObject* csEntry = colorSpaceRes->GetIndirectKey(csName);
+ 										if (csEntry)
+ 										{
+ 											PDFColorSpace retval = getCSType(csEntry);
+@@ -1116,9 +1167,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedGS.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && extGStatesDict)
++						if (args.size() == 1 && args[0].IsName() && extGState)
+ 						{
+-							PdfObject* extGStateObj = extGStatesDict->FindKey(args[0].GetName());
++							PdfObject* extGStateObj = extGState->GetIndirectKey(args[0].GetName());
+ 							if (extGStateObj)
+ 							{
+ 								inspectExtGStateObj(extGStateObj, usedColorSpaces, hasTransparency, usedFonts, currGS);
+@@ -1147,9 +1198,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					}
+ 					else
+ 					{
+-						if (args.size() == 2 && args[0].IsName() && fontsDict)
++						if (args.size() == 2 && args[0].IsName() && fontRes)
+ 						{
+-							PdfObject* fontObj = fontsDict->FindKey(args[0].GetName());
++							PdfObject* fontObj = fontRes->GetIndirectKey(args[0].GetName());
+ 							if (fontObj)
+ 							{
+ 								PDFFont retval = getFontInfo(fontObj);
+@@ -1179,7 +1230,6 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 				args.clear();
+ 			}
+ 		}
+-#endif
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -1188,10 +1238,12 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		return false;
+ 	}
+ 	return true;
++#endif
+ }
+ 
+ void PDFAnalyzer::inspectExtGStateObj(PdfObject* extGStateObj, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, PDFGraphicState & currGS)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	PdfDictionary* extGStateDict = extGStateObj->IsDictionary() ? &(extGStateObj->GetDictionary()) : nullptr;
+ 	PdfObject* bmObj = extGStateDict ? extGStateDict->FindKey("BM") : nullptr;
+ 	if (bmObj && bmObj->IsName())
+@@ -1245,7 +1297,6 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 				currGS.font.first = font;
+ 				currGS.font.second = arr[1].GetReal();
+ 			}
+-
+ 		}
+ 	}
+ 
+@@ -1276,9 +1327,96 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		PdfObject dObjB = dObj->GetArray()[1];
+ 		currGS.dashPattern.second = dObjB.GetNumber();
+ 	}
++#else
++	PdfObject* bmObj = extGStateObj->GetIndirectKey("BM");
++	if (bmObj && bmObj->IsName())
++	{
++		currGS.blendModes.clear();
++		currGS.blendModes.append(bmObj->GetName().GetEscapedName().c_str());
++		if (!(bmObj->GetName() == "Normal" || bmObj->GetName() == "Compatible"))
++			hasTransparency = true;
++	}
++	else if (bmObj && bmObj->IsArray())
++	{
++		PdfArray arr = bmObj->GetArray();
++		currGS.blendModes.clear();
++		for (uint i = 0; i < arr.GetSize(); ++i)
++			currGS.blendModes.append(arr[i].GetName().GetEscapedName().c_str());
++		if (arr[0].IsName() && !(arr[0].GetName() == "Normal" || arr[0].GetName() == "Compatible"))
++			hasTransparency = true;
++	}
++
++	PdfObject* caObj = extGStateObj->GetIndirectKey("ca");
++	if (caObj && (caObj->IsReal() || caObj->IsNumber()))
++	{
++		currGS.fillAlphaConstant = caObj->GetReal();
++		if (caObj->GetReal() < 1)
++			hasTransparency = true;
++	}
++
++	PdfObject* cAObj = extGStateObj->GetIndirectKey("CA");
++	if (cAObj && (cAObj->IsReal() || cAObj->IsNumber()))
++	{
++		if (cAObj->GetReal() < 1)
++			hasTransparency = true;
++	}
++
++	PdfObject* sMaskObj = extGStateObj->GetIndirectKey("SMask");
++	if (sMaskObj && !(sMaskObj->IsName() && sMaskObj->GetName() == "None"))
++		hasTransparency = true;
++
++	PdfObject* fontObj = extGStateObj->GetIndirectKey("Font");
++	if (fontObj && fontObj->IsArray())
++	{
++		PdfArray arr = fontObj->GetArray();
++		if (arr[0].IsReference())
++		{
++			PdfReference ref = arr[0].GetReference();
++			PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
++			if (fontObject)
++			{
++				PDFFont font = getFontInfo(fontObject);
++				usedFonts.append(font);
++				currGS.font.first = font;
++				currGS.font.second = arr[1].GetReal();
++			}
++
++		}
++	}
++
++	PdfObject* lwObj = extGStateObj->GetIndirectKey("LW");
++	if (lwObj)
++		currGS.lineWidth = lwObj->GetReal();
++
++	PdfObject* lcObj = extGStateObj->GetIndirectKey("LC");
++	if (lcObj)
++		currGS.lineCap = lcObj->GetNumber();
++
++	PdfObject* ljObj = extGStateObj->GetIndirectKey("LJ");
++	if (ljObj)
++		currGS.lineJoin = ljObj->GetNumber();
++
++	PdfObject* mlObj = extGStateObj->GetIndirectKey("ML");
++	if (mlObj)
++		currGS.miterLimit = mlObj->GetReal();
++
++	PdfObject* dObj = extGStateObj->GetIndirectKey("D");
++	if (dObj)
++	{
++		PdfObject dObjA = dObj->GetArray()[0];
++		PdfArray dashArr = dObjA.GetArray();
++		currGS.dashPattern.first.clear();
++		for (uint i = 0; i < dashArr.GetSize(); ++i)
++			currGS.dashPattern.first.append(dashArr[i].GetNumber());
++		PdfObject dObjB = dObj->GetArray()[1];
++		currGS.dashPattern.second = dObjB.GetNumber();
++	}
++#endif
+ }
++
+ PDFFont PDFAnalyzer::getFontInfo(PdfObject* fontObj)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	PDFFont currFont;
+ 	const PdfDictionary* fontDict = fontObj->IsDictionary() ? &(fontObj->GetDictionary()) : nullptr;
+ 	if (!fontDict)
+@@ -1307,11 +1445,7 @@ PDFFont PDFAnalyzer::getFontInfo(PdfObje
+ 		if (descendantFonts && descendantFonts->IsArray())
+ 		{
+ 			const PdfReference& refDescFont = descendantFonts->GetArray()[0].GetReference();
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 			PdfObject* descendantFont = descendantFonts->GetDocument()->GetObjects().GetObject(refDescFont);
+-#else
+-			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
+-#endif
+ 			PdfDictionary* descendantFontDict = (descendantFont && descendantFont->IsDictionary()) ? &(descendantFont->GetDictionary()) : nullptr;
+ 			const PdfObject* subtypeDescFont = descendantFontDict->FindKey("Subtype");
+ 			fontDesc = &(descendantFontDict->MustGetKey("FontDescriptor"));
+@@ -1345,6 +1479,62 @@ PDFFont PDFAnalyzer::getFontInfo(PdfObje
+ 		}
+ 	}
+ 	return currFont;
++#else
++	PDFFont currFont;
++	PdfObject* subtype = fontObj->GetIndirectKey("Subtype");
++	if (!subtype || !subtype->IsName())
++		return currFont;
++
++	PdfObject* fontDesc = fontObj->GetIndirectKey("FontDescriptor");
++	if (subtype->GetName() == "Type1")
++		currFont.fontType = F_Type1;
++	else if (subtype->GetName() == "MMType1")
++		currFont.fontType = F_MMType1;
++	else if (subtype->GetName() == "TrueType")
++		currFont.fontType = F_TrueType;
++	else if (subtype->GetName() == "Type3")
++	{
++		currFont.fontType = F_Type3;
++		currFont.isEmbedded = true;
++		fontDesc = nullptr;
++	}
++	else if (subtype->GetName() == "Type0")
++	{
++		PdfObject* descendantFonts = fontObj->GetIndirectKey("DescendantFonts");
++		if (descendantFonts && descendantFonts->IsArray())
++		{
++			PdfReference refDescFont = descendantFonts->GetArray()[0].GetReference();
++			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
++			PdfObject* subtypeDescFont = descendantFont->GetIndirectKey("Subtype");
++			fontDesc = descendantFont->MustGetIndirectKey("FontDescriptor");
++			if (subtypeDescFont && subtypeDescFont->IsName())
++			{
++				if (subtypeDescFont->GetName() == "CIDFontType0")
++					currFont.fontType = F_CIDFontType0;
++				else if (subtypeDescFont->GetName() == "CIDFontType2")
++					currFont.fontType = F_CIDFontType2;
++			}
++		}
++	}
++	if (fontDesc)
++	{
++		PdfObject* fontFile = fontDesc->GetIndirectKey("FontFile");
++		PdfObject* fontFile2 = fontDesc->GetIndirectKey("FontFile2");
++		PdfObject* fontFile3 = fontDesc->GetIndirectKey("FontFile3");
++		if (fontFile && fontFile->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile2 && fontFile2->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile3 && fontFile3->HasStream())
++		{
++			currFont.isEmbedded = true;
++			PdfObject* ff3Subtype = fontFile3->GetIndirectKey("Subtype");
++			if (ff3Subtype && ff3Subtype->IsName() && ff3Subtype->GetName() == "OpenType")
++				currFont.isOpenType = true;
++		}
++	}
++	return currFont;
++#endif
+ }
+ #else
+ PDFAnalyzer::PDFAnalyzer(QString & filename) : QObject()
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9826,7 +9826,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page.GetRotationRaw();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9845,11 +9845,11 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx()) + " "
++								 + Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+ 			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
+@@ -9947,7 +9947,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page.GetRotationRaw();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9966,11 +9966,11 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx()) + " "
++								 + Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+ 			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
+@@ -10072,20 +10072,16 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ #else
+ 	try
+ 	{
+-		PoDoFo::PdfPage* page = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
+-		PoDoFo::PdfObject* pageObj = page ? page->GetObject() : nullptr;
+-		PoDoFo::PdfObject* contents = page ? page->GetContents() : nullptr;
++		PoDoFo::PdfPage*   page      = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
++		PoDoFo::PdfObject* pageObj   = page ? page->GetObject() : nullptr;
++		PoDoFo::PdfObject* contents  = page ? page->GetContents() : nullptr;
+ 		PoDoFo::PdfObject* resources = page ? page->GetResources() : nullptr;
+-		PoDoFo::PdfDictionary* pageObjDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+-		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
++		for (PoDoFo::PdfObject* par = pageObj; par && !resources; par = par->GetIndirectKey("Parent"))
+ 		{
+-			resources = par->FindKey("Resources");
+-			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
+-			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
++			resources = par->GetIndirectKey("Resources");
+ 		}
+-		if (contents && contents->GetDataType() == PoDoFo::ePdfDataType_Dictionary)
++		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Dictionary)
+ 		{
+-			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
+ 			PoDoFo::PdfStream* stream = contents->GetStream();
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+@@ -10098,7 +10094,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -10117,22 +10113,21 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx())  + " "
++								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+-			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			nextObj = page->GetObject()->GetIndirectKey("Group");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+ 			/*
+-			PoDoFo::PdfObject parents = pageDict->FindKey("StructParents");
++			PoDoFo::PdfObject parents = page->GetObject()->GetIndirectKey("StructParents");
+ 			if (parents)
+ 			{
+ 				xParents = writer.newObject();
+@@ -10151,13 +10146,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			if (mbuffer[mlen - 1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+-			nextObj = contentsDict.FindKey("Filter");
++			nextObj = contents->GetIndirectKey("Filter");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Filter ");
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+-			nextObj = contentsDict.FindKey("DecodeParms");
++			nextObj = contents->GetIndirectKey("DecodeParms");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/DecodeParms ");
+@@ -10168,7 +10163,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 				EncodeArrayToStream(buffer, xObj);
+ 			}  // disconnect QByteArray from raw data
+-			free(mbuffer);
++			free (mbuffer);
+ 			PutDoc("\nendstream");
+ 			writer.endObj(xObj);
+ 			// write resources
+@@ -10223,7 +10218,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -10242,15 +10237,14 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx())  + " "
++								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+-			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			nextObj = page->GetObject()->GetIndirectKey("Group");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+@@ -10326,7 +10320,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			imgInfo.ResNum = ResCount;
+ 			ResCount++;
+ 			// Avoid a divide-by-zero if width/height are less than 1 point:
+-			imgInfo.Width = qMax(1, (int) imgWidth);
++			imgInfo.Width  = qMax(1, (int) imgWidth);
+ 			imgInfo.Height = qMax(1, (int) imgHeight);
+ 			imgInfo.xa = sx * imgWidth / imgInfo.Width;
+ 			imgInfo.ya = sy * imgHeight / imgInfo.Height;
+--- a/scribus/plugins/import/ai/importai.cpp
++++ b/scribus/plugins/import/ai/importai.cpp
+@@ -579,87 +579,115 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		qDebug() << "Failed to open QFile outf in AIPlug::extractFromPDF";
+ 		return false;
+ 	}
++
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	try
+ 	{
+-#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+-		PoDoFo::PdfError::EnableDebug( false );
+-		PoDoFo::PdfError::EnableLogging( false );
+-#endif
+ 		PoDoFo::PdfMemDocument doc;
+ 		doc.Load(infile.toLocal8Bit().data());
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+-		PoDoFo::PdfPage* curPage = &(doc.GetPages().GetPageAt(0));
++
++		PoDoFo::PdfPage& curPage = doc.GetPages().GetPageAt(0);
++		PoDoFo::PdfObject& pageObj = curPage.GetObject();
++		PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++		PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
++		if (piece != nullptr)
++		{
++			PoDoFo::PdfDictionary* pieceDict = piece->IsDictionary() ? &(piece->GetDictionary()) : nullptr;
++			PoDoFo::PdfObject *illy = pieceDict ? pieceDict->FindKey("Illustrator") : nullptr;
++			if (illy != nullptr)
++			{
++				PoDoFo::PdfDictionary* illyDict = illy->IsDictionary() ? &(illy->GetDictionary()) : nullptr;
++				PoDoFo::PdfObject *priv = illyDict ? illyDict->FindKey("Private") : nullptr;
++				if (priv == nullptr)
++					priv = illy;
++				int num = 0;
++				PoDoFo::PdfDictionary* privDict = priv->IsDictionary() ? &(priv->GetDictionary()) : nullptr;
++				PoDoFo::PdfObject *numBl = privDict ? privDict->FindKey("NumBlock") : nullptr;
++				if (numBl != nullptr)
++					num = numBl->GetNumber() + 1;
++				if (num == 0)
++					num = 99999;
++				QString name = "AIPrivateData%1";
++				QString Key = name.arg(1);
++				PoDoFo::PdfObject *data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++				if (data == nullptr)
++				{
++					name = "AIPDFPrivateData%1";
++					Key = name.arg(1);
++					data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++				}
++				if (data != nullptr)
++				{
++					if (num == 2)
++					{
++						Key = name.arg(1);
++						data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++						PoDoFo::PdfObjectStream const* stream = data->GetStream();
++						PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++						qint64 bLen = strBuffer.size();
++						const char* Buffer = strBuffer.c_str();
++						outf.write(Buffer, bLen);
++					}
++					else
++					{
++						for (int a = 2; a < num; a++)
++						{
++							Key = name.arg(a);
++							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							if (data == nullptr)
++								break;
++							PoDoFo::PdfObjectStream const* stream = data->GetStream();
++							PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++							qint64 bLen = strBuffer.size();
++							const char* Buffer = strBuffer.c_str();
++							outf.write(Buffer, bLen);
++						}
++					}
++				}
++				ret = true;
++			}
++		}
++		outf.close();
++	}
+ #else
++	try
++	{
++		PoDoFo::PdfError::EnableDebug( false );
++		PoDoFo::PdfError::EnableLogging( false );
++		PoDoFo::PdfMemDocument doc( infile.toLocal8Bit().data() );
+ 		PoDoFo::PdfPage *curPage = doc.GetPage(0);
+-#endif
+ 		if (curPage != nullptr)
+ 		{
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+-			PoDoFo::PdfObject* pageObj = &(curPage->GetObject());
+-#else
+-			PoDoFo::PdfObject* pageObj = curPage->GetObject();
+-#endif
+-			PoDoFo::PdfDictionary* pageDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+-			PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
++			PoDoFo::PdfObject *piece = curPage->GetObject()->GetIndirectKey("PieceInfo");
+ 			if (piece != nullptr)
+ 			{
+-				PoDoFo::PdfDictionary* pieceDict = piece->IsDictionary() ? &(piece->GetDictionary()) : nullptr;
+-				PoDoFo::PdfObject *illy = pieceDict ? pieceDict->FindKey("Illustrator") : nullptr;
++				PoDoFo::PdfObject *illy = piece->GetIndirectKey("Illustrator");
+ 				if (illy != nullptr)
+ 				{
+-					PoDoFo::PdfDictionary* illyDict = illy->IsDictionary() ? &(illy->GetDictionary()) : nullptr;
+-					PoDoFo::PdfObject *priv = illyDict ? illyDict->FindKey("Private") : nullptr;
++					PoDoFo::PdfObject *priv = illy->GetIndirectKey("Private");
+ 					if (priv == nullptr)
+ 						priv = illy;
+ 					int num = 0;
+-					PoDoFo::PdfDictionary* privDict = priv->IsDictionary() ? &(priv->GetDictionary()) : nullptr;
+-					PoDoFo::PdfObject *numBl = privDict ? privDict->FindKey("NumBlock") : nullptr;
++					PoDoFo::PdfObject *numBl = priv->GetIndirectKey("NumBlock");
+ 					if (numBl != nullptr)
+ 						num = numBl->GetNumber() + 1;
+ 					if (num == 0)
+ 						num = 99999;
+ 					QString name = "AIPrivateData%1";
+ 					QString Key = name.arg(1);
+-					PoDoFo::PdfObject *data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++					PoDoFo::PdfObject *data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 					if (data == nullptr)
+ 					{
+ 						name = "AIPDFPrivateData%1";
+ 						Key = name.arg(1);
+-						data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++						data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 					}
+ 					if (data != nullptr)
+ 					{
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 						if (num == 2)
+ 						{
+ 							Key = name.arg(1);
+-							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+-							PoDoFo::PdfObjectStream const* stream = data->GetStream();
+-							PoDoFo::charbuff strBuffer = stream->GetCopy(false);
+-							qint64 bLen = strBuffer.size();
+-							const char* Buffer = strBuffer.c_str();
+-							outf.write(Buffer, bLen);
+-						}
+-						else
+-						{
+-							for (int a = 2; a < num; a++)
+-							{
+-								Key = name.arg(a);
+-								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+-								if (data == nullptr)
+-									break;
+-								PoDoFo::PdfObjectStream const* stream = data->GetStream();
+-								PoDoFo::charbuff strBuffer = stream->GetCopy(false);
+-								qint64 bLen = strBuffer.size();
+-								const char* Buffer = strBuffer.c_str();
+-								outf.write(Buffer, bLen);
+-							}
+-						}
+-#else
+-						if (num == 2)
+-						{
+-							Key = name.arg(1);
+-							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 							PoDoFo::PdfStream const *stream = data->GetStream();
+ 							PoDoFo::PdfMemoryOutputStream oStream(1);
+ 							stream->GetFilteredCopy(&oStream);
+@@ -674,7 +702,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 							for (int a = 2; a < num; a++)
+ 							{
+ 								Key = name.arg(a);
+-								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++								data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 								if (data == nullptr)
+ 									break;
+ 								PoDoFo::PdfStream const *stream = data->GetStream();
+@@ -687,7 +715,6 @@ bool AIPlug::extractFromPDF(const QStrin
+ 								free( Buffer );
+ 							}
+ 						}
+-#endif
+ 					}
+ 					ret = true;
+ 				}
+@@ -695,6 +722,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		}
+ 		outf.close();
+ 	}
++#endif // (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	catch (PoDoFo::PdfError& e)
+ 	{
+ 		outf.close();
+@@ -704,7 +732,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		QFile::remove(outfile);
+ 		return false;
+ 	}
+-#endif
++#endif // HAVE_PODOFO
+ 	return ret;
+ }
+ 
diff --git a/srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch b/srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch
new file mode 100644
index 0000000000000..c01558c04f98d
--- /dev/null
+++ b/srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch
@@ -0,0 +1,22 @@
+From 148fc05557975267b05ebe670822793999ea3e0a Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 5 Jun 2023 21:15:35 +0000
+Subject: [PATCH 11/13] Fix typo
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25504 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit bd2ba29c16218bc715cde93109e6c0b9be48e4be)
+---
+ CMakeLists_Dependencies.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/CMakeLists_Dependencies.cmake
++++ b/CMakeLists_Dependencies.cmake
+@@ -8,7 +8,7 @@ if (WITH_PODOFO)
+ 	if (LIBPODOFO_FOUND)
+ 		message("PoDoFo found OK")
+ 		set(HAVE_PODOFO ON)
+-		if(LIBPODOFO_VERSION VERSION_GREATER "0.10.0")
++		if(LIBPODOFO_VERSION VERSION_GREATER_EQUAL "0.10.0")
+ 			message(STATUS "PoDoFo Version:" ${LIBPODOFO_VERSION})
+ 			if (CMAKE_CXX_STANDARD LESS 17)
+ 				message(STATUS "C++17 is the minimum C++ standard since podofo 0.10.0")
diff --git a/srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch b/srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch
new file mode 100644
index 0000000000000..2d51a8ef9b793
--- /dev/null
+++ b/srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch
@@ -0,0 +1,107 @@
+From 6ae729e1b45f92428168475c316f3b45a8e99d74 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 4 Sep 2023 21:58:38 +0000
+Subject: [PATCH 12/13] Adapt CMake FindLIBPODOFO.cmake to use pkgconfig, and
+ allow custom find path. Still testing.
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25625 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 628a630d7c45d942605ac227c530f9c889395832)
+---
+ cmake/modules/FindLIBPODOFO.cmake        | 48 +++++++++++++++++-------
+ scribus/plugins/import/ai/CMakeLists.txt | 13 +++----
+ 2 files changed, 41 insertions(+), 20 deletions(-)
+
+--- a/cmake/modules/FindLIBPODOFO.cmake
++++ b/cmake/modules/FindLIBPODOFO.cmake
+@@ -12,23 +12,45 @@ if(WIN32)
+ 	endif(NOT DEFINED LIBPODOFO_SHARED)
+ endif(WIN32)
+ 
+-find_path(LIBPODOFO_INCLUDE_DIR
+-	NAMES podofo/podofo.h
+-	PATHS
+-	"${LIBPODOFO_DIR}/include"
+-	"${LIBPODOFO_DIR}/src"
+-	"${LIBPODOFO_DIR}"
++set(LIBPODOFO_FIND_QUIETLY OFF)
++
++find_package(PkgConfig QUIET)
++if(DEFINED LIBPODOFO_DIR_CUSTOM)
++	set(ENV{PKG_CONFIG_PATH} "${LIBPODOFO_DIR_CUSTOM}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
++endif()
++pkg_search_module(libpodofo REQUIRED libpodofo podofo)
++
++if (DEFINED LIBPODOFO_DIR_CUSTOM)
++	find_path(LIBPODOFO_INCLUDE_DIR
++		NAMES podofo/podofo.h
++		PATHS
++		"${LIBPODOFO_DIR_CUSTOM}/include"
++		"${LIBPODOFO_DIR_CUSTOM}"
++		PATH_SUFFIXES podofo
++		NO_DEFAULT_PATH
+ 	)
+ 
+-set(LIBPODOFO_FIND_QUIETLY ON)
++	find_library(LIBPODOFO_LIBRARY
++		NAMES libpodofo podofo
++		PATHS
++		"${LIBPODOFO_DIR_CUSTOM}/lib"
++		"${LIBPODOFO_DIR_CUSTOM}"
++		NO_DEFAULT_PATH
++	)
++else()
++	find_path(LIBPODOFO_INCLUDE_DIR
++		NAMES podofo/podofo.h
++		PATHS
++		${libpodofo_INCLUDE_DIRS}
++	)
+ 
+-find_library(LIBPODOFO_LIBRARY
+-	NAMES libpodofo podofo
+-	PATHS
+-	"${LIBPODOFO_DIR}/lib"
+-	"${LIBPODOFO_DIR}/src"
+-	"${LIBPODOFO_DIR}"
++	find_library(LIBPODOFO_LIBRARY
++		NAMES libpodofo podofo
++		PATHS
++		${libpodofo_LIBRARY_DIRS}
+ 	)
++endif()
++
+ 
+ if(LIBPODOFO_INCLUDE_DIR AND LIBPODOFO_LIBRARY)
+ 	if(NOT LIBPODOFO_CONFIG_H)
+--- a/scribus/plugins/import/ai/CMakeLists.txt
++++ b/scribus/plugins/import/ai/CMakeLists.txt
+@@ -1,14 +1,15 @@
+ include_directories(
+ 	${CMAKE_SOURCE_DIR}
+ 	${CMAKE_SOURCE_DIR}/scribus
+-	${PODOFO_INCLUDES}
++	${LIBPODOFO_INCLUDE_DIR}
+ 	${SCRIBUS_AUTOGEN_INCLUDE_PATH}
+ )
+ 
+ if(HAVE_PODOFO)
+-	include_directories(
+-		${LIBPODOFO_INCLUDE_DIR}
+-	)
++	if(OPENSSL_FOUND)
++		include_directories(${OPENSSL_INCLUDE_DIR})
++	endif()
++	include_directories(BEFORE ${LIBPODOFO_INCLUDE_DIR})
+ endif()
+ 
+ set(IMPORTAI_PLUGIN_SOURCES
+@@ -32,9 +33,7 @@ else()
+ endif()
+ 
+ if(HAVE_PODOFO)
+-	target_link_libraries(${SCRIBUS_IMPORTAI_PLUGIN}
+-		${LIBPODOFO_LIBRARY}
+-	)
++	target_link_libraries(${SCRIBUS_IMPORTAI_PLUGIN} ${LIBPODOFO_LIBRARY})
+ endif()
+ 
+ if(WANT_PCH)
diff --git a/srcpkgs/scribus/patches/cmake-buildtype-none.patch b/srcpkgs/scribus/patches/cmake-buildtype-none.patch
index ea1df49410ed6..95a3da339b29b 100644
--- a/srcpkgs/scribus/patches/cmake-buildtype-none.patch
+++ b/srcpkgs/scribus/patches/cmake-buildtype-none.patch
@@ -1,5 +1,3 @@
-Index: CMakeLists.txt
-===================================================================
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -75,11 +75,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -14,7 +12,7 @@ Index: CMakeLists.txt
  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
  set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
  set(CMAKE_SKIP_BUILD_RPATH TRUE)
-@@ -330,15 +325,6 @@ include (CMakeLists_Directories.cmake)
+@@ -344,15 +339,6 @@ include (CMakeLists_Directories.cmake)
  
  #Convert our simpler command line option to the CMake style
  #None, Debug, Release, .. or custom ones
@@ -27,3 +25,6 @@ Index: CMakeLists.txt
 -if(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
 -	set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Set Release Build Type" FORCE)
 -endif()
+ 
+ set(CMAKE_ENABLE_EXPORTS ON)
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 3138a842546af..a43acf7ccd761 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,7 +1,7 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=12
+revision=13
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
  -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
@@ -9,7 +9,7 @@ hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel
  hunspell-devel poppler-cpp-devel python3-devel harfbuzz-devel
- libgraphicsmagick-devel libpodofo0.9.7-devel libpagemaker-devel libqxp-devel
+ libgraphicsmagick-devel libpodofo-devel libpagemaker-devel libqxp-devel
  libmspub-devel libcdr-devel libfreehand-devel libvisio-devel"
 depends="ghostscript"
 short_desc="Open Source DTP (Desktop Publishing) application"

From 7457d86a4dab098ad8de918cfd3c3f7a72f2e6ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 14 Dec 2023 19:33:30 +0700
Subject: [PATCH 8/8] libreoffice: update to 7.6.4.1.

---
 srcpkgs/libreoffice/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/libreoffice/template b/srcpkgs/libreoffice/template
index e4cc15b3b9919..5e82c7c9ae63b 100644
--- a/srcpkgs/libreoffice/template
+++ b/srcpkgs/libreoffice/template
@@ -1,11 +1,11 @@
 # Template file for 'libreoffice'
 pkgname=libreoffice
-version=7.6.0.3
-revision=3
+version=7.6.4.1
+revision=1
 build_style=meta
 make_build_target="build"
 hostmakedepends="automake flex gperf hyphen icu libtool openldap which gettext xz
- perl-Archive-Zip pkg-config qt5-qmake sane unzip zip python3-setuptools
+ tar perl-Archive-Zip pkg-config qt5-qmake sane unzip zip python3-setuptools
  fontforge python3-lxml qt6-base gtk4-devel gobject-introspection gnupg"
 makedepends="CoinMP-devel apr-devel avahi-libs-devel clucene-devel
  frameworkintegration-devel glyphy-devel gpgmepp-devel gst-plugins-base1-devel
@@ -72,7 +72,7 @@ distfiles="
  ${_addurl}/d8bd5eed178db6e2b18eeed243f85aa8-flute-1.1.6.zip
  ${_addurl}/ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip
  ${_addurl}/box2d-2.4.1.tar.gz
- ${_addurl}/libcmis-0.5.2.tar.xz
+ ${_addurl}/libcmis-0.6.1.tar.xz
  ${_addurl}/libstaroffice-0.0.7.tar.xz
  ${_addurl}/libzmf-0.0.2.tar.xz
  ${_addurl}/pdfium-5778.tar.bz2
@@ -94,10 +94,10 @@ distfiles="
  ${_addurl}/frozen-1.1.1.tar.gz
  ${_addurl}/dragonbox-1.1.3.tar.gz
 "
-checksum="07f33f11a75b72a3044749d4f2f7d02a0fd79eaed4fb73e618ec5fe3576d0c25
- b932cdd6bd2ee717f3a09766c88fe90100b0c2c0509313c3ee297f95c084ee2e
- 210f18ff60e93d366856d84e714d3fd6f184f399b5163afc92b7e11155cbe768
- 667e4ffeacc01bd0f830c2edcc56e2328f924eeac224639babeb3841a44ec5f4
+checksum="13fea7b8f24c776313b9e08628aa590390bea45064be73bc70ee7b1b70aa6a1e
+ 36c0526e4c12ab38dd1e1766cd878118dd5692578b80411b9b443e389e3712fa
+ ed784c014096e0e7ff86294eba624bd92ecbe5be881b01950eecd69aed7d8678
+ 3a5a0dbe40abdc55cdd9994895f6577d7e547d26a36b20641f32f3640a3b7679
  1fb458d6aab06932693cc8a9b6e4e70944ee1ff052fa63606e3131df34e21753
  75823776fb51a9c526af904f1503a7afaaab900fba83eda64f8a41073724c870
  7d2797fe9f79a77009721e3f14fa4a1dec17a6d706bdc93f85f1f01d124fab66
@@ -106,7 +106,7 @@ checksum="07f33f11a75b72a3044749d4f2f7d02a0fd79eaed4fb73e618ec5fe3576d0c25
  1b5b24f7bc543c0362b667692f78db8bab4ed6dafc6172f104d0bd3757d8a133
  233f66e8d25c5dd971716d4200203a612a407649686ef3b52075d04b4c9df0dd
  d6b4650ff897ee1ead27cf77a5933ea197cbeef6705638dd181adc2e816b23c2
- d7b18d9602190e10d437f8a964a32e983afd57e2db316a07d87477a79f5000a2
+ d54d19d86153dbc88e2d468f7136269a2cfe71b73227e12fded01d29ac268074
  f94fb0ad8216f97127bedef163a45886b43c62deac5e5b0f5e628e234220c8db
  27051a30cb057fdb5d5de65a1f165c7153dc76e27fe62251cbb86639eb2caf22
  b1052ff24e9ffb11af017c444bb0f6ad508d64c9a0fb88cacb0e8210245dde06
@@ -136,7 +136,7 @@ skip_extraction="
  d8bd5eed178db6e2b18eeed243f85aa8-flute-1.1.6.zip
  ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip
  box2d-2.4.1.tar.gz
- libcmis-0.5.2.tar.xz
+ libcmis-0.6.1.tar.xz
  libstaroffice-0.0.7.tar.xz
  libzmf-0.0.2.tar.xz
  pdfium-5778.tar.bz2

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] Poppler 23.12.0
  2023-09-17 21:02 [PR PATCH] Poppler 23.09.0 mhmdanas
                   ` (4 preceding siblings ...)
  2023-12-14 15:16 ` [PR PATCH] [Updated] Poppler 23.12.0 sgn
@ 2023-12-14 15:18 ` sgn
  2023-12-14 15:20 ` sgn
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: sgn @ 2023-12-14 15:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1276 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/mhmdanas/void-packages poppler-23.09.0
https://github.com/void-linux/void-packages/pull/46107

Poppler 23.12.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES** (and built all revdeps successfully)


<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/46107.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-23.09.0-46107.patch --]
[-- Type: text/x-diff, Size: 181743 bytes --]

From 8e0d2f95db873c4619f089900b41fd558c5c4c4b Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 1/7] poppler: update to 23.12.0.

---
 common/shlibs            |  2 +-
 srcpkgs/poppler/template | 13 ++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 66d0045a2898f..393b7436cefa2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -345,7 +345,7 @@ libMagickCore-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagickWand-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagick++-7.Q16HDRI.so.5 libmagick-7.0.11.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.130 libpoppler-23.08.0_1
+libpoppler.so.133 libpoppler-23.12.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 2be3e5ab35e47..456e5c2fecb22 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -1,18 +1,17 @@
 # Template file for 'poppler'
 #
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
-#
-# Revbump libreoffice on SO version bumps.
 pkgname=poppler
-version=23.08.0
+version=23.12.0
 revision=1
-_testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
+_testVersion=400f3ff05b2b1c0ae17797a0bd50e75e35c1f1b1
 create_wrksrc=yes
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DENABLE_QT5=OFF -DENABLE_QT6=OFF -DENABLE_UTILS=ON
+ -DENABLE_BOOST=$(vopt_if boost ON OFF)
  -DTESTDATADIR='${XBPS_BUILDDIR}/poppler-${version}/testdatadir'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
@@ -25,8 +24,8 @@ homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz
  https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
-checksum="4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
- ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
+checksum="beba398c9d37a9b6d02486496635e08f1df3d437cfe61dab2593f47c4d14cdbb
+ 0d850a1d06944671c991be6822b7146ade401b06aad560ff39b254a028074525"
 
 build_options="gir boost"
 build_options_default="gir boost"

From 7fde63053384f7c48fece7447f976d2597653984 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 2/7] poppler-qt5: update to 23.12.0.

---
 srcpkgs/poppler-qt5/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a48ed659920e..8dc1d149bf0c5 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,7 +4,7 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=23.08.0
+version=23.12.0
 revision=1
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
@@ -21,7 +21,7 @@ license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz"
-checksum=4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
+checksum=beba398c9d37a9b6d02486496635e08f1df3d437cfe61dab2593f47c4d14cdbb
 # fails to find a bunch of files
 make_check=no
 

From 60324c04159585411e3fd10f578b4f966d8e4e06 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 3/7] inkscape: revbump for poppler-23.12.0.

---
 srcpkgs/inkscape/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 916822078cd27..a23bf4e87e61c 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.3.2
-revision=1
+revision=2
 build_style=cmake
 make_check_target="check"
 hostmakedepends="automake gettext glib-devel intltool libgraphicsmagick-devel

From 9bf5d2641b2933c1409a721e910b41d0fb133475 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 4/7] ipe: revbump for poppler-23.12.0.

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index 65b92385af994..06347934d9897 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.26
-revision=10
+revision=11
 _tools_commit=v7.2.24.1
 create_wrksrc=yes
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"

From 991ecd0a466d6b94fede8b71402c6137df017cef Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 5/7] kitinerary: revbump for poppler-23.12.0.

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 31236a166ef2c..5575e4dfb57f5 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=23.08.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config
  qt5-host-tools qt5-qmake qt5-tools-devel"

From d0632ce4b2a7dd01c3b422581c45d217d311102c Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 6/7] pdf2djvu: revbump for poppler-23.12.0.

Close: #46107
---
 srcpkgs/pdf2djvu/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdf2djvu/template b/srcpkgs/pdf2djvu/template
index 5a6f3ddf4ed35..982ce2458751c 100644
--- a/srcpkgs/pdf2djvu/template
+++ b/srcpkgs/pdf2djvu/template
@@ -1,7 +1,7 @@
 # Template file for 'pdf2djvu'
 pkgname=pdf2djvu
 version=0.9.19
-revision=5
+revision=6
 build_style=gnu-configure
 hostmakedepends="pkg-config djvulibre gettext"
 makedepends="djvulibre-devel poppler-devel libgraphicsmagick-devel exiv2-devel libuuid-devel"

From b4d16c7eba506c6d09de9df5777caea6fe60acbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 14 Dec 2023 14:01:26 +0700
Subject: [PATCH 7/7] scribus: for poppler 23.12.0

---
 ...r-22.03.0-force-poppler-0.86-minimum.patch |  526 ++++++
 .../0002-poppler-22.03.0-memleak.patch        |   94 +
 .../0005-podofo-0.10-find-podofo.patch        |   37 +
 ...-swap-podofo-poppler-dep-check-order.patch |  109 ++
 .../0007-podofo-0.10-minimum-0.9.0.patch      |   22 +
 .../0008-podofo-0.10-drop-old-compat.patch    |   48 +
 ...dofo-0.10-avoid-confusion-with-m_doc.patch |   67 +
 .../0010-podofo-0.10-indentation-fix.patch    |   22 +
 .../patches/0011-podofo-0.10-code-style.patch |  141 ++
 .../0012-podofo-0.10-preparation.patch        |  514 ++++++
 ...013-podofo-0.10-compat-podofo-0.10.x.patch | 1602 +++++++++++++++++
 ...0014-podofo-0.10-compat-podofo-0.9.6.patch |  853 +++++++++
 .../patches/0015-podofo-0.10-cmake-fix.patch  |   22 +
 .../0016-podofo-0.10-use-pkgconfig.patch      |  107 ++
 .../patches/cmake-buildtype-none.patch        |    7 +-
 srcpkgs/scribus/template                      |    4 +-
 16 files changed, 4170 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch
 create mode 100644 srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch
 create mode 100644 srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch
 create mode 100644 srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch
 create mode 100644 srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch
 create mode 100644 srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch
 create mode 100644 srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch
 create mode 100644 srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch
 create mode 100644 srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch
 create mode 100644 srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch
 create mode 100644 srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch

diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch
new file mode 100644
index 0000000000000..f205f45dea3d5
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch
@@ -0,0 +1,526 @@
+From e013e8126d2100e8e56dea5b836ad43275429389 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:48:29 +0000
+Subject: [PATCH] Enforce poppler version >= 0.86.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24985 11d20701-8431-0410-a711-e3c959e3b870
+---
+ cmake/modules/Findpoppler.cmake          |   4 +-
+ scribus/plugins/import/pdf/importpdf.cpp |  65 ++-----------
+ scribus/plugins/import/pdf/slaoutput.cpp | 114 -----------------------
+ scribus/plugins/import/pdf/slaoutput.h   |   7 --
+ 4 files changed, 10 insertions(+), 180 deletions(-)
+
+--- a/cmake/modules/Findpoppler.cmake
++++ b/cmake/modules/Findpoppler.cmake
+@@ -1,8 +1,8 @@
+ #include(FindPkgConfig)
+ find_package(PkgConfig QUIET)
+-pkg_search_module(poppler libpoppler>=0.62.0 poppler>=0.62.0)
++pkg_search_module(poppler libpoppler>=0.86.0 poppler>=0.86.0)
+ if (poppler_FOUND)
+-	pkg_search_module(poppler_cpp REQUIRED libpoppler-cpp>=0.62.0 poppler-cpp>=0.62.0)
++	pkg_search_module(poppler_cpp REQUIRED libpoppler-cpp>=0.86.0 poppler-cpp>=0.86.0)
+ endif(poppler_FOUND)
+  
+ find_path(poppler_INCLUDE_DIR
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -75,20 +75,15 @@ PdfPlug::PdfPlug(ScribusDoc* doc, int fl
+ 
+ QImage PdfPlug::readThumbnail(const QString& fName)
+ {
+-	QString pdfFile = QDir::toNativeSeparators(fName);
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
+ 	globalParams.reset(new GlobalParams());
+-#else
+-	std::unique_ptr<GlobalParams> globalParamsPtr(new GlobalParams());
+-	globalParams = globalParamsPtr.get();
+-#endif
++	globalParams->setErrQuiet(gTrue);
+ 
+-#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
++	QString pdfFile = QDir::toNativeSeparators(fName);
++#if defined(Q_OS_WIN32)
+ 	auto fname = new GooString(pdfFile.toUtf8().data());
+ #else
+ 	auto fname = new GooString(QFile::encodeName(pdfFile).data());
+ #endif
+-	globalParams->setErrQuiet(gTrue);
+ 
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+ 	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
+@@ -333,19 +328,15 @@ bool PdfPlug::convert(const QString& fn)
+ 		qApp->processEvents();
+ 	}
+ 
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
+ 	globalParams.reset(new GlobalParams());
+-#else
+-	std::unique_ptr<GlobalParams> globalParamsPtr(new GlobalParams());
+-	globalParams = globalParamsPtr.get();
+-#endif
+-#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
++	globalParams->setErrQuiet(gTrue);
++
++#if defined(Q_OS_WIN32)
+ 	auto fname = new GooString(fn.toUtf8().data());
+ #else
+ 	auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
+-	globalParams->setErrQuiet(gTrue);
+-//	globalParams->setPrintCommands(gTrue);
++
+ 	QList<OptionalContentGroup*> ocgGroups;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+ 	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
+@@ -365,7 +356,7 @@ bool PdfPlug::convert(const QString& fn)
+ 			QString text = QInputDialog::getText(mw, tr("Open PDF-File"), tr("Password"), QLineEdit::Normal, "", &ok);
+ 			if (ok && !text.isEmpty())
+ 			{
+-#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
++#if defined(Q_OS_WIN32)
+ 				auto fname = new GooString(fn.toUtf8().data());
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+@@ -383,9 +374,6 @@ bool PdfPlug::convert(const QString& fn)
+ 			{
+ 				if (m_progressDialog)
+ 					m_progressDialog->close();
+-#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
+-				delete globalParams;
+-#endif
+ 				return false;
+ 			}
+ 			if (m_progressDialog)
+@@ -495,7 +483,6 @@ bool PdfPlug::convert(const QString& fn)
+ 							}
+ 							else
+ 							{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 69, 0)
+ 								const auto& ocgs = ocg->getOCGs ();
+ 								for (const auto& ocg : ocgs)
+ 								{
+@@ -507,25 +494,11 @@ bool PdfPlug::convert(const QString& fn)
+ 										ocgNames.append(ocgName);
+ 									}
+ 								}
+-#else
+-								GooList *ocgs = ocg->getOCGs ();
+-								for (int i = 0; i < ocgs->getLength (); ++i)
+-								{
+-									OptionalContentGroup *oc = (OptionalContentGroup *)ocgs->get(i);
+-									QString ocgName = UnicodeParsedString(oc->getName());
+-									if (!ocgNames.contains(ocgName))
+-									{
+-										ocgGroups.prepend(oc);
+-										ocgNames.append(ocgName);
+-									}
+-								}
+-#endif
+ 							}
+ 						}
+ 					}
+ 					else
+ 					{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 69, 0)
+ 						const auto& ocgs = ocg->getOCGs ();
+ 						for (const auto& ocg : ocgs)
+ 						{
+@@ -537,19 +510,6 @@ bool PdfPlug::convert(const QString& fn)
+ 								ocgNames.append(ocgName);
+ 							}
+ 						}
+-#else
+-						GooList *ocgs = ocg->getOCGs ();
+-						for (int i = 0; i < ocgs->getLength (); ++i)
+-						{
+-							OptionalContentGroup *oc = (OptionalContentGroup *)ocgs->get(i);
+-							QString ocgName = UnicodeParsedString(oc->getName());
+-							if (!ocgNames.contains(ocgName))
+-							{
+-								ocgGroups.prepend(oc);
+-								ocgNames.append(ocgName);
+-							}
+-						}
+-#endif
+ 					}
+ 				}
+ 
+@@ -788,13 +748,8 @@ bool PdfPlug::convert(const QString& fn)
+ 							names = catDict.dictLookup("OpenAction");
+ 							if (names.isDict())
+ 							{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 								std::unique_ptr<LinkAction> linkActionUPtr = LinkAction::parseAction(&names, pdfDoc->getCatalog()->getBaseURI());
+ 								LinkAction *linkAction = linkActionUPtr.get();
+-#else
+-								LinkAction *linkAction = nullptr;
+-								linkAction = LinkAction::parseAction(&names, pdfDoc->getCatalog()->getBaseURI());
+-#endif
+ 								if (linkAction && (linkAction->getKind() == actionJavaScript))
+ 								{
+ 									LinkJavaScript *jsa = (LinkJavaScript*) linkAction;
+@@ -862,11 +817,7 @@ bool PdfPlug::convert(const QString& fn)
+ 		}
+ 		pdfDoc.reset();
+ 	}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
+ 	globalParams.reset();
+-#else
+-	globalParams = nullptr;
+-#endif
+ 
+ //	qDebug() << "converting finished";
+ //	qDebug() << "Imported" << m_elements.count() << "Elements";
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -332,15 +332,9 @@ LinkAction* SlaOutputDev::SC_getAction(A
+ }
+ 
+ /* Replacement for the crippled Poppler function LinkAction* AnnotWidget::getAdditionalAction(AdditionalActionsType type) */
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *ano)
+ {
+ 	std::unique_ptr<LinkAction> linkAction;
+-#else
+-LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *ano)
+-{
+-	LinkAction *linkAction = nullptr;
+-#endif
+ 	Object obj;
+ 	Ref refa = ano->getRef();
+ 
+@@ -467,11 +461,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 				if (dst->isPageRef())
+ 				{
+ 					Ref dstr = dst->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 					pagNum = pdfDoc->findPage(dstr);
+-#else
+-					pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 				}
+ 				else
+ 					pagNum = dst->getPageNum();
+@@ -485,11 +475,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 			POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 			if (ndst)
+ 			{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 				std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-				LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 				if (dstn)
+ 				{
+ 					if (dstn->getKind() == destXYZ)
+@@ -497,11 +483,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 						if (dstn->isPageRef())
+ 						{
+ 							Ref dstr = dstn->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 							pagNum = pdfDoc->findPage(dstr);
+-#else
+-							pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 						}
+ 						else
+ 							pagNum = dstn->getPageNum();
+@@ -533,11 +515,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 			POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 			if (ndst)
+ 			{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 				std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-				LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 				if (dstn)
+ 				{
+ 					if (dstn->getKind() == destXYZ)
+@@ -985,11 +963,7 @@ void SlaOutputDev::handleActions(PageIte
+ 					if (dst->isPageRef())
+ 					{
+ 						Ref dstr = dst->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 						pagNum = pdfDoc->findPage(dstr);
+-#else
+-						pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 					}
+ 					else
+ 						pagNum = dst->getPageNum();
+@@ -1005,11 +979,7 @@ void SlaOutputDev::handleActions(PageIte
+ 				POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 				if (ndst)
+ 				{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 					std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-					LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 					if (dstn)
+ 					{
+ 						if (dstn->getKind() == destXYZ)
+@@ -1017,11 +987,7 @@ void SlaOutputDev::handleActions(PageIte
+ 							if (dstn->isPageRef())
+ 							{
+ 								Ref dstr = dstn->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 								pagNum = pdfDoc->findPage(dstr);
+-#else
+-								pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 							}
+ 							else
+ 								pagNum = dstn->getPageNum();
+@@ -1061,11 +1027,7 @@ void SlaOutputDev::handleActions(PageIte
+ 				POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 				if (ndst)
+ 				{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 					std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-					LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 					if (dstn)
+ 					{
+ 						if (dstn->getKind() == destXYZ)
+@@ -1139,143 +1101,91 @@ void SlaOutputDev::handleActions(PageIte
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setD_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("E", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setE_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("X", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setX_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("Fo", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setFo_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("Bl", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setBl_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("C", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setC_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("F", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setF_act(UnicodeParsedString(jsa->getScript()));
+@@ -1283,22 +1193,14 @@ void SlaOutputDev::handleActions(PageIte
+ 				ite->annotation().setFormat(5);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("K", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setK_act(UnicodeParsedString(jsa->getScript()));
+@@ -1306,33 +1208,21 @@ void SlaOutputDev::handleActions(PageIte
+ 				ite->annotation().setFormat(5);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("V", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setV_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ }
+ 
+@@ -1342,11 +1232,7 @@ void SlaOutputDev::startDoc(PDFDoc *doc,
+ 	catalog = catA;
+ 	pdfDoc = doc;
+ 	updateGUICounter = 0;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 84, 0)
+ 	m_fontEngine = new SplashFontEngine(true, false, false, true);
+-#else
+-	m_fontEngine = new SplashFontEngine(globalParams->getEnableFreeType(), false, false, true);
+-#endif
+ }
+ 
+ void SlaOutputDev::startPage(int pageNum, GfxState *, XRef *)
+--- a/scribus/plugins/import/pdf/slaoutput.h
++++ b/scribus/plugins/import/pdf/slaoutput.h
+@@ -30,9 +30,6 @@ for which a new license (GPL+exception)
+ #include "selection.h"
+ #include "vgradient.h"
+ 
+-#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 73, 0)
+-#include <poppler/goo/gtypes.h>
+-#endif
+ #include <poppler/Object.h>
+ #include <poppler/OutputDev.h>
+ #include <poppler/Gfx.h>
+@@ -163,11 +160,7 @@ public:
+ 	virtual ~SlaOutputDev();
+ 
+ 	LinkAction* SC_getAction(AnnotWidget *ano);
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 	std::unique_ptr<LinkAction> SC_getAdditionalAction(const char *key, AnnotWidget *ano);
+-#else
+-	LinkAction* SC_getAdditionalAction(const char *key, AnnotWidget *ano);
+-#endif
+ 	static GBool annotations_callback(Annot *annota, void *user_data);
+ 	bool handleTextAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
+ 	bool handleLinkAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch
new file mode 100644
index 0000000000000..d40f35ad966e9
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch
@@ -0,0 +1,94 @@
+From 48263954a7dee0be815b00f417ae365ab26cdd85 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Thu, 3 Mar 2022 00:18:06 +0000
+Subject: [PATCH] #16764: Better patch, avoid a memory leak
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24989 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 34 +++++++++---------------
+ scribus/util_os.cpp                      |  2 ++
+ 2 files changed, 15 insertions(+), 21 deletions(-)
+
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -58,6 +58,7 @@ for which a new license (GPL+exception)
+ #include "util.h"
+ #include "util_formats.h"
+ #include "util_math.h"
++#include "util_os.h"
+ 
+ #include "ui/customfdialog.h"
+ #include "ui/missing.h"
+@@ -79,15 +80,12 @@ QImage PdfPlug::readThumbnail(const QStr
+ 	globalParams->setErrQuiet(gTrue);
+ 
+ 	QString pdfFile = QDir::toNativeSeparators(fName);
+-#if defined(Q_OS_WIN32)
+-	auto fname = new GooString(pdfFile.toUtf8().data());
+-#else
+-	auto fname = new GooString(QFile::encodeName(pdfFile).data());
+-#endif
+-
++	QByteArray encodedFileName = os_is_win() ? pdfFile.toUtf8() : QFile::encodeName(pdfFile);
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+-	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++	auto fname = std::make_unique<GooString>(encodedFileName.data());
++	PDFDoc pdfDoc{ std::move(fname) };
+ #else
++	auto fname = new GooString(encodedFileName.data());
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
+ #endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+@@ -331,17 +329,14 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams.reset(new GlobalParams());
+ 	globalParams->setErrQuiet(gTrue);
+ 
+-#if defined(Q_OS_WIN32)
+-	auto fname = new GooString(fn.toUtf8().data());
+-#else
+-	auto fname = new GooString(QFile::encodeName(fn).data());
+-#endif
+-
+ 	QList<OptionalContentGroup*> ocgGroups;
++	QByteArray encodedFileName = os_is_win() ? fn.toUtf8() : QFile::encodeName(fn);
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+-	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++	auto fname = std::make_unique<GooString>(encodedFileName.data());
++	auto pdfDoc = std::make_unique<PDFDoc>(std::move(fname));
+ #else
+-	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++	auto fname = new GooString(encodedFileName.data());
++	auto pdfDoc = std::make_unique<PDFDoc>(fname, nullptr, nullptr, nullptr);
+ #endif
+ 	if (pdfDoc)
+ 	{
+@@ -356,15 +351,12 @@ bool PdfPlug::convert(const QString& fn)
+ 			QString text = QInputDialog::getText(mw, tr("Open PDF-File"), tr("Password"), QLineEdit::Normal, "", &ok);
+ 			if (ok && !text.isEmpty())
+ 			{
+-#if defined(Q_OS_WIN32)
+-				auto fname = new GooString(fn.toUtf8().data());
+-#else
+-				auto fname = new GooString(QFile::encodeName(fn).data());
+-#endif
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				auto fname = std::make_unique<GooString>(encodedFileName.data());
+ 				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
+-				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++				pdfDoc.reset(new PDFDoc(std::move(fname), userPW, userPW, nullptr));
+ #else
++				auto fname = new GooString(encodedFileName.data());
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
+ #endif
+--- a/scribus/util_os.cpp
++++ b/scribus/util_os.cpp
+@@ -22,6 +22,8 @@ for which a new license (GPL+exception)
+ 
+ #include <QtGlobal>
+ 
++#include "util_os.h"
++
+ bool os_is_osx()
+ {
+ #ifdef Q_OS_MACOS
diff --git a/srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch b/srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch
new file mode 100644
index 0000000000000..261428153a96f
--- /dev/null
+++ b/srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch
@@ -0,0 +1,37 @@
+From 3d02faaa2e17eef67826abd52d56b4a9b2b9c1ba Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Sun, 4 Jun 2023 17:00:34 +0000
+Subject: [PATCH 01/13] Update CMake PoDoFo finder to allow for PoDoFo 0.10.0
+ podofo-config.h location
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25493 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit bd70705c05bd383d1a9b3ab12224988ff8475722)
+---
+ cmake/modules/FindLIBPODOFO.cmake | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+--- a/cmake/modules/FindLIBPODOFO.cmake
++++ b/cmake/modules/FindLIBPODOFO.cmake
+@@ -32,7 +32,14 @@ find_library(LIBPODOFO_LIBRARY
+ 
+ if(LIBPODOFO_INCLUDE_DIR AND LIBPODOFO_LIBRARY)
+ 	if(NOT LIBPODOFO_CONFIG_H)
+-		set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h")
++		#PoDoFo before 0.10.0
++		if (EXISTS "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h")
++			set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h. PoDoFo <=0.10.0")
++		endif()
++		#PoDoFo 0.10.0 or higher
++		if (EXISTS "${LIBPODOFO_INCLUDE_DIR}/podofo/auxiliary/podofo_config.h")
++			set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/auxiliary/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h. PoDoFo >=0.10.0")
++		endif()
+ 	endif()
+ 
+ 	file(STRINGS "${LIBPODOFO_CONFIG_H}" PODOFO_MAJOR_VER_LINE REGEX "^#define[ \t]+PODOFO_VERSION_MAJOR[ \t]+[0-9]+$")
+@@ -79,4 +86,6 @@ if(NOT LIBPODOFO_FIND_QUIETLY)
+ 		message("podofo lib: not found")
+ 	endif(LIBPODOFO_LIBRARY)
+ 	message("PoDoFo cflags: ${useshared}")
++	message("PoDoFo config file ${LIBPODOFO_CONFIG_H}")
++	message("PoDoFo version ${LIBPODOFO_VERSION}")
+ endif(NOT LIBPODOFO_FIND_QUIETLY)
diff --git a/srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch b/srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch
new file mode 100644
index 0000000000000..47c644f418b22
--- /dev/null
+++ b/srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch
@@ -0,0 +1,109 @@
+From 45ed6b8664675d78de1b3dbde2c9684111805811 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 5 Jun 2023 20:57:47 +0000
+Subject: [PATCH 02/13] Swap dependency checking for podofo and poppler to the
+ beginning to force C++17 when their versions require it
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25500 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 81b3cf609ff01400f6f804c98ee58febc4494908)
+---
+ CMakeLists_Dependencies.cmake | 74 +++++++++++++++++++++--------------
+ 1 file changed, 44 insertions(+), 30 deletions(-)
+
+--- a/CMakeLists_Dependencies.cmake
++++ b/CMakeLists_Dependencies.cmake
+@@ -1,6 +1,48 @@
+ ##############################################################################################################
+ ########## Find Dependencies                                                                        ##########
+ 
++#<<PoDoFo for AI PDF import
++option(WITH_PODOFO "Enable support for PDF embedded in AI" ON)
++if (WITH_PODOFO)
++	find_package(LIBPODOFO)
++	if (LIBPODOFO_FOUND)
++		message("PoDoFo found OK")
++		set(HAVE_PODOFO ON)
++		if(LIBPODOFO_VERSION VERSION_GREATER "0.10.0")
++			message(STATUS "PoDoFo Version:" ${LIBPODOFO_VERSION})
++			if (CMAKE_CXX_STANDARD LESS 17)
++				message(STATUS "C++17 is the minimum C++ standard since podofo 0.10.0")
++				message(STATUS "Enabling C++17 compiler features")
++				set(CMAKE_CXX_STANDARD 17)
++			endif()
++		endif()
++	else()
++		message("PoDoFo NOT found - Disabling support for PDF embedded in AI")
++	endif()
++endif()
++#>>PoDoFo for AI PDF import
++
++#<<Poppler for PDF import
++find_package(poppler REQUIRED)
++if (poppler_FOUND)
++	set(HAVE_POPPLER ON)
++	message(STATUS "Found poppler")
++	message(STATUS "Found poppler libs: ${poppler_LIBRARY}")
++	message(STATUS "Found poppler includes: ${poppler_INCLUDE_DIR}")
++	if (poppler_VERSION VERSION_GREATER_EQUAL 22.01.0)
++		message(STATUS "Poppler Version:" ${poppler_VERSION})
++		if (CMAKE_CXX_STANDARD LESS 17)
++			message(STATUS "C++17 is the minimum C++ standard since poppler 22.01.0")
++			message(STATUS "Enabling C++17 compiler features")
++			set(CMAKE_CXX_STANDARD 17)
++		endif()
++	endif()
++else()
++	message(FATAL_ERROR "Could not find poppler library")
++endif()
++#>>Poppler for PDF import
++
++
+ #<< Qt
+ #Qt less than 6
+ set(CMAKE_PREFIX_PATH "${QT_PREFIX}/lib/cmake")
+@@ -257,18 +299,7 @@ if (WANT_HUNSPELL)
+ endif()
+ #>>HUNSPELL for Spelling support
+ 
+-#<<PoDoFo for AI PDF import
+-option(WITH_PODOFO "Enable support for PDF embedded in AI" ON)
+-if (WITH_PODOFO)
+-	find_package(LIBPODOFO)
+-	if (LIBPODOFO_FOUND)
+-		message("PoDoFo found OK")
+-		set(HAVE_PODOFO ON)
+-	else()
+-		message("PoDoFo NOT found - Disabling support for PDF embedded in AI")
+-	endif()
+-endif()
+-#>>PoDoFo for AI PDF import
++
+ 
+ #<<Boost for 2Geom Tools
+ option(WITH_BOOST "Enable support for Boost based enhancements" ON)
+@@ -298,24 +329,7 @@ else()
+ endif()
+ #>> GraphicsMagick for image import
+ 
+-#<<Poppler for PDF import
+-find_package(poppler REQUIRED)
+-if (poppler_FOUND)
+-	set(HAVE_POPPLER ON)
+-	message(STATUS "Found poppler")
+-	message(STATUS "Found poppler libs: ${poppler_LIBRARY}")
+-	message(STATUS "Found poppler includes: ${poppler_INCLUDE_DIR}")
+-	if (poppler_VERSION VERSION_GREATER_EQUAL 22.01.0)
+-		message(STATUS "Poppler Version:" ${poppler_VERSION})
+-		message(STATUS "C++17 is the minimum C++ standard since poppler 22.01.0")
+-		if (CMAKE_CXX_STANDARD LESS 17)
+-			message(FATAL_ERROR "Please set -DWANT_CPP17=ON on your CMake command line")
+-		endif()
+-	endif()
+-else()
+-	message(FATAL_ERROR "Could not find poppler library")
+-endif()
+-#>>Poppler for PDF import
++
+ 
+ # librevenge for MsPub import
+ pkg_check_modules(LIBREVENGE librevenge-0.0)
diff --git a/srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch b/srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch
new file mode 100644
index 0000000000000..d5503bf50d7e6
--- /dev/null
+++ b/srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch
@@ -0,0 +1,22 @@
+From 2a2c95fda05bbb089c12807261b7a9339635b488 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 5 Jun 2023 21:32:27 +0000
+Subject: [PATCH 03/13] Bump minimum podofo version to 0.9.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25506 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 9233e1e20a006155e90e2893cb2a133949ec7a68)
+---
+ CMakeLists_Dependencies.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/CMakeLists_Dependencies.cmake
++++ b/CMakeLists_Dependencies.cmake
+@@ -4,7 +4,7 @@
+ #<<PoDoFo for AI PDF import
+ option(WITH_PODOFO "Enable support for PDF embedded in AI" ON)
+ if (WITH_PODOFO)
+-	find_package(LIBPODOFO)
++	find_package(LIBPODOFO 0.9.0)
+ 	if (LIBPODOFO_FOUND)
+ 		message("PoDoFo found OK")
+ 		set(HAVE_PODOFO ON)
diff --git a/srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch b/srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch
new file mode 100644
index 0000000000000..9cbfd8e3b9abf
--- /dev/null
+++ b/srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch
@@ -0,0 +1,48 @@
+From 60007314a17cfd9ef4d81689868ca1b4e91d5c89 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Mon, 5 Jun 2023 21:37:40 +0000
+Subject: [PATCH 04/13] Code cleanup now possible thanks to podofo >= 0.9.0
+ requirement
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25509 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit a43ad2030f6a6a7ccc1d7fc6cdcd7a652e1263c3)
+---
+ scribus/pdflib_core.cpp | 8 --------
+ 1 file changed, 8 deletions(-)
+
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9861,16 +9861,12 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			char * mbuffer = nullptr;
+ 			long mlen = 0;
+ 
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 7, 99))
+ 			// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
+ 			PoDoFo::PdfMemoryOutputStream oStream(1);
+ 			stream->GetCopy(&oStream);
+ 			oStream.Close();
+ 			mlen = oStream.GetLength();
+ 			mbuffer = oStream.TakeBuffer();
+-#else
+-			stream->GetCopy(&mbuffer, &mlen);
+-#endif
+ 			if (mbuffer[mlen-1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+@@ -10158,16 +10154,12 @@ void PDFLibCore::copyPoDoFoObject(const
+ 		char * mbuffer = nullptr;
+ 		long mlen = 0;
+ 
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 7, 99))
+ 		// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
+ 		PoDoFo::PdfMemoryOutputStream oStream(1);
+ 		stream->GetCopy(&oStream);
+ 		oStream.Close();
+ 		mlen = oStream.GetLength();
+ 		mbuffer = oStream.TakeBuffer();
+-#else
+-		stream->GetCopy(&mbuffer, &mlen);
+-#endif
+ 		if (mbuffer[mlen-1] == '\n')
+ 			--mlen;
+ 		PutDoc("\nstream\n");
diff --git a/srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch b/srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch
new file mode 100644
index 0000000000000..d545d347e28e1
--- /dev/null
+++ b/srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch
@@ -0,0 +1,67 @@
+From 99e2d400ad6ad7fbf4e2ad1a4277521eaad46d28 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Sun, 4 Jun 2023 21:31:53 +0000
+Subject: [PATCH 05/13] Rename m_doc in pdf_analyser to avoid confusion with
+ m_doc in other code
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25495 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit b5aeed8093e06cf3df456f5ad26f76f6ca442bff)
+---
+ scribus/pdf_analyzer.cpp | 12 ++++++------
+ scribus/pdf_analyzer.h   |  2 +-
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -75,11 +75,11 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 		nameMapInited = true;
+ 	}
+ 
+-	m_doc = nullptr;
++	m_pdfdoc = nullptr;
+ 
+ 	PdfError::EnableDebug( false );
+ 	try {
+-		m_doc = new PdfMemDocument(filename.toLocal8Bit().data());
++		m_pdfdoc = new PdfMemDocument(filename.toLocal8Bit().data());
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -91,14 +91,14 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 
+ PDFAnalyzer::~PDFAnalyzer()
+ {
+-	delete m_doc;
++	delete m_pdfdoc;
+ }
+ 
+ bool PDFAnalyzer::inspectPDF(int pageNum, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
+-	if (!m_doc)
++	if (!m_pdfdoc)
+ 		return false;
+-	PdfPage* page = m_doc->GetPage(pageNum);
++	PdfPage* page = m_pdfdoc->GetPage(pageNum);
+ 	return page?inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs):false;
+ }
+ 
+@@ -725,7 +725,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		if (arr[0].IsReference())
+ 		{
+ 			PdfReference ref = arr[0].GetReference();
+-			PdfObject* fontObject = m_doc->GetObjects().GetObject(ref);
++		PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
+ 			if (fontObject)
+ 			{
+ 				PDFFont font = getFontInfo(fontObject);
+--- a/scribus/pdf_analyzer.h
++++ b/scribus/pdf_analyzer.h
+@@ -162,7 +162,7 @@ public:
+ #ifdef HAVE_PODOFO
+ private:
+ 	// pointer to the PoDoFo Pdf's object
+-	PoDoFo::PdfMemDocument* m_doc;
++	PoDoFo::PdfMemDocument* m_pdfdoc;
+ 
+ 	// Path to the analyzed file
+ 	QString m_filename;
diff --git a/srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch b/srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch
new file mode 100644
index 0000000000000..f6c890ebf60d9
--- /dev/null
+++ b/srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch
@@ -0,0 +1,22 @@
+From ed854091944c93a74cdb3a4dbd6ed14e95ab6a9c Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Mon, 5 Jun 2023 21:03:08 +0000
+Subject: [PATCH 06/13] Small indentation fix
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25503 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit fd576ca6d40856ca3cfb32482b24fa15783665d5)
+---
+ scribus/pdf_analyzer.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -725,7 +725,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		if (arr[0].IsReference())
+ 		{
+ 			PdfReference ref = arr[0].GetReference();
+-		PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
++			PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
+ 			if (fontObject)
+ 			{
+ 				PDFFont font = getFontInfo(fontObject);
diff --git a/srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch b/srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch
new file mode 100644
index 0000000000000..973eb17f714b5
--- /dev/null
+++ b/srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch
@@ -0,0 +1,141 @@
+From 9cd60ef7831fff69f2dacc2bf216c3537b2cd6e9 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Sat, 12 Aug 2023 21:12:49 +0000
+Subject: [PATCH 07/13] PDFAnalyzer: code style fixes and cleanups
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25573 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 9be7a29f08a00bb3c10024cd9a31a82742d42e22)
+---
+ scribus/pdf_analyzer.cpp | 56 +++++++++++++++++++++-------------------
+ 1 file changed, 30 insertions(+), 26 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -78,7 +78,8 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 	m_pdfdoc = nullptr;
+ 
+ 	PdfError::EnableDebug( false );
+-	try {
++	try
++	{
+ 		m_pdfdoc = new PdfMemDocument(filename.toLocal8Bit().data());
+ 	}
+ 	catch (PdfError & e)
+@@ -99,12 +100,13 @@ bool PDFAnalyzer::inspectPDF(int pageNum
+ 	if (!m_pdfdoc)
+ 		return false;
+ 	PdfPage* page = m_pdfdoc->GetPage(pageNum);
+-	return page?inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs):false;
++	return page ? inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs) : false;
+ }
+ 
+ PDFColorSpace PDFAnalyzer::getCSType(PdfObject* cs)
+ {
+-	try {
++	try
++	{
+ 		// colorspace is either a name or an array
+ 		if (cs && cs->IsName())
+ 		{
+@@ -165,20 +167,21 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ bool PDFAnalyzer::inspectCanvas(PdfCanvas* canvas, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
+ 	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
+-	PdfObject* colorSpaceRes;
+-	PdfObject* xObjects;
+-	PdfObject* transGroup;
+-	PdfObject* extGState;
+-	PdfObject* fontRes;
++	PdfObject* colorSpaceRes { nullptr };
++	PdfObject* xObjects { nullptr };
++	PdfObject* transGroup { nullptr };
++	PdfObject* extGState { nullptr };
++	PdfObject* fontRes { nullptr };
+ 	QMap<PdfName, PDFColorSpace> processedNamedCS;
+ 	QMap<PdfName, PDFFont> processedNamedFont;
+ 	QList<PdfName> processedNamedXObj;
+ 	QList<PdfName> processedNamedGS;
+-	try {
++	try
++	{
+ 		// get hold of a PdfObject pointer of this canvas
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
+-		PdfObject* canvasObject = page?(page->GetObject()):((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
+ 
+ 		// find a resource with ColorSpace entry
+ 		PdfObject* resources = canvas->GetResources();
+@@ -186,13 +189,13 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		{
+ 			resources = par->GetIndirectKey("Resources");
+ 		}
+-		colorSpaceRes = resources?resources->GetIndirectKey("ColorSpace"):nullptr;
+-		xObjects = resources?resources->GetIndirectKey("XObject"):nullptr;
+-		extGState = resources?resources->GetIndirectKey("ExtGState"):nullptr;
+-		fontRes = resources?resources->GetIndirectKey("Font"):nullptr;
++		colorSpaceRes = resources ? resources->GetIndirectKey("ColorSpace") : nullptr;
++		xObjects = resources ? resources->GetIndirectKey("XObject") : nullptr;
++		extGState = resources ? resources->GetIndirectKey("ExtGState") : nullptr;
++		fontRes = resources ? resources->GetIndirectKey("Font") : nullptr;
+ 
+ 		// getting the transparency group of this content stream (if available)
+-		transGroup = canvasObject?canvasObject->GetIndirectKey("Group"):nullptr;
++		transGroup = canvasObject ? canvasObject->GetIndirectKey("Group") : nullptr;
+ 		if (transGroup)
+ 		{
+ 			PdfObject* subtype = transGroup->GetIndirectKey("S");
+@@ -219,7 +222,8 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		return false;
+ 	}
+ 
+-	try {
++	try
++	{
+ 		// start parsing the content stream
+ 		PdfContentsTokenizer tokenizer(canvas);
+ 		EPdfContentsType t;
+@@ -502,7 +506,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						if (args.size() == 1 && args[0].IsName() && xObjects)
+ 						{
+ 							PdfObject* xObject = xObjects->GetIndirectKey(args[0].GetName());
+-							PdfObject* subtypeObject = xObject?xObject->GetIndirectKey("Subtype"):nullptr;
++							PdfObject* subtypeObject = xObject ? xObject->GetIndirectKey("Subtype") : nullptr;
+ 							if (subtypeObject && subtypeObject->IsName())
+ 							{
+ 								if (subtypeObject->GetName() == "Image")
+@@ -557,10 +561,10 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						PdfName cs("CS");
+ 						if (args.contains(colorspace) || args.contains(cs))
+ 						{
+-							int csIdx = args.contains(colorspace)?args.indexOf(colorspace):args.indexOf(cs);
+-							if (args[csIdx+1].IsName())
++							int csIdx = args.contains(colorspace) ? args.indexOf(colorspace) : args.indexOf(cs);
++							if (args[csIdx + 1].IsName())
+ 							{
+-								PdfName csName = args[csIdx+1].GetName();
++								PdfName csName = args[csIdx + 1].GetName();
+ 								if ((csName == "G" || csName == "DeviceGray") && !usedColorSpaces.contains(CS_DeviceGray))
+ 									usedColorSpaces.append(CS_DeviceGray);
+ 								else if ((csName == "RGB" || csName == "DeviceRGB") && !usedColorSpaces.contains(CS_DeviceRGB))
+@@ -594,14 +598,14 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						PdfName w("W");
+ 						if ((args.contains(height) || args.contains(h)) && (args.contains(width) || args.contains(w)))
+ 						{
+-							int heightIdx = args.contains(height)?args.indexOf(height):args.indexOf(h);
+-							int widthIdx = args.contains(width)?args.indexOf(width):args.indexOf(w);
+-							double height = args[heightIdx+1].GetReal();
+-							double width = args[widthIdx+1].GetReal();
++							int heightIdx = args.contains(height) ? args.indexOf(height) : args.indexOf(h);
++							int widthIdx = args.contains(width) ? args.indexOf(width) : args.indexOf(w);
++							double height = args[heightIdx + 1].GetReal();
++							double width = args[widthIdx + 1].GetReal();
+ 							PDFImage img;
+ 							img.imgName = "Inline Image";
+-							img.dpiX = qRound(width/(currGS.ctm.m11()/72));
+-							img.dpiY = qRound(height/(currGS.ctm.m22()/72));
++							img.dpiX = qRound(width / (currGS.ctm.m11() / 72));
++							img.dpiY = qRound(height / (currGS.ctm.m22() / 72));
+ 							imgs.append(img);
+ 						}
+ 						inlineImgDict = false;
diff --git a/srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch b/srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch
new file mode 100644
index 0000000000000..654d870140683
--- /dev/null
+++ b/srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch
@@ -0,0 +1,514 @@
+From bb6c0716035bcdc9fd4bd536d1ed6f01a1c6e9fa Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Sat, 12 Aug 2023 23:28:11 +0000
+Subject: [PATCH 08/13] Preparation work for PoDoFo 0.10.0x support: get rid of
+ GetIndirectKey() calls
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25579 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit fbd5eb474e0e6f522c6089756424592ecf0dc0a4)
+---
+ scribus/pdf_analyzer.cpp               | 204 ++++++++++++++-----------
+ scribus/pdflib_core.cpp                |  28 ++--
+ scribus/plugins/import/ai/importai.cpp |  21 ++-
+ 3 files changed, 148 insertions(+), 105 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -167,11 +167,10 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ bool PDFAnalyzer::inspectCanvas(PdfCanvas* canvas, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
+ 	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
+-	PdfObject* colorSpaceRes { nullptr };
+-	PdfObject* xObjects { nullptr };
+-	PdfObject* transGroup { nullptr };
+-	PdfObject* extGState { nullptr };
+-	PdfObject* fontRes { nullptr };
++	PdfDictionary* colorSpacesDict { nullptr };
++	PdfDictionary* xObjectsDict { nullptr };
++	PdfDictionary* extGStatesDict { nullptr };
++	PdfDictionary* fontsDict { nullptr };
+ 	QMap<PdfName, PDFColorSpace> processedNamedCS;
+ 	QMap<PdfName, PDFFont> processedNamedFont;
+ 	QList<PdfName> processedNamedXObj;
+@@ -182,30 +181,41 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
+ 		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++		PdfDictionary* canvasDict = (canvasObject && canvasObject->IsDictionary()) ? &(canvasObject->GetDictionary()) : nullptr;
+ 
+ 		// find a resource with ColorSpace entry
+ 		PdfObject* resources = canvas->GetResources();
+-		for (PdfObject* par = canvasObject; par && !resources; par = par->GetIndirectKey("Parent"))
++		for (PdfDictionary* par = canvasDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+-			resources = par->GetIndirectKey("Resources");
++			resources = par->FindKey("Resources");
++			PdfObject* parentObj = par->FindKey("Parent");
++			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
+ 		}
+-		colorSpaceRes = resources ? resources->GetIndirectKey("ColorSpace") : nullptr;
+-		xObjects = resources ? resources->GetIndirectKey("XObject") : nullptr;
+-		extGState = resources ? resources->GetIndirectKey("ExtGState") : nullptr;
+-		fontRes = resources ? resources->GetIndirectKey("Font") : nullptr;
++
++		PdfDictionary* resourcesDict = (resources && resources->IsDictionary()) ? &(resources->GetDictionary()) : nullptr;
++		PdfObject* colorSpaceRes = resourcesDict ? resourcesDict->FindKey("ColorSpace") : nullptr;
++		PdfObject* xObjects = resourcesDict ? resourcesDict->FindKey("XObject") : nullptr;
++		PdfObject* extGState = resourcesDict ? resourcesDict->FindKey("ExtGState") : nullptr;
++		PdfObject* fontRes = resourcesDict ? resourcesDict->FindKey("Font") : nullptr;
++
++		colorSpacesDict = (colorSpaceRes && colorSpaceRes->IsDictionary()) ? &(colorSpaceRes->GetDictionary()) : nullptr;
++		xObjectsDict = (xObjects && xObjects->IsDictionary()) ? &(xObjects->GetDictionary()) : nullptr;
++		extGStatesDict = (extGState && extGState->IsDictionary()) ? &(extGState->GetDictionary()) : nullptr;
++		fontsDict = (fontRes && fontRes->IsDictionary()) ? &(fontRes->GetDictionary()) : nullptr;
+ 
+ 		// getting the transparency group of this content stream (if available)
+-		transGroup = canvasObject ? canvasObject->GetIndirectKey("Group") : nullptr;
+-		if (transGroup)
++		PdfObject* transGroup = canvasDict ? canvasDict->FindKey("Group") : nullptr;
++		PdfDictionary* transGroupDict = (transGroup && transGroup->IsDictionary()) ? &(transGroup->GetDictionary()) : nullptr;
++		if (transGroupDict)
+ 		{
+-			PdfObject* subtype = transGroup->GetIndirectKey("S");
++			const PdfObject* subtype = transGroupDict->FindKey("S");
+ 			if (subtype && subtype->GetName() == "Transparency")
+ 			{
+ 				// having transparency group means there's transparency in the PDF
+ 				hasTransparency = true;
+ 
+ 				// reporting the color space used in transparency group (Section 7.5.5, PDF 1.6 Spec)
+-				PdfObject* cs = transGroup->GetIndirectKey("CS");
++				PdfObject* cs = transGroupDict->FindKey("CS");
+ 				if (cs)
+ 				{
+ 					PDFColorSpace retval = getCSType(cs);
+@@ -380,9 +390,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -449,9 +459,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -503,28 +513,29 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedXObj.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && xObjects)
++						if (args.size() == 1 && args[0].IsName() && xObjectsDict)
+ 						{
+-							PdfObject* xObject = xObjects->GetIndirectKey(args[0].GetName());
+-							PdfObject* subtypeObject = xObject ? xObject->GetIndirectKey("Subtype") : nullptr;
++							PdfObject* xObject = xObjectsDict->FindKey(args[0].GetName());
++							PdfDictionary* xObjectDict = (xObject && xObject->IsDictionary()) ? &(xObject->GetDictionary()) : nullptr;
++							PdfObject* subtypeObject = xObjectDict ? xObjectDict->FindKey("Subtype") : nullptr;
+ 							if (subtypeObject && subtypeObject->IsName())
+ 							{
+ 								if (subtypeObject->GetName() == "Image")
+ 								{
+-									PdfObject* imgColorSpace = xObject->GetIndirectKey("ColorSpace");
++									PdfObject* imgColorSpace = xObjectDict->FindKey("ColorSpace");
+ 									if (imgColorSpace)
+ 									{
+ 										PDFColorSpace retval = getCSType(imgColorSpace);
+ 										if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 											usedColorSpaces.append(retval);
+ 									}
+-									PdfObject* sMaskObj = xObject->GetIndirectKey("SMask");
++									PdfObject* sMaskObj = xObjectDict->FindKey("SMask");
+ 									if (sMaskObj)
+ 										hasTransparency = true;
+ 									PDFImage img;
+ 									img.imgName = args[0].GetName().GetEscapedName().c_str();
+-									double width = xObject->GetIndirectKey("Width")->GetReal();
+-									double height = xObject->GetIndirectKey("Height")->GetReal();
++									double width = xObjectDict->FindKey("Width")->GetReal();
++									double height = xObjectDict->FindKey("Height")->GetReal();
+ 									img.dpiX = qRound(width/(currGS.ctm.m11()/72));
+ 									img.dpiY = qRound(height/(currGS.ctm.m22()/72));
+ 									imgs.append(img);
+@@ -573,9 +584,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 									usedColorSpaces.append(CS_DeviceCMYK);
+ 								else if (!processedNamedCS.contains(csName))
+ 								{
+-									if (colorSpaceRes && colorSpaceRes->GetIndirectKey(csName))
++									if (colorSpacesDict && colorSpacesDict->FindKey(csName))
+ 									{
+-										PdfObject* csEntry = colorSpaceRes->GetIndirectKey(csName);
++										PdfObject* csEntry = colorSpacesDict->FindKey(csName);
+ 										if (csEntry)
+ 										{
+ 											PDFColorSpace retval = getCSType(csEntry);
+@@ -615,9 +626,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedGS.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && extGState)
++						if (args.size() == 1 && args[0].IsName() && extGStatesDict)
+ 						{
+-							PdfObject* extGStateObj = extGState->GetIndirectKey(args[0].GetName());
++							PdfObject* extGStateObj = extGStatesDict->FindKey(args[0].GetName());
+ 							if (extGStateObj)
+ 							{
+ 								inspectExtGStateObj(extGStateObj, usedColorSpaces, hasTransparency, usedFonts, currGS);
+@@ -646,9 +657,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					}
+ 					else
+ 					{
+-						if (args.size() == 2 && args[0].IsName() && fontRes)
++						if (args.size() == 2 && args[0].IsName() && fontsDict)
+ 						{
+-							PdfObject* fontObj = fontRes->GetIndirectKey(args[0].GetName());
++							PdfObject* fontObj = fontsDict->FindKey(args[0].GetName());
+ 							if (fontObj)
+ 							{
+ 								PDFFont retval = getFontInfo(fontObj);
+@@ -687,9 +698,11 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 	}
+ 	return true;
+ }
++
+ void PDFAnalyzer::inspectExtGStateObj(PdfObject* extGStateObj, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, PDFGraphicState & currGS)
+ {
+-	PdfObject* bmObj = extGStateObj->GetIndirectKey("BM");
++	PdfDictionary* extGStateDict = extGStateObj->IsDictionary() ? &(extGStateObj->GetDictionary()) : nullptr;
++	PdfObject* bmObj = extGStateDict ? extGStateDict->FindKey("BM") : nullptr;
+ 	if (bmObj && bmObj->IsName())
+ 	{
+ 		currGS.blendModes.clear();
+@@ -706,23 +719,27 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		if (arr[0].IsName() && !(arr[0].GetName() == "Normal" || arr[0].GetName() == "Compatible"))
+ 			hasTransparency = true;
+ 	}
+-	PdfObject* caObj = extGStateObj->GetIndirectKey("ca");
++
++	PdfObject* caObj = extGStateDict ? extGStateDict->FindKey("ca") : nullptr;
+ 	if (caObj && (caObj->IsReal() || caObj->IsNumber()))
+ 	{
+ 		currGS.fillAlphaConstant = caObj->GetReal();
+ 		if (caObj->GetReal() < 1)
+ 			hasTransparency = true;
+ 	}
+-	PdfObject* cAObj = extGStateObj->GetIndirectKey("CA");
++
++	PdfObject* cAObj = extGStateDict ? extGStateDict->FindKey("CA") : nullptr;
+ 	if (cAObj && (cAObj->IsReal() || cAObj->IsNumber()))
+ 	{
+ 		if (cAObj->GetReal() < 1)
+-		hasTransparency = true;
++			hasTransparency = true;
+ 	}
+-	PdfObject* sMaskObj = extGStateObj->GetIndirectKey("SMask");
++
++	PdfObject* sMaskObj = extGStateDict ? extGStateDict->FindKey("SMask") : nullptr;
+ 	if (sMaskObj && !(sMaskObj->IsName() && sMaskObj->GetName() == "None"))
+ 		hasTransparency = true;
+-	PdfObject* fontObj = extGStateObj->GetIndirectKey("Font");
++
++	PdfObject* fontObj = extGStateDict ? extGStateDict->FindKey("Font") : nullptr;
+ 	if (fontObj && fontObj->IsArray())
+ 	{
+ 		PdfArray arr = fontObj->GetArray();
+@@ -740,19 +757,24 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 
+ 		}
+ 	}
+-	PdfObject* lwObj = extGStateObj->GetIndirectKey("LW");
++
++	PdfObject* lwObj = extGStateDict ? extGStateDict->FindKey("LW") : nullptr;
+ 	if (lwObj)
+ 		currGS.lineWidth = lwObj->GetReal();
+-	PdfObject* lcObj = extGStateObj->GetIndirectKey("LC");
++
++	PdfObject* lcObj = extGStateDict ? extGStateDict->FindKey("LC") : nullptr;
+ 	if (lcObj)
+ 		currGS.lineCap = lcObj->GetNumber();
+-	PdfObject* ljObj = extGStateObj->GetIndirectKey("LJ");
++
++	PdfObject* ljObj = extGStateDict ? extGStateDict->FindKey("LJ") : nullptr;
+ 	if (ljObj)
+ 		currGS.lineJoin = ljObj->GetNumber();
+-	PdfObject* mlObj = extGStateObj->GetIndirectKey("ML");
++
++	PdfObject* mlObj = extGStateDict ? extGStateDict->FindKey("ML") : nullptr;
+ 	if (mlObj)
+ 		currGS.miterLimit = mlObj->GetReal();
+-	PdfObject* dObj = extGStateObj->GetIndirectKey("D");
++
++	PdfObject* dObj = extGStateDict ? extGStateDict->FindKey("D") : nullptr;
+ 	if (dObj)
+ 	{
+ 		PdfObject dObjA = dObj->GetArray()[0];
+@@ -767,56 +789,64 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ PDFFont PDFAnalyzer::getFontInfo(PdfObject* fontObj)
+ {
+ 	PDFFont currFont;
+-	PdfObject* subtype = fontObj->GetIndirectKey("Subtype");
+-	if (subtype && subtype->IsName())
++	const PdfDictionary* fontDict = fontObj->IsDictionary() ? &(fontObj->GetDictionary()) : nullptr;
++	if (!fontDict)
++		return currFont;
++
++	const PdfObject* subtype = fontDict->FindKey("Subtype");
++	if (!subtype || !subtype->IsName())
++		return currFont;
++
++	const PdfObject* fontDesc = fontDict->FindKey("FontDescriptor");
++	if (subtype->GetName() == "Type1")
++		currFont.fontType = F_Type1;
++	else if (subtype->GetName() == "MMType1")
++		currFont.fontType = F_MMType1;
++	else if (subtype->GetName() == "TrueType")
++		currFont.fontType = F_TrueType;
++	else if (subtype->GetName() == "Type3")
++	{
++		currFont.fontType = F_Type3;
++		currFont.isEmbedded = true;
++		fontDesc = nullptr;
++	}
++	else if (subtype->GetName() == "Type0")
+ 	{
+-		PdfObject* fontDesc = fontObj->GetIndirectKey("FontDescriptor");
+-		if (subtype->GetName() == "Type1")
+-			currFont.fontType = F_Type1;
+-		else if (subtype->GetName() == "MMType1")
+-			currFont.fontType = F_MMType1;
+-		else if (subtype->GetName() == "TrueType")
+-			currFont.fontType = F_TrueType;
+-		else if (subtype->GetName() == "Type3")
+-		{
+-			currFont.fontType = F_Type3;
+-			currFont.isEmbedded = true;
+-			fontDesc = nullptr;
+-		}
+-		else if (subtype->GetName() == "Type0")
++		const PdfObject* descendantFonts = fontDict->FindKey("DescendantFonts");
++		if (descendantFonts && descendantFonts->IsArray())
+ 		{
+-			PdfObject* descendantFonts = fontObj->GetIndirectKey("DescendantFonts");
+-			if (descendantFonts && descendantFonts->IsArray())
++			const PdfReference& refDescFont = descendantFonts->GetArray()[0].GetReference();
++			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
++			PdfDictionary* descendantFontDict = (descendantFont && descendantFont->IsDictionary()) ? &(descendantFont->GetDictionary()) : nullptr;
++			const PdfObject* subtypeDescFont = descendantFontDict->FindKey("Subtype");
++			fontDesc = &(descendantFontDict->MustGetKey("FontDescriptor"));
++			if (subtypeDescFont && subtypeDescFont->IsName())
+ 			{
+-				PdfReference refDescFont = descendantFonts->GetArray()[0].GetReference();
+-				PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
+-				PdfObject* subtypeDescFont = descendantFont->GetIndirectKey("Subtype");
+-				fontDesc = descendantFont->MustGetIndirectKey("FontDescriptor");
+-				if (subtypeDescFont && subtypeDescFont->IsName())
+-				{
+-					if (subtypeDescFont->GetName() == "CIDFontType0")
+-						currFont.fontType = F_CIDFontType0;
+-					else if (subtypeDescFont->GetName() == "CIDFontType2")
+-						currFont.fontType = F_CIDFontType2;
+-				}
++				if (subtypeDescFont->GetName() == "CIDFontType0")
++					currFont.fontType = F_CIDFontType0;
++				else if (subtypeDescFont->GetName() == "CIDFontType2")
++					currFont.fontType = F_CIDFontType2;
+ 			}
+ 		}
+-		if (fontDesc)
++	}
++
++	const PdfDictionary* fontDescDict = (fontDesc && fontDesc->IsDictionary()) ? &(fontDesc->GetDictionary()) : nullptr;
++	if (fontDescDict)
++	{
++		const PdfObject* fontFile = fontDescDict->FindKey("FontFile");
++		const PdfObject* fontFile2 = fontDescDict->FindKey("FontFile2");
++		const PdfObject* fontFile3 = fontDescDict->FindKey("FontFile3");
++		if (fontFile && fontFile->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile2 && fontFile2->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile3 && fontFile3->HasStream())
+ 		{
+-			PdfObject* fontFile = fontDesc->GetIndirectKey("FontFile");
+-			PdfObject* fontFile2 = fontDesc->GetIndirectKey("FontFile2");
+-			PdfObject* fontFile3 = fontDesc->GetIndirectKey("FontFile3");
+-			if (fontFile && fontFile->HasStream())
+-				currFont.isEmbedded = true;
+-			if (fontFile2 && fontFile2->HasStream())
+-				currFont.isEmbedded = true;
+-			if (fontFile3 && fontFile3->HasStream())
+-			{
+-				currFont.isEmbedded = true;
+-				PdfObject* ff3Subtype = fontFile3->GetIndirectKey("Subtype");
+-				if (ff3Subtype && ff3Subtype->IsName() && ff3Subtype->GetName() == "OpenType")
+-					currFont.isOpenType = true;
+-			}
++			currFont.isEmbedded = true;
++			const PdfDictionary* fontFile3Dict = fontFile3->IsDictionary() ? &(fontFile3->GetDictionary()) : nullptr;
++			const PdfObject* ff3Subtype = fontFile3Dict ? fontFile3Dict->FindKey("Subtype") : nullptr;
++			if (ff3Subtype && ff3Subtype->IsName() && ff3Subtype->GetName() == "OpenType")
++				currFont.isOpenType = true;
+ 		}
+ 	}
+ 	return currFont;
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9800,16 +9800,20 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 		PoDoFo::PdfObject* pageObj   = page ? page->GetObject() : nullptr;
+ 		PoDoFo::PdfObject* contents  = page ? page->GetContents() : nullptr;
+ 		PoDoFo::PdfObject* resources = page ? page->GetResources() : nullptr;
+-		for (PoDoFo::PdfObject* par = pageObj; par && !resources; par = par->GetIndirectKey("Parent"))
++		PoDoFo::PdfDictionary* pageObjDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
++		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+-			resources = par->GetIndirectKey("Resources");
++			resources = par->FindKey("Resources");
++			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
++			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
+ 		}
+ 		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Dictionary)
+ 		{
++			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
+ 			PoDoFo::PdfStream* stream = contents->GetStream();
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+-			PoDoFo::PdfObject* nextObj;
++			PoDoFo::PdfObject* nextObj { nullptr };
+ 			PdfId xObj = writer.newObject();
+ 			PdfId xResources = writer.newObject();
+ 			PdfId xParents = 0;
+@@ -9844,14 +9848,16 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			nextObj = page->GetObject()->GetIndirectKey("Group");
++			PoDoFo::PdfObject* pageObj = page->GetObject();
++			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+ 			/*
+-			PoDoFo::PdfObject parents = page->GetObject()->GetIndirectKey("StructParents");
++			PoDoFo::PdfObject parents = pageDict->FindKey("StructParents");
+ 			if (parents)
+ 			{
+ 				xParents = writer.newObject();
+@@ -9870,13 +9876,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			if (mbuffer[mlen-1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+-			nextObj = contents->GetIndirectKey("Filter");
++			nextObj = contentsDict.FindKey("Filter");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Filter ");
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+-			nextObj = contents->GetIndirectKey("DecodeParms");
++			nextObj = contentsDict.FindKey("DecodeParms");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/DecodeParms ");
+@@ -9967,7 +9973,9 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			nextObj = page->GetObject()->GetIndirectKey("Group");
++			PoDoFo::PdfObject* pageObj = page->GetObject();
++			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+@@ -10012,13 +10020,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ //				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+ /*
+- nextObj = contents->GetIndirectKey("Filter");
++			nextObj = contentsDict.FindKey("Filter");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Filter ");
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+-			nextObj = contents->GetIndirectKey("DecodeParms");
++			nextObj = contentsDict.FindKey("DecodeParms");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/DecodeParms ");
+--- a/scribus/plugins/import/ai/importai.cpp
++++ b/scribus/plugins/import/ai/importai.cpp
+@@ -587,36 +587,41 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		PoDoFo::PdfPage *curPage = doc.GetPage(0);
+ 		if (curPage != nullptr)
+ 		{
+-			PoDoFo::PdfObject *piece = curPage->GetObject()->GetIndirectKey("PieceInfo");
++			PoDoFo::PdfObject* pageObj = curPage->GetObject();
++			PoDoFo::PdfDictionary* pageDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
++			PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
+ 			if (piece != nullptr)
+ 			{
+-				PoDoFo::PdfObject *illy = piece->GetIndirectKey("Illustrator");
++				PoDoFo::PdfDictionary* pieceDict = piece->IsDictionary() ? &(piece->GetDictionary()) : nullptr;
++				PoDoFo::PdfObject *illy = pieceDict ? pieceDict->FindKey("Illustrator") : nullptr;
+ 				if (illy != nullptr)
+ 				{
+-					PoDoFo::PdfObject *priv = illy->GetIndirectKey("Private");
++					PoDoFo::PdfDictionary* illyDict = illy->IsDictionary() ? &(illy->GetDictionary()) : nullptr;
++					PoDoFo::PdfObject *priv = illyDict ? illyDict->FindKey("Private") : nullptr;
+ 					if (priv == nullptr)
+ 						priv = illy;
+ 					int num = 0;
+-					PoDoFo::PdfObject *numBl = priv->GetIndirectKey("NumBlock");
++					PoDoFo::PdfDictionary* privDict = priv->IsDictionary() ? &(priv->GetDictionary()) : nullptr;
++					PoDoFo::PdfObject *numBl = privDict ? privDict->FindKey("NumBlock") : nullptr;
+ 					if (numBl != nullptr)
+ 						num = numBl->GetNumber() + 1;
+ 					if (num == 0)
+ 						num = 99999;
+ 					QString name = "AIPrivateData%1";
+ 					QString Key = name.arg(1);
+-					PoDoFo::PdfObject *data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++					PoDoFo::PdfObject *data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
+ 					if (data == nullptr)
+ 					{
+ 						name = "AIPDFPrivateData%1";
+ 						Key = name.arg(1);
+-						data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++						data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
+ 					}
+ 					if (data != nullptr)
+ 					{
+ 						if (num == 2)
+ 						{
+ 							Key = name.arg(1);
+-							data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 							PoDoFo::PdfStream const *stream = data->GetStream();
+ 							PoDoFo::PdfMemoryOutputStream oStream(1);
+ 							stream->GetFilteredCopy(&oStream);
+@@ -631,7 +636,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 							for (int a = 2; a < num; a++)
+ 							{
+ 								Key = name.arg(a);
+-								data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 								if (data == nullptr)
+ 									break;
+ 								PoDoFo::PdfStream const *stream = data->GetStream();
diff --git a/srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch b/srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch
new file mode 100644
index 0000000000000..5810becb56446
--- /dev/null
+++ b/srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch
@@ -0,0 +1,1602 @@
+From bbaa1944d83a2c68e49927d5bcc462cd870beb2d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Tue, 15 Aug 2023 02:43:52 +0000
+Subject: [PATCH 09/13] #16948: Fix build with podofo 0.10.x
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25601 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 33580ae8371e993b6e199e710950702c78d7dde1)
+---
+ scribus/documentchecker.cpp                   |  18 +-
+ .../imagedataloaders/scimgdataloader_pdf.cpp  |  12 +-
+ scribus/pdf_analyzer.cpp                      | 533 +++++++++++++++++-
+ scribus/pdflib_core.cpp                       | 480 +++++++++++++---
+ scribus/pdflib_core.h                         |   4 +-
+ scribus/plugins/import/ai/importai.cpp        |  41 +-
+ 6 files changed, 985 insertions(+), 103 deletions(-)
+
+--- a/scribus/documentchecker.cpp
++++ b/scribus/documentchecker.cpp
+@@ -109,7 +109,7 @@ bool DocumentChecker::checkDocument(Scri
+ void DocumentChecker::checkPages(ScribusDoc *currDoc, const CheckerPrefs& checkerSettings)
+ {
+ 	errorCodes pageError;
+-	for (int i=0; i < currDoc->DocPages.count(); ++i )
++	for (int i = 0; i < currDoc->DocPages.count(); ++i)
+ 	{
+ 		pageError.clear();
+ 		if (checkerSettings.checkAppliedMasterDifferentSide)
+@@ -127,11 +127,11 @@ void DocumentChecker::checkPages(Scribus
+ 			}
+ 			else
+ 			{
+-				if (pageLoc==LeftPage && masterPageLocation==1)
++				if (pageLoc == LeftPage && masterPageLocation == 1)
+ 					error = false;
+-				else if (pageLoc==RightPage && masterPageLocation==0)
++				else if (pageLoc == RightPage && masterPageLocation == 0)
+ 					error = false;
+-				else if (pageLoc==MiddlePage && masterPageLocation==2)
++				else if (pageLoc == MiddlePage && masterPageLocation == 2)
+ 					error = false;
+ 				else
+ 					error = true;
+@@ -596,7 +596,7 @@ void DocumentChecker::checkItems(Scribus
+ 								}
+ 								if (checkerSettings.checkNotCMYKOrSpot)
+ 								{
+-									for (int i=0; i<usedColorSpaces.size(); ++i)
++									for (int i = 0; i < usedColorSpaces.size(); ++i)
+ 									{
+ 										if (usedColorSpaces[i] == CS_DeviceRGB || usedColorSpaces[i] == CS_ICCBased || usedColorSpaces[i] == CS_CalGray
+ 											|| usedColorSpaces[i] == CS_CalRGB || usedColorSpaces[i] == CS_Lab)
+@@ -608,7 +608,7 @@ void DocumentChecker::checkItems(Scribus
+ 								}
+ 								if (checkerSettings.checkDeviceColorsAndOutputIntent && currDoc->HasCMS)
+ 								{
+-									for (int i=0; i<usedColorSpaces.size(); ++i)
++									for (int i = 0; i < usedColorSpaces.size(); ++i)
+ 									{
+ 										if (currPrintProfCS == ColorSpace_Cmyk && (usedColorSpaces[i] == CS_DeviceRGB || usedColorSpaces[i] == CS_DeviceGray))
+ 										{
+@@ -627,7 +627,7 @@ void DocumentChecker::checkItems(Scribus
+ 								itemError.insert(Transparency, 0);
+ 							if (checkerSettings.checkFontNotEmbedded || checkerSettings.checkFontIsOpenType)
+ 							{
+-								for (int i=0; i<usedFonts.size(); ++i)
++								for (int i = 0; i < usedFonts.size(); ++i)
+ 								{
+ 									PDFFont currentFont = usedFonts[i];
+ 									if (!currentFont.isEmbedded && checkerSettings.checkFontNotEmbedded)
+@@ -638,7 +638,7 @@ void DocumentChecker::checkItems(Scribus
+ 							}
+ 							if (checkerSettings.checkResolution)
+ 							{
+-								for (int i=0; i<imgs.size(); ++i)
++								for (int i = 0; i < imgs.size(); ++i)
+ 								{
+ 									if ((imgs[i].dpiX < checkerSettings.minResolution) || (imgs[i].dpiY < checkerSettings.minResolution))
+ 										itemError.insert(ImageDPITooLow, 0);
+@@ -655,7 +655,7 @@ void DocumentChecker::checkItems(Scribus
+ 				if ( currItem->frameOverflows() && (checkerSettings.checkOverflow) && (!((currItem->isAnnotation()) && ((currItem->annotation().Type() == Annotation::Combobox) || (currItem->annotation().Type() == Annotation::Listbox)))))
+ 					itemError.insert(TextOverflow, 0);
+ 
+-				if (checkerSettings.checkEmptyTextFrames && (currItem->itemText.length()==0 || currItem->frameUnderflows()))
++				if (checkerSettings.checkEmptyTextFrames && (currItem->itemText.length() == 0 || currItem->frameUnderflows()))
+ 				{
+ 					bool isEmptyAnnotation = (currItem->isAnnotation() && 
+ 					                         ((currItem->annotation().Type() == Annotation::Link) ||
+--- a/scribus/imagedataloaders/scimgdataloader_pdf.cpp
++++ b/scribus/imagedataloaders/scimgdataloader_pdf.cpp
+@@ -55,10 +55,16 @@ bool ScImgDataLoader_PDF::loadPicture(co
+ #ifdef HAVE_PODOFO
+ 	try
+ 	{
+-		PoDoFo::PdfError::EnableDebug( false );
+-		PoDoFo::PdfError::EnableLogging( false );
+-		PoDoFo::PdfMemDocument doc( fn.toLocal8Bit().data() );
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PoDoFo::PdfMemDocument doc;
++		doc.Load(fn.toLocal8Bit().data());
++		m_imageInfoRecord.numberOfPages = doc.GetPages().GetCount();
++#else
++		PoDoFo::PdfError::EnableDebug(false);
++		PoDoFo::PdfError::EnableLogging(false);
++		PoDoFo::PdfMemDocument doc(fn.toLocal8Bit().data());
+ 		m_imageInfoRecord.numberOfPages = doc.GetPageCount();
++#endif
+ 		if (page > m_imageInfoRecord.numberOfPages)
+ 		{
+ 			qDebug() << "Incorrect page number specified!";
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -30,6 +30,10 @@ for which a new license (GPL+exception)
+ #ifdef HAVE_PODOFO
+ using namespace PoDoFo;
+ 
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
++#define IsRealStrict IsReal
++#endif
++
+ static QHash<QString, PDFContentStreamKeyword> kwNameMap;
+ 
+ // we gonna need a map from string values to the defined enum of pdf keywords
+@@ -77,10 +81,13 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 
+ 	m_pdfdoc = nullptr;
+ 
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+ 	PdfError::EnableDebug( false );
++#endif
+ 	try
+ 	{
+-		m_pdfdoc = new PdfMemDocument(filename.toLocal8Bit().data());
++		m_pdfdoc = new PdfMemDocument();
++		m_pdfdoc->Load(filename.toLocal8Bit().data());
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -99,7 +106,12 @@ bool PDFAnalyzer::inspectPDF(int pageNum
+ {
+ 	if (!m_pdfdoc)
+ 		return false;
++
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++	PdfPage* page = &(m_pdfdoc->GetPages().GetPageAt(pageNum));
++#else
+ 	PdfPage* page = m_pdfdoc->GetPage(pageNum);
++#endif
+ 	return page ? inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs) : false;
+ }
+ 
+@@ -139,7 +151,13 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ 					PdfObject* pBase = &base;
+ 					if (base.IsReference())
+ 					{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++						PdfDocument* pdfdoc = cs->GetDocument();
++						PdfIndirectObjectList& pdf_iol = pdfdoc->GetObjects();
++						pBase = pdf_iol.GetObject(base.GetReference());
++#else
+ 						pBase = cs->GetOwner()->GetObject(base.GetReference());
++#endif
+ 					}
+ #if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 9, 7))
+ 					pBase->SetOwner(cs->GetOwner());
+@@ -180,11 +198,21 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		// get hold of a PdfObject pointer of this canvas
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PdfObject* canvasObject = page ? &(page->GetObject()) : &(dynamic_cast<PdfXObject*>(canvas)->GetObject());
++
++#else
+ 		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++#endif
+ 		PdfDictionary* canvasDict = (canvasObject && canvasObject->IsDictionary()) ? &(canvasObject->GetDictionary()) : nullptr;
+ 
+ 		// find a resource with ColorSpace entry
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PdfResources* canvasRsrc = canvas->GetResources();
++		PdfObject* resources = &(canvasRsrc->GetObject());
++#else
+ 		PdfObject* resources = canvas->GetResources();
++#endif
+ 		for (PdfDictionary* par = canvasDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+ 			resources = par->FindKey("Resources");
+@@ -234,6 +262,468 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 
+ 	try
+ 	{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		// start parsing the content stream
++		PdfContentReaderArgs tokenizerArgs = { PdfContentReaderFlags::DontFollowXObjectForms };
++		PdfContentStreamReader tokenizer(*canvas, tokenizerArgs);
++		PdfContent pdfContent;
++		PdfVariant var;
++		bool readToken;
++
++		int tokenNumber = 0;
++		bool inlineImgDict = false;
++		QList<PdfVariant> args;
++		QStack<PDFGraphicState> gsStack;
++		PDFGraphicState currGS;
++		while ((readToken = tokenizer.TryReadNext(pdfContent)))
++		{
++			++tokenNumber;
++			if (pdfContent.Type == PdfContentType::Operator)
++			{
++				args.clear();
++				int stackSize = pdfContent.Stack.size();
++				for (size_t i = 0; i < stackSize; ++i)
++					args.append(pdfContent.Stack[stackSize - 1 - i]);
++				switch (pdfContent.Operator)
++				{
++				case PdfOperator::q:
++					gsStack.push(currGS);
++					break;
++				case PdfOperator::Q:
++					currGS = gsStack.pop();
++					break;
++				case PdfOperator::cm:
++				{
++					if (args.size() == 6)
++					{
++						double mt[6];
++						for (int i = 0; i < 6; ++i)
++						{
++							mt[i] = args[i].GetReal();
++						}
++						QTransform transMatrix(mt[0], mt[1], mt[2], mt[3], mt[4], mt[5]);
++						currGS.ctm = transMatrix * currGS.ctm;
++					}
++				}
++				break;
++				case PdfOperator::w:
++					currGS.lineWidth = args[0].GetReal();
++					break;
++				case PdfOperator::J:
++					currGS.lineCap = args[0].GetNumber();
++					break;
++				case PdfOperator::j:
++					currGS.lineJoin = args[0].GetNumber();
++					break;
++				case PdfOperator::M:
++					currGS.lineJoin = args[0].GetReal();
++					break;
++				case PdfOperator::d:
++				{
++					currGS.dashPattern.first.clear();
++					PdfArray dashArr = args[0].GetArray();
++					for (uint i = 0; i < dashArr.size(); ++i)
++						currGS.dashPattern.first.append(dashArr[i].GetNumber());
++					currGS.dashPattern.second = args[1].GetNumber();
++				}
++				break;
++				case PdfOperator::g:
++					if (!usedColorSpaces.contains(CS_DeviceGray))
++						usedColorSpaces.append(CS_DeviceGray);
++					currGS.fillCS = CS_DeviceGray;
++					currGS.fillColor.clear();
++					currGS.fillColor.append(args[0].GetReal());
++					break;
++				case PdfOperator::G:
++					if (!usedColorSpaces.contains(CS_DeviceGray))
++						usedColorSpaces.append(CS_DeviceGray);
++					currGS.strokeCS = CS_DeviceGray;
++					currGS.strokeColor.clear();
++					currGS.strokeColor.append(args[0].GetReal());
++					break;
++				case PdfOperator::rg:
++					if (!usedColorSpaces.contains(CS_DeviceRGB))
++						usedColorSpaces.append(CS_DeviceRGB);
++					currGS.fillCS = CS_DeviceRGB;
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.fillColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::RG:
++					if (!usedColorSpaces.contains(CS_DeviceRGB))
++						usedColorSpaces.append(CS_DeviceRGB);
++					currGS.strokeCS = CS_DeviceRGB;
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.strokeColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::k:
++					if (!usedColorSpaces.contains(CS_DeviceCMYK))
++						usedColorSpaces.append(CS_DeviceCMYK);
++					currGS.fillCS = CS_DeviceCMYK;
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.fillColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::K:
++					if (!usedColorSpaces.contains(CS_DeviceCMYK))
++						usedColorSpaces.append(CS_DeviceCMYK);
++					currGS.strokeCS = CS_DeviceCMYK;
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.strokeColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::cs:
++				{
++					if (args.size() == 1 && args[0].IsName())
++					{
++						if (args[0].GetName() == "DeviceGray")
++						{
++							currGS.fillCS = CS_DeviceGray;
++							currGS.fillColor.clear();
++							currGS.fillColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceGray))
++								usedColorSpaces.append(CS_DeviceGray);
++						}
++						else if (args[0].GetName() == "DeviceRGB")
++						{
++							currGS.fillCS = CS_DeviceRGB;
++							currGS.fillColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.fillColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceRGB))
++								usedColorSpaces.append(CS_DeviceRGB);
++						}
++						else if (args[0].GetName() == "DeviceCMYK")
++						{
++							currGS.fillCS = CS_DeviceCMYK;
++							currGS.fillColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.fillColor.append(0);
++							currGS.fillColor.append(1);
++							if (!usedColorSpaces.contains(CS_DeviceCMYK))
++								usedColorSpaces.append(CS_DeviceCMYK);
++						}
++						else if (args[0].GetName() == "Pattern")
++						{
++							currGS.fillCS = CS_Pattern;
++							if (!usedColorSpaces.contains(CS_Pattern))
++								usedColorSpaces.append(CS_Pattern);
++						}
++						else
++						{
++							if (processedNamedCS.contains(args[0].GetName()))
++							{
++								currGS.fillCS = processedNamedCS.value(args[0].GetName());
++							}
++							else
++							{
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								{
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PDFColorSpace retval = getCSType(csEntry);
++									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++										usedColorSpaces.append(retval);
++									currGS.fillCS = retval;
++									processedNamedCS.insert(args[0].GetName(), retval);
++								}
++								else
++								{
++									qDebug() << "Supplied colorspace is undefined! File:" << m_filename;
++									return false;
++								}
++							}
++						}
++					}
++					else
++					{
++						qDebug() << "Wrong syntax in specifying color space! File:" << m_filename;
++						return false;
++					}
++				}
++				break;
++				case PdfOperator::CS:
++				{
++					if (args.size() == 1 && args[0].IsName())
++					{
++						if (args[0].GetName() == "DeviceGray")
++						{
++							currGS.strokeCS = CS_DeviceGray;
++							currGS.strokeColor.clear();
++							currGS.strokeColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceGray))
++								usedColorSpaces.append(CS_DeviceGray);
++						}
++						else if (args[0].GetName() == "DeviceRGB")
++						{
++							currGS.fillCS = CS_DeviceRGB;
++							currGS.strokeColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.strokeColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceRGB))
++								usedColorSpaces.append(CS_DeviceRGB);
++						}
++						else if (args[0].GetName() == "DeviceCMYK")
++						{
++							currGS.fillCS = CS_DeviceCMYK;
++							currGS.strokeColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.strokeColor.append(0);
++							currGS.strokeColor.append(1);
++							if (!usedColorSpaces.contains(CS_DeviceCMYK))
++								usedColorSpaces.append(CS_DeviceCMYK);
++						}
++						else if (args[0].GetName() == "Pattern")
++						{
++							currGS.fillCS = CS_Pattern;
++							if (!usedColorSpaces.contains(CS_Pattern))
++								usedColorSpaces.append(CS_Pattern);
++						}
++						else
++						{
++							if (processedNamedCS.contains(args[0].GetName()))
++							{
++								currGS.strokeCS = processedNamedCS.value(args[0].GetName());
++							}
++							else
++							{
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								{
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PDFColorSpace retval = getCSType(csEntry);
++									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++										usedColorSpaces.append(retval);
++									currGS.strokeCS = retval;
++									processedNamedCS.insert(args[0].GetName(), retval);
++								}
++								else
++								{
++									qDebug() << "Supplied colorspace is undefined! File:" << m_filename;
++									return false;
++								}
++							}
++						}
++					}
++					else
++					{
++						qDebug() << "Wrong syntax in specifying color space! File:" << m_filename;
++						return false;
++					}
++				}
++				break;
++				case PdfOperator::sc:
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.fillColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::SC:
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.strokeColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::scn:
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++					{
++						if (args[i].IsRealStrict() || args[i].IsNumber())
++							currGS.fillColor.append(args[i].GetReal());
++					}
++					break;
++				case PdfOperator::SCN:
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++					{
++						if (args[i].IsRealStrict() || args[i].IsNumber())
++							currGS.strokeColor.append(args[i].GetReal());
++					}
++					break;
++				case PdfOperator::Do: // image or form XObject
++					// Handled in PdfContentType::DoXObject
++					break;
++				case PdfOperator::BI:
++					inlineImgDict = true;
++					break;
++				case PdfOperator::ID:
++					if (inlineImgDict)
++					{
++						PdfName colorspace("ColorSpace");
++						PdfName cs("CS");
++						if (args.contains(colorspace) || args.contains(cs))
++						{
++							int csIdx = args.contains(colorspace) ? args.indexOf(colorspace) : args.indexOf(cs);
++							if (args[csIdx + 1].IsName())
++							{
++								PdfName csName = args[csIdx + 1].GetName();
++								if ((csName == "G" || csName == "DeviceGray") && !usedColorSpaces.contains(CS_DeviceGray))
++									usedColorSpaces.append(CS_DeviceGray);
++								else if ((csName == "RGB" || csName == "DeviceRGB") && !usedColorSpaces.contains(CS_DeviceRGB))
++									usedColorSpaces.append(CS_DeviceRGB);
++								else if ((csName == "CMYK" || csName == "DeviceCMYK") && !usedColorSpaces.contains(CS_DeviceCMYK))
++									usedColorSpaces.append(CS_DeviceCMYK);
++								else if (!processedNamedCS.contains(csName))
++								{
++									if (colorSpacesDict && colorSpacesDict->FindKey(csName))
++									{
++										PdfObject* csEntry = colorSpacesDict->FindKey(csName);
++										if (csEntry)
++										{
++											PDFColorSpace retval = getCSType(csEntry);
++											if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++												usedColorSpaces.append(retval);
++											processedNamedCS.insert(csName, retval);
++										}
++									}
++									else
++									{
++										qDebug() << "Supplied colorspace for inline image is undefined!";
++										return false;
++									}
++								}
++							}
++						}
++						PdfName height("Height");
++						PdfName h("H");
++						PdfName width("Width");
++						PdfName w("W");
++						if ((args.contains(height) || args.contains(h)) && (args.contains(width) || args.contains(w)))
++						{
++							int heightIdx = args.contains(height) ? args.indexOf(height) : args.indexOf(h);
++							int widthIdx = args.contains(width) ? args.indexOf(width) : args.indexOf(w);
++							double height = args[heightIdx + 1].GetReal();
++							double width = args[widthIdx + 1].GetReal();
++							PDFImage img;
++							img.imgName = "Inline Image";
++							img.dpiX = qRound(width / (currGS.ctm.m11() / 72));
++							img.dpiY = qRound(height / (currGS.ctm.m22() / 72));
++							imgs.append(img);
++						}
++						inlineImgDict = false;
++					}
++					break;
++				case PdfOperator::gs:
++				{
++					if (!processedNamedGS.contains(args[0].GetName()))
++					{
++						if (args.size() == 1 && args[0].IsName() && extGStatesDict)
++						{
++							PdfObject* extGStateObj = extGStatesDict->FindKey(args[0].GetName());
++							if (extGStateObj)
++							{
++								inspectExtGStateObj(extGStateObj, usedColorSpaces, hasTransparency, usedFonts, currGS);
++							}
++							else
++							{
++								qDebug() << "Named graphic state used with gs operator is undefined in current ExtGState. File:" << m_filename;
++								return false;
++							}
++							processedNamedGS.append(args[0].GetName());
++						}
++						else
++						{
++							qDebug() << "Wrong syntax in applying extended graphic state (gs operator) or there's no ExtGState defined! File:" << m_filename;
++							return false;
++						}
++					}
++				}
++				break;
++				case PdfOperator::Tf:
++				{
++					if (processedNamedFont.contains(args[0].GetName()))
++					{
++						currGS.font.first = processedNamedFont.value(args[0].GetName());
++						currGS.font.second = args[1].GetReal();
++					}
++					else
++					{
++						if (args.size() == 2 && args[0].IsName() && fontsDict)
++						{
++							PdfObject* fontObj = fontsDict->FindKey(args[0].GetName());
++							if (fontObj)
++							{
++								PDFFont retval = getFontInfo(fontObj);
++								usedFonts.append(retval);
++								processedNamedFont.insert(args[0].GetName(), retval);
++								currGS.font.first = retval;
++								currGS.font.second = args[1].GetReal();
++							}
++							else
++							{
++								qDebug() << "The specified font cannot be found in current Resources! File:" << m_filename;
++								return false;
++							}
++						}
++						else
++						{
++							qDebug() << "Wrong syntax in use of Tf operator or there's no Font defined in current Resources dictionary! File:" << m_filename;
++							return false;
++						}
++					}
++				}
++				break;
++				case PdfOperator::Unknown:
++				default:
++					break;
++				}
++				args.clear();
++			}
++			if (pdfContent.Type == PdfContentType::DoXObject)
++			{
++				args.clear();
++				int stackSize = pdfContent.Stack.size();
++				for (size_t i = 0; i < stackSize; ++i)
++					args.append(pdfContent.Stack[stackSize - 1 - i]);
++				if (!processedNamedXObj.contains(args[0].GetName()))
++				{
++					if (args.size() == 1 && args[0].IsName() && xObjectsDict)
++					{
++						PdfObject* xObject = xObjectsDict->FindKey(args[0].GetName());
++						PdfDictionary* xObjectDict = (xObject && xObject->IsDictionary()) ? &(xObject->GetDictionary()) : nullptr;
++						PdfObject* subtypeObject = xObjectDict ? xObjectDict->FindKey("Subtype") : nullptr;
++						if (subtypeObject && subtypeObject->IsName())
++						{
++							if (subtypeObject->GetName() == "Image")
++							{
++								PdfObject* imgColorSpace = xObjectDict->FindKey("ColorSpace");
++								if (imgColorSpace)
++								{
++									PDFColorSpace retval = getCSType(imgColorSpace);
++									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++										usedColorSpaces.append(retval);
++								}
++								PdfObject* sMaskObj = xObjectDict->FindKey("SMask");
++								if (sMaskObj)
++									hasTransparency = true;
++								PDFImage img;
++								img.imgName = args[0].GetName().GetEscapedName().c_str();
++								double width = xObjectDict->FindKey("Width")->GetReal();
++								double height = xObjectDict->FindKey("Height")->GetReal();
++								img.dpiX = qRound(width / (currGS.ctm.m11() / 72));
++								img.dpiY = qRound(height / (currGS.ctm.m22() / 72));
++								imgs.append(img);
++							}
++							else if (subtypeObject->GetName() == "Form")
++							{
++								std::unique_ptr<PdfXObjectForm> xObj;
++								PdfXObject::TryCreateFromObject(*xObject, xObj);
++								inspectCanvas(xObj.get(), usedColorSpaces, hasTransparency, usedFonts, imgs); // recursive call
++							}
++						}
++						else
++						{
++							qDebug() << "Supplied external object is undefined! File:" << m_filename;
++							return false;
++						}
++						processedNamedXObj.append(args[0].GetName());
++					}
++					else
++					{
++						qDebug() << "Wrong syntax for Do operator or there's no XObject defined! File:" << m_filename;
++						return false;
++					}
++				}
++			}
++		}
++#else
+ 		// start parsing the content stream
+ 		PdfContentsTokenizer tokenizer(canvas);
+ 		EPdfContentsType t;
+@@ -269,7 +759,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					if (args.size() == 6)
+ 					{
+ 						double mt[6];
+-						for (int i=0; i<6; ++i)
++						for (int i = 0; i < 6; ++i)
+ 						{
+ 							mt[i] = args[i].GetReal();
+ 						}
+@@ -294,7 +784,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					currGS.dashPattern.first.clear();
+ 					PdfArray dashArr = args[0].GetArray();
+-					for (uint i=0; i<dashArr.size(); ++i)
++					for (uint i = 0; i < dashArr.size(); ++i)
+ 						currGS.dashPattern.first.append(dashArr[i].GetNumber());
+ 					currGS.dashPattern.second = args[1].GetNumber();
+ 					}
+@@ -318,7 +808,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceRGB);
+ 					currGS.fillCS = CS_DeviceRGB;
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.fillColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_RG:
+@@ -326,7 +816,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceRGB);
+ 					currGS.strokeCS = CS_DeviceRGB;
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.strokeColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_k:
+@@ -334,7 +824,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceCMYK);
+ 					currGS.fillCS = CS_DeviceCMYK;
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.fillColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_K:
+@@ -342,7 +832,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceCMYK);
+ 					currGS.strokeCS = CS_DeviceCMYK;
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.strokeColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_cs:
+@@ -361,7 +851,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceRGB;
+ 							currGS.fillColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.fillColor.append(0);
+ 							if (!usedColorSpaces.contains(CS_DeviceRGB))
+ 								usedColorSpaces.append(CS_DeviceRGB);
+@@ -370,7 +860,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceCMYK;
+ 							currGS.fillColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.fillColor.append(0);
+ 							currGS.fillColor.append(1);
+ 							if (!usedColorSpaces.contains(CS_DeviceCMYK))
+@@ -430,7 +920,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceRGB;
+ 							currGS.strokeColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.strokeColor.append(0);
+ 							if (!usedColorSpaces.contains(CS_DeviceRGB))
+ 								usedColorSpaces.append(CS_DeviceRGB);
+@@ -439,7 +929,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceCMYK;
+ 							currGS.strokeColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.strokeColor.append(0);
+ 							currGS.strokeColor.append(1);
+ 							if (!usedColorSpaces.contains(CS_DeviceCMYK))
+@@ -485,17 +975,17 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					break;
+ 				case KW_sc:
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.fillColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_SC:
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.strokeColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_scn:
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 					{
+ 						if (args[i].IsReal() || args[i].IsNumber())
+ 							currGS.fillColor.append(args[i].GetReal());
+@@ -503,7 +993,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					break;
+ 				case KW_SCN:
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 					{
+ 						if (args[i].IsReal() || args[i].IsNumber())
+ 							currGS.strokeColor.append(args[i].GetReal());
+@@ -689,6 +1179,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 				args.clear();
+ 			}
+ 		}
++#endif
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -714,14 +1205,14 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 	{
+ 		PdfArray arr = bmObj->GetArray();
+ 		currGS.blendModes.clear();
+-		for(uint i=0; i<arr.GetSize(); ++i)
++		for (uint i = 0; i < arr.GetSize(); ++i)
+ 			currGS.blendModes.append(arr[i].GetName().GetEscapedName().c_str());
+ 		if (arr[0].IsName() && !(arr[0].GetName() == "Normal" || arr[0].GetName() == "Compatible"))
+ 			hasTransparency = true;
+ 	}
+ 
+ 	PdfObject* caObj = extGStateDict ? extGStateDict->FindKey("ca") : nullptr;
+-	if (caObj && (caObj->IsReal() || caObj->IsNumber()))
++	if (caObj && (caObj->IsRealStrict() || caObj->IsNumber()))
+ 	{
+ 		currGS.fillAlphaConstant = caObj->GetReal();
+ 		if (caObj->GetReal() < 1)
+@@ -729,7 +1220,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 	}
+ 
+ 	PdfObject* cAObj = extGStateDict ? extGStateDict->FindKey("CA") : nullptr;
+-	if (cAObj && (cAObj->IsReal() || cAObj->IsNumber()))
++	if (cAObj && (cAObj->IsRealStrict() || cAObj->IsNumber()))
+ 	{
+ 		if (cAObj->GetReal() < 1)
+ 			hasTransparency = true;
+@@ -780,7 +1271,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		PdfObject dObjA = dObj->GetArray()[0];
+ 		PdfArray dashArr = dObjA.GetArray();
+ 		currGS.dashPattern.first.clear();
+-		for (uint i=0; i<dashArr.GetSize(); ++i)
++		for (uint i = 0; i < dashArr.GetSize(); ++i)
+ 			currGS.dashPattern.first.append(dashArr[i].GetNumber());
+ 		PdfObject dObjB = dObj->GetArray()[1];
+ 		currGS.dashPattern.second = dObjB.GetNumber();
+@@ -816,7 +1307,11 @@ PDFFont PDFAnalyzer::getFontInfo(PdfObje
+ 		if (descendantFonts && descendantFonts->IsArray())
+ 		{
+ 			const PdfReference& refDescFont = descendantFonts->GetArray()[0].GetReference();
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++			PdfObject* descendantFont = descendantFonts->GetDocument()->GetObjects().GetObject(refDescFont);
++#else
+ 			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
++#endif
+ 			PdfDictionary* descendantFontDict = (descendantFont && descendantFont->IsDictionary()) ? &(descendantFont->GetDictionary()) : nullptr;
+ 			const PdfObject* subtypeDescFont = descendantFontDict->FindKey("Subtype");
+ 			fontDesc = &(descendantFontDict->MustGetKey("FontDescriptor"));
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9783,22 +9783,298 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 	QScopedPointer<PoDoFo::PdfMemDocument> doc;
+ 	try
+ 	{
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PoDoFo::PdfError::EnableDebug(false);
+ 		PoDoFo::PdfError::EnableLogging(false);
+-		doc.reset(new PoDoFo::PdfMemDocument(fn.toLocal8Bit().data()));
++#endif
++		doc.reset(new PoDoFo::PdfMemDocument());
++		doc->Load(fn.toLocal8Bit().data());
+ 	}
+-	catch(PoDoFo::PdfError& e)
++	catch (PoDoFo::PdfError& e)
+ 	{
+ 		qDebug() << "PoDoFo error, falling back to raster!";
+ 		e.PrintErrorMsg();
+ 		return false;
+ 	}
+ 
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	try
+ 	{
+-		PoDoFo::PdfPage*   page      = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
+-		PoDoFo::PdfObject* pageObj   = page ? page->GetObject() : nullptr;
+-		PoDoFo::PdfObject* contents  = page ? page->GetContents() : nullptr;
++		PoDoFo::PdfPage& page = doc->GetPages().GetPageAt(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
++		PoDoFo::PdfObject& pageObj = page.GetObject();
++		PoDoFo::PdfObject* contents = page.GetContents() ? &(page.GetContents()->GetObject()) : nullptr;
++		PoDoFo::PdfObject* resources = page.GetResources() ? &(page.GetResources()->GetObject()) : nullptr;
++		PoDoFo::PdfDictionary* pageObjDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
++		{
++			resources = par->FindKey("Resources");
++			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
++			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
++		}
++		if (contents && contents->GetDataType() == PoDoFo::PdfDataType::Dictionary)
++		{
++			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
++			PoDoFo::PdfObjectStream* stream = contents->GetStream();
++			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
++			QList<PoDoFo::PdfReference> referencedObjects;
++			PoDoFo::PdfObject* nextObj { nullptr };
++			PdfId xObj = writer.newObject();
++			PdfId xResources = writer.newObject();
++			PdfId xParents = 0;
++			importedObjects[page.GetObject().GetIndirectReference()] = xObj;
++			writer.startObj(xObj);
++			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
++			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
++			int rotation = page.GetRotationRaw();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
++			QTransform pageM;
++			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
++			pageM.rotate(rotation);
++			if (rotation == 90)
++				pageM.translate(0.0, -imgHeight);
++			else if (rotation == 180)
++				pageM.translate(-imgWidth, -imgHeight);
++			else if (rotation == 270)
++				pageM.translate(-imgWidth, 0.0);
++			pageM.scale(imgWidth, imgHeight);
++			pageM = pageM.inverted();
++			PutDoc("\n/BBox [" + Pdf::toPdf(pageRect.GetLeft()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetLeft() + pageRect.Width));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
++			PutDoc("]");
++			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
++			PutDoc("]");
++			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
++			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			if (nextObj)
++			{
++				PutDoc("\n/Group "); // PDF 1.4
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++			/*
++			PoDoFo::PdfObject parents = pageDict->FindKey("StructParents");
++			if (parents)
++			{
++				xParents = writer.newObject();
++				PutDoc("\n/StructParents " + Pdf::toPdf(xParents)); // required if page uses structured content
++			}
++			*/
++
++			const char* mbuffer = nullptr;
++			long mlen = 0;
++			PoDoFo::charbuff strBuff = stream->GetCopy(true);
++			mlen = strBuff.size();
++			mbuffer = strBuff.c_str();
++			if (mbuffer[mlen - 1] == '\n')
++				--mlen;
++			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
++			nextObj = contentsDict.FindKey("Filter");
++			if (nextObj)
++			{
++				PutDoc("\n/Filter ");
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++			nextObj = contentsDict.FindKey("DecodeParms");
++			if (nextObj)
++			{
++				PutDoc("\n/DecodeParms ");
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++			PutDoc("\n>>\nstream\n");
++			{
++				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
++				EncodeArrayToStream(buffer, xObj);
++			}  // disconnect QByteArray from raw data
++			PutDoc("\nendstream");
++			writer.endObj(xObj);
++			// write resources
++			if (resources)
++			{
++				copyPoDoFoObject(resources, xResources, importedObjects);
++			}
++			else
++			{
++				writer.startObj(xResources);
++				PutDoc("<< >>");
++				writer.endObj(xResources);
++			}
++			if (xParents)
++			{
++				// create structured parents
++			}
++			// write referenced objects
++			PoDoFo::PdfIndirectObjectList& allObjects = contents->GetDocument()->GetObjects();
++			for (int i = 0; i < referencedObjects.size(); ++i)
++			{
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects.GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
++			}
++
++			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
++			imgInfo.ResNum = ResCount;
++			ResCount++;
++			// Avoid a divide-by-zero if width/height are less than 1 point:
++			imgInfo.Width = qMax(1, (int) imgWidth);
++			imgInfo.Height = qMax(1, (int) imgHeight);
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
++			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
++			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
++			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
++			imgInfo.sya = sy * imgHeight / imgInfo.Height;
++
++			return true;
++		}
++		if (contents && contents->GetDataType() == PoDoFo::PdfDataType::Array)//Page contents might be an array
++		{
++			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
++			QList<PoDoFo::PdfReference> referencedObjects;
++			PoDoFo::PdfObject* nextObj;
++			PdfId xObj = writer.newObject();
++			PdfId xResources = writer.newObject();
++			PdfId xParents = 0;
++			importedObjects[page.GetObject().GetIndirectReference()] = xObj;
++			writer.startObj(xObj);
++			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
++			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
++			int rotation = page.GetRotationRaw();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
++			QTransform pageM;
++			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
++			pageM.rotate(rotation);
++			if (rotation == 90)
++				pageM.translate(0.0, -imgHeight);
++			else if (rotation == 180)
++				pageM.translate(-imgWidth, -imgHeight);
++			else if (rotation == 270)
++				pageM.translate(-imgWidth, 0.0);
++			pageM.scale(imgWidth, imgHeight);
++			pageM = pageM.inverted();
++			PutDoc("\n/BBox [" + Pdf::toPdf(pageRect.GetLeft()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetLeft() + pageRect.Width));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
++			PutDoc("]");
++			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
++			PutDoc("]");
++			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
++			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			if (nextObj)
++			{
++				PutDoc("\n/Group "); // PDF 1.4
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++
++			const char* mbuffer = nullptr;
++			long mlen = 0;
++			PoDoFo::charbuff strBuffer;
++			PoDoFo::StringStreamDevice strStreamDev(strBuffer);
++			PoDoFo::PdfArray carray(page.GetContents()->GetObject().GetArray());
++			for (unsigned int ci = 0; ci < carray.size(); ++ci)
++			{
++				if (carray[ci].HasStream())
++				{
++					carray[ci].GetStream()->CopyTo(strStreamDev, false);
++				}
++				else if (carray[ci].IsReference())
++				{
++					nextObj = doc->GetObjects().GetObject(carray[ci].GetReference());
++
++					while (nextObj != nullptr)
++					{
++						if (nextObj->IsReference())
++						{
++							nextObj = doc->GetObjects().GetObject(nextObj->GetReference());
++						}
++						else if (nextObj->HasStream())
++						{
++							nextObj->GetStream()->CopyTo(strStreamDev, false);
++							break;
++						}
++					}
++				}
++			}
++			// end of copy
++			mlen = strBuffer.size();
++			mbuffer = strBuffer.c_str();
++
++			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
++			PutDoc("\n>>\nstream\n");
++			{
++				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
++				EncodeArrayToStream(buffer, xObj);
++			}  // disconnect QByteArray from raw data
++			PutDoc("\nendstream");
++			writer.endObj(xObj);
++			// write resources
++			if (resources)
++			{
++				copyPoDoFoObject(resources, xResources, importedObjects);
++			}
++			else
++			{
++				writer.startObj(xResources);
++				PutDoc("<< >>");
++				writer.endObj(xResources);
++			}
++			if (xParents)
++			{
++				// create structured parents
++			}
++			// write referenced objects
++			PoDoFo::PdfIndirectObjectList& allObjects = contents->GetDocument()->GetObjects();
++			for (int i = 0; i < referencedObjects.size(); ++i)
++			{
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects.GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
++			}
++
++			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
++			imgInfo.ResNum = ResCount;
++			ResCount++;
++			// Avoid a divide-by-zero if width/height are less than 1 point:
++			imgInfo.Width = qMax(1, (int) imgWidth);
++			imgInfo.Height = qMax(1, (int) imgHeight);
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
++			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
++			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
++			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
++			imgInfo.sya = sy * imgHeight / imgInfo.Height;
++
++			return true;
++		}
++	}
++	catch (PoDoFo::PdfError& e)
++	{
++		fatalError = true;
++		qDebug() << "PoDoFo error!";
++		e.PrintErrorMsg();
++		return false;
++	}
++#else
++	try
++	{
++		PoDoFo::PdfPage* page = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
++		PoDoFo::PdfObject* pageObj = page ? page->GetObject() : nullptr;
++		PoDoFo::PdfObject* contents = page ? page->GetContents() : nullptr;
+ 		PoDoFo::PdfObject* resources = page ? page->GetResources() : nullptr;
+ 		PoDoFo::PdfDictionary* pageObjDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+ 		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
+@@ -9807,13 +10083,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
+ 			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
+ 		}
+-		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Dictionary)
++		if (contents && contents->GetDataType() == PoDoFo::ePdfDataType_Dictionary)
+ 		{
+ 			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
+ 			PoDoFo::PdfStream* stream = contents->GetStream();
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+-			PoDoFo::PdfObject* nextObj { nullptr };
++			const PoDoFo::PdfObject* nextObj { nullptr };
+ 			PdfId xObj = writer.newObject();
+ 			PdfId xResources = writer.newObject();
+ 			PdfId xParents = 0;
+@@ -9822,7 +10098,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9841,14 +10117,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-								 + Pdf::toPdf(pageM.m12()) + " "
+-								 + Pdf::toPdf(pageM.m21()) + " "
+-								 + Pdf::toPdf(pageM.m22()) + " "
+-								 + Pdf::toPdf(pageM.dx())  + " "
+-								 + Pdf::toPdf(pageM.dy())  + " ");
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfObject* pageObj = page->GetObject();
+ 			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+ 			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+@@ -9864,16 +10139,16 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				PutDoc("\n/StructParents " + Pdf::toPdf(xParents)); // required if page uses structured content
+ 			}
+ 			*/
+-			char * mbuffer = nullptr;
+-			long mlen = 0;
+ 
+ 			// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
++			char* mbuffer = nullptr;
++			long mlen = 0;
+ 			PoDoFo::PdfMemoryOutputStream oStream(1);
+ 			stream->GetCopy(&oStream);
+ 			oStream.Close();
+ 			mlen = oStream.GetLength();
+ 			mbuffer = oStream.TakeBuffer();
+-			if (mbuffer[mlen-1] == '\n')
++			if (mbuffer[mlen - 1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+ 			nextObj = contentsDict.FindKey("Filter");
+@@ -9893,7 +10168,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 				EncodeArrayToStream(buffer, xObj);
+ 			}  // disconnect QByteArray from raw data
+-			free (mbuffer);
++			free(mbuffer);
+ 			PutDoc("\nendstream");
+ 			writer.endObj(xObj);
+ 			// write resources
+@@ -9915,18 +10190,19 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PoDoFo::PdfVecObjects* allObjects = contents->GetOwner();
+ 			for (int i=0; i < referencedObjects.size(); ++i)
+ 			{
+-				nextObj = allObjects->GetObject(referencedObjects[i]);
+-				copyPoDoFoObject(nextObj, importedObjects[nextObj->Reference()], importedObjects);
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects->GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
+ 			}
+ 
+ 			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
+ 			imgInfo.ResNum = ResCount;
+ 			ResCount++;
+ 			// Avoid a divide-by-zero if width/height are less than 1 point:
+-			imgInfo.Width  = qMax(1, (int) imgWidth);
++			imgInfo.Width = qMax(1, (int) imgWidth);
+ 			imgInfo.Height = qMax(1, (int) imgHeight);
+-			imgInfo.xa  = sx * imgWidth / imgInfo.Width;
+-			imgInfo.ya  = sy * imgHeight / imgInfo.Height;
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
+ 			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
+ 			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
+ 			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
+@@ -9934,7 +10210,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 
+ 			return true;
+ 		}
+-		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Array)//Page contents might be an array
++		if (contents && contents->GetDataType() == PoDoFo::ePdfDataType_Array)//Page contents might be an array
+ 		{
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+@@ -9947,7 +10223,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9966,14 +10242,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-								 + Pdf::toPdf(pageM.m12()) + " "
+-								 + Pdf::toPdf(pageM.m21()) + " "
+-								 + Pdf::toPdf(pageM.m22()) + " "
+-								 + Pdf::toPdf(pageM.dx())  + " "
+-								 + Pdf::toPdf(pageM.dy())  + " ");
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfObject* pageObj = page->GetObject();
+ 			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+ 			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+@@ -9982,11 +10257,10 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+ 
+-			char * mbuffer = nullptr;
+-			long mlen = 0;
+ 			// copied from podofoimpose
+-			PoDoFo::PdfMemoryOutputStream outMemStream (1);
+-//			PoDoFo::PdfFilteredEncodeStream outMemStream (outMemStreamRaw, ePdfFilter_FlateDecode, false);
++			char* mbuffer = nullptr;
++			long mlen = 0;
++			PoDoFo::PdfMemoryOutputStream outMemStream(1);
+ 			PoDoFo::PdfArray carray(page->GetContents()->GetArray());
+ 			for (unsigned int ci = 0; ci < carray.size(); ++ci)
+ 			{
+@@ -10000,7 +10274,6 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 
+ 					while (nextObj != nullptr)
+ 					{
+-
+ 						if (nextObj->IsReference())
+ 						{
+ 							nextObj = doc->GetObjects().GetObject(nextObj->GetReference());
+@@ -10016,29 +10289,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			// end of copy
+ 			mlen = outMemStream.GetLength();
+ 			mbuffer = outMemStream.TakeBuffer();
+-//			if (mbuffer[mlen-1] == '\n')
+-//				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+-/*
+-			nextObj = contentsDict.FindKey("Filter");
+-			if (nextObj)
+-			{
+-				PutDoc("\n/Filter ");
+-				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+-			}
+-			nextObj = contentsDict.FindKey("DecodeParms");
+-			if (nextObj)
+-			{
+-				PutDoc("\n/DecodeParms ");
+-				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+-			}
+-*/
+ 			PutDoc("\n>>\nstream\n");
+ 			{
+ 				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 				EncodeArrayToStream(buffer, xObj);
+ 			}  // disconnect QByteArray from raw data
+-			free (mbuffer);
++			free(mbuffer);
+ 			PutDoc("\nendstream");
+ 			writer.endObj(xObj);
+ 			// write resources
+@@ -10058,20 +10315,21 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			}
+ 			// write referenced objects
+ 			PoDoFo::PdfVecObjects* allObjects = contents->GetOwner();
+-			for (int i=0; i < referencedObjects.size(); ++i)
++			for (int i = 0; i < referencedObjects.size(); ++i)
+ 			{
+-				nextObj = allObjects->GetObject(referencedObjects[i]);
+-				copyPoDoFoObject(nextObj, importedObjects[nextObj->Reference()], importedObjects);
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects->GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
+ 			}
+ 
+ 			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
+ 			imgInfo.ResNum = ResCount;
+ 			ResCount++;
+ 			// Avoid a divide-by-zero if width/height are less than 1 point:
+-			imgInfo.Width  = qMax(1, (int) imgWidth);
++			imgInfo.Width = qMax(1, (int) imgWidth);
+ 			imgInfo.Height = qMax(1, (int) imgHeight);
+-			imgInfo.xa  = sx * imgWidth / imgInfo.Width;
+-			imgInfo.ya  = sy * imgHeight / imgInfo.Height;
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
+ 			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
+ 			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
+ 			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
+@@ -10079,24 +10337,76 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 
+ 			return true;
+ 		}
+-
+ 	}
+-	catch(PoDoFo::PdfError& e)
++	catch (PoDoFo::PdfError& e)
+ 	{
+ 		fatalError = true;
+ 		qDebug() << "PoDoFo error!";
+ 		e.PrintErrorMsg();
+ 		return false;
+ 	}
+-#endif
++#endif // PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0)
++
++#endif // HAVE_PODOFO
+ 	return false;
+ }
+ 
+ 
+ #if HAVE_PODOFO
+ 
+-void PDFLibCore::copyPoDoFoDirect(const PoDoFo::PdfVariant* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, PdfId>& importedObjects)
++void PDFLibCore::copyPoDoFoDirect(const PoDoFo::PdfObject* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, PdfId>& importedObjects)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++	switch (obj->GetDataType())
++	{
++	case PoDoFo::PdfDataType::Reference:
++	{
++		const PoDoFo::PdfReference& reference(obj->GetReference());
++		PdfId objNr;
++		if (!importedObjects.contains(reference))
++		{
++			objNr = writer.newObject();
++			importedObjects[reference] = objNr;
++			referencedObjects.append(reference);
++		}
++		else
++		{
++			objNr = importedObjects[reference];
++		}
++		PutDoc(" " + Pdf::toPdf(objNr) + " 0 R");
++		break;
++	}
++	case PoDoFo::PdfDataType::Array:
++	{
++		const PoDoFo::PdfArray& array(obj->GetArray());
++		PutDoc("[");
++		for (uint i = 0; i < array.size(); ++i)
++			copyPoDoFoDirect(&(array[i]), referencedObjects, importedObjects);
++		PutDoc("]");
++		break;
++	}
++	case PoDoFo::PdfDataType::Dictionary:
++	{
++		const PoDoFo::PdfDictionary& dict(obj->GetDictionary());
++		PutDoc("<<");
++		for (auto k = dict.begin(); k != dict.end(); ++k)
++		{
++			std::string str("\n/" + k->first.GetEscapedName());
++			PutDoc(QByteArray::fromRawData(str.data(), str.size()));
++			copyPoDoFoDirect(&k->second, referencedObjects, importedObjects);
++		}
++		PutDoc(" >>");
++		break;
++	}
++	default:
++	{
++		std::string str;
++		obj->GetVariant().ToString(str);
++		str = " " + str;
++		PutDoc(QByteArray::fromRawData(str.data(), str.size()));
++	}
++	}
++#else
+ 	switch (obj->GetDataType())
+ 	{
+ 		case PoDoFo::ePdfDataType_Reference:
+@@ -10147,11 +10457,41 @@ void PDFLibCore::copyPoDoFoDirect(const
+ 			PutDoc(QByteArray::fromRawData(str.data(), str.size()));
+ 		}
+ 	}
+-
++#endif
+ }
+ 
+ void PDFLibCore::copyPoDoFoObject(const PoDoFo::PdfObject* obj, PdfId scObjID, QMap<PoDoFo::PdfReference, PdfId>& importedObjects)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++	const PoDoFo::PdfIndirectObjectList& allObjects = obj->GetDocument()->GetObjects();
++	QList<PoDoFo::PdfReference> referencedObjects;
++	writer.startObj(scObjID);
++	copyPoDoFoDirect(obj, referencedObjects, importedObjects);
++	if (obj->HasStream())
++	{
++		const PoDoFo::PdfObjectStream* stream = obj->GetStream();
++		PoDoFo::charbuff strBuff = stream->GetCopy(true);
++		const char* mbuffer = strBuff.c_str();
++		size_t mlen = strBuff.size();
++		if (mbuffer[mlen - 1] == '\n')
++			--mlen;
++		PutDoc("\nstream\n");
++		{
++			QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
++			EncodeArrayToStream(buffer, scObjID);
++		}
++		PutDoc("\nendstream");
++	}
++	PutDoc("");
++	writer.endObj(scObjID);
++	// recurse:
++	for (int i = 0; i < referencedObjects.size(); ++i)
++	{
++		const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++		const PoDoFo::PdfObject* nextObj = allObjects.GetObject(pdfRef);
++		copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
++	}
++#else
+ 	PoDoFo::PdfVecObjects* allObjects = obj->GetOwner();
+ 	QList<PoDoFo::PdfReference> referencedObjects;
+ 	writer.startObj(scObjID);
+@@ -10159,7 +10499,7 @@ void PDFLibCore::copyPoDoFoObject(const
+ 	if (obj->HasStream())
+ 	{
+ 		const PoDoFo::PdfStream* stream = obj->GetStream();
+-		char * mbuffer = nullptr;
++		char* mbuffer = nullptr;
+ 		long mlen = 0;
+ 
+ 		// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
+@@ -10168,14 +10508,14 @@ void PDFLibCore::copyPoDoFoObject(const
+ 		oStream.Close();
+ 		mlen = oStream.GetLength();
+ 		mbuffer = oStream.TakeBuffer();
+-		if (mbuffer[mlen-1] == '\n')
++		if (mbuffer[mlen - 1] == '\n')
+ 			--mlen;
+ 		PutDoc("\nstream\n");
+ 		{
+ 			QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 			EncodeArrayToStream(buffer, scObjID);
+ 		}  // disconnect QByteArray from raw data
+-		free (mbuffer);
++		free(mbuffer);
+ 		PutDoc("\nendstream");
+ 	}
+ 	PutDoc("");
+@@ -10183,9 +10523,11 @@ void PDFLibCore::copyPoDoFoObject(const
+ 	// recurse:
+ 	for (int i=0; i < referencedObjects.size(); ++i)
+ 	{
+-		PoDoFo::PdfObject* nextObj = allObjects->GetObject(referencedObjects[i]);
+-		copyPoDoFoObject(nextObj, importedObjects[nextObj->Reference()], importedObjects);
++		const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++		const PoDoFo::PdfObject* nextObj = allObjects->GetObject(pdfRef);
++		copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
+ 	}
++#endif
+ }
+ #endif
+ 
+--- a/scribus/pdflib_core.h
++++ b/scribus/pdflib_core.h
+@@ -225,8 +225,8 @@ private:
+ 	bool    PDF_Image(PageItem* c, const QString& fn, double sx, double sy, double x, double y, bool fromAN = false, const QString& Profil = "", bool Embedded = false, eRenderIntent Intent = Intent_Relative_Colorimetric, QByteArray* output = nullptr);
+ 	bool    PDF_EmbeddedPDF(PageItem* c, const QString& fn, double sx, double sy, double x, double y, ShIm& imgInfo, bool &fatalError);
+ #if HAVE_PODOFO
+-	void copyPoDoFoObject(const PoDoFo::PdfObject* obj, uint scObjID, QMap<PoDoFo::PdfReference, uint>& importedObjects);
+-	void copyPoDoFoDirect(const PoDoFo::PdfVariant* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, uint>& importedObjects);
++	void copyPoDoFoObject(const PoDoFo::PdfObject* obj, PdfId scObjID, QMap<PoDoFo::PdfReference, uint>& importedObjects);
++	void copyPoDoFoDirect(const PoDoFo::PdfObject* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, uint>& importedObjects);
+ #endif
+ 
+ 	quint32 encode32dVal(double val) const;
+--- a/scribus/plugins/import/ai/importai.cpp
++++ b/scribus/plugins/import/ai/importai.cpp
+@@ -581,13 +581,24 @@ bool AIPlug::extractFromPDF(const QStrin
+ 	}
+ 	try
+ 	{
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PoDoFo::PdfError::EnableDebug( false );
+ 		PoDoFo::PdfError::EnableLogging( false );
+-		PoDoFo::PdfMemDocument doc( infile.toLocal8Bit().data() );
++#endif
++		PoDoFo::PdfMemDocument doc;
++		doc.Load(infile.toLocal8Bit().data());
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PoDoFo::PdfPage* curPage = &(doc.GetPages().GetPageAt(0));
++#else
+ 		PoDoFo::PdfPage *curPage = doc.GetPage(0);
++#endif
+ 		if (curPage != nullptr)
+ 		{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++			PoDoFo::PdfObject* pageObj = &(curPage->GetObject());
++#else
+ 			PoDoFo::PdfObject* pageObj = curPage->GetObject();
++#endif
+ 			PoDoFo::PdfDictionary* pageDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+ 			PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
+ 			if (piece != nullptr)
+@@ -618,6 +629,33 @@ bool AIPlug::extractFromPDF(const QStrin
+ 					}
+ 					if (data != nullptr)
+ 					{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++						if (num == 2)
++						{
++							Key = name.arg(1);
++							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							PoDoFo::PdfObjectStream const* stream = data->GetStream();
++							PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++							qint64 bLen = strBuffer.size();
++							const char* Buffer = strBuffer.c_str();
++							outf.write(Buffer, bLen);
++						}
++						else
++						{
++							for (int a = 2; a < num; a++)
++							{
++								Key = name.arg(a);
++								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++								if (data == nullptr)
++									break;
++								PoDoFo::PdfObjectStream const* stream = data->GetStream();
++								PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++								qint64 bLen = strBuffer.size();
++								const char* Buffer = strBuffer.c_str();
++								outf.write(Buffer, bLen);
++							}
++						}
++#else
+ 						if (num == 2)
+ 						{
+ 							Key = name.arg(1);
+@@ -649,6 +687,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 								free( Buffer );
+ 							}
+ 						}
++#endif
+ 					}
+ 					ret = true;
+ 				}
diff --git a/srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch b/srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch
new file mode 100644
index 0000000000000..750d8fa0a9440
--- /dev/null
+++ b/srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch
@@ -0,0 +1,853 @@
+From 000d73d22b362a010bd4c80e6076343bc62119f3 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 16 Aug 2023 20:54:40 +0000
+Subject: [PATCH 10/13] #17005: Restore compatibility with podofo <= 0.9.6
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25604 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 6ca4984f122b46a6ab03300efab6b858b5c77a2d)
+---
+ scribus/pdf_analyzer.cpp               | 274 +++++++++++++++++++++----
+ scribus/pdflib_core.cpp                |  80 ++++----
+ scribus/plugins/import/ai/importai.cpp | 134 +++++++-----
+ 3 files changed, 350 insertions(+), 138 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -30,10 +30,6 @@ for which a new license (GPL+exception)
+ #ifdef HAVE_PODOFO
+ using namespace PoDoFo;
+ 
+-#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+-#define IsRealStrict IsReal
+-#endif
+-
+ static QHash<QString, PDFContentStreamKeyword> kwNameMap;
+ 
+ // we gonna need a map from string values to the defined enum of pdf keywords
+@@ -184,6 +180,7 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ 
+ bool PDFAnalyzer::inspectCanvas(PdfCanvas* canvas, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
+ 	PdfDictionary* colorSpacesDict { nullptr };
+ 	PdfDictionary* xObjectsDict { nullptr };
+@@ -198,21 +195,12 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		// get hold of a PdfObject pointer of this canvas
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PdfObject* canvasObject = page ? &(page->GetObject()) : &(dynamic_cast<PdfXObject*>(canvas)->GetObject());
+-
+-#else
+-		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
+-#endif
+ 		PdfDictionary* canvasDict = (canvasObject && canvasObject->IsDictionary()) ? &(canvasObject->GetDictionary()) : nullptr;
+ 
+ 		// find a resource with ColorSpace entry
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PdfResources* canvasRsrc = canvas->GetResources();
+ 		PdfObject* resources = &(canvasRsrc->GetObject());
+-#else
+-		PdfObject* resources = canvas->GetResources();
+-#endif
+ 		for (PdfDictionary* par = canvasDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+ 			resources = par->FindKey("Resources");
+@@ -262,26 +250,24 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 
+ 	try
+ 	{
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 		// start parsing the content stream
+ 		PdfContentReaderArgs tokenizerArgs = { PdfContentReaderFlags::DontFollowXObjectForms };
+ 		PdfContentStreamReader tokenizer(*canvas, tokenizerArgs);
+ 		PdfContent pdfContent;
+ 		PdfVariant var;
+-		bool readToken;
+ 
+ 		int tokenNumber = 0;
+ 		bool inlineImgDict = false;
+ 		QList<PdfVariant> args;
+ 		QStack<PDFGraphicState> gsStack;
+ 		PDFGraphicState currGS;
+-		while ((readToken = tokenizer.TryReadNext(pdfContent)))
++		while (tokenizer.TryReadNext(pdfContent))
+ 		{
+ 			++tokenNumber;
+ 			if (pdfContent.Type == PdfContentType::Operator)
+ 			{
+ 				args.clear();
+-				int stackSize = pdfContent.Stack.size();
++				size_t stackSize = pdfContent.Stack.size();
+ 				for (size_t i = 0; i < stackSize; ++i)
+ 					args.append(pdfContent.Stack[stackSize - 1 - i]);
+ 				switch (pdfContent.Operator)
+@@ -669,7 +655,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 			if (pdfContent.Type == PdfContentType::DoXObject)
+ 			{
+ 				args.clear();
+-				int stackSize = pdfContent.Stack.size();
++				size_t stackSize = pdfContent.Stack.size();
+ 				for (size_t i = 0; i < stackSize; ++i)
+ 					args.append(pdfContent.Stack[stackSize - 1 - i]);
+ 				if (!processedNamedXObj.contains(args[0].GetName()))
+@@ -723,7 +709,73 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 				}
+ 			}
+ 		}
++	}
++	catch (PdfError & e)
++	{
++		qDebug() << "Error in parsing content stream File:" << m_filename;
++		e.PrintErrorMsg();
++		return false;
++	}
++	return true;
+ #else
++	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
++	PdfObject* colorSpaceRes { nullptr };
++	PdfObject* xObjects { nullptr };
++	PdfObject* transGroup { nullptr };
++	PdfObject* extGState { nullptr };
++	PdfObject* fontRes { nullptr };
++	QMap<PdfName, PDFColorSpace> processedNamedCS;
++	QMap<PdfName, PDFFont> processedNamedFont;
++	QList<PdfName> processedNamedXObj;
++	QList<PdfName> processedNamedGS;
++	try
++	{
++		// get hold of a PdfObject pointer of this canvas
++		// needed for the finding resources code below to work
++		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
++		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++
++		// find a resource with ColorSpace entry
++		PdfObject* resources = canvas->GetResources();
++		for (PdfObject* par = canvasObject; par && !resources; par = par->GetIndirectKey("Parent"))
++		{
++			resources = par->GetIndirectKey("Resources");
++		}
++		colorSpaceRes = resources ? resources->GetIndirectKey("ColorSpace") : nullptr;
++		xObjects = resources ? resources->GetIndirectKey("XObject") : nullptr;
++		extGState = resources ? resources->GetIndirectKey("ExtGState") : nullptr;
++		fontRes = resources ? resources->GetIndirectKey("Font") : nullptr;
++
++		// getting the transparency group of this content stream (if available)
++		transGroup = canvasObject ? canvasObject->GetIndirectKey("Group") : nullptr;
++		if (transGroup)
++		{
++			PdfObject* subtype = transGroup->GetIndirectKey("S");
++			if (subtype && subtype->GetName() == "Transparency")
++			{
++				// having transparency group means there's transparency in the PDF
++				hasTransparency = true;
++
++				// reporting the color space used in transparency group (Section 7.5.5, PDF 1.6 Spec)
++				PdfObject* cs = transGroup->GetIndirectKey("CS");
++				if (cs)
++				{
++					PDFColorSpace retval = getCSType(cs);
++					if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++						usedColorSpaces.append(retval);
++				}
++			}
++		}
++	}
++	catch (PdfError & e)
++	{
++		qDebug() << "Error in analyzing stream's resources. File:" << m_filename;
++		e.PrintErrorMsg();
++		return false;
++	}
++
++	try
++	{
+ 		// start parsing the content stream
+ 		PdfContentsTokenizer tokenizer(canvas);
+ 		EPdfContentsType t;
+@@ -880,9 +932,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -949,9 +1001,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -1003,29 +1055,28 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedXObj.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && xObjectsDict)
++						if (args.size() == 1 && args[0].IsName() && xObjects)
+ 						{
+-							PdfObject* xObject = xObjectsDict->FindKey(args[0].GetName());
+-							PdfDictionary* xObjectDict = (xObject && xObject->IsDictionary()) ? &(xObject->GetDictionary()) : nullptr;
+-							PdfObject* subtypeObject = xObjectDict ? xObjectDict->FindKey("Subtype") : nullptr;
++							PdfObject* xObject = xObjects->GetIndirectKey(args[0].GetName());
++							PdfObject* subtypeObject = xObject ? xObject->GetIndirectKey("Subtype") : nullptr;
+ 							if (subtypeObject && subtypeObject->IsName())
+ 							{
+ 								if (subtypeObject->GetName() == "Image")
+ 								{
+-									PdfObject* imgColorSpace = xObjectDict->FindKey("ColorSpace");
++									PdfObject* imgColorSpace = xObject->GetIndirectKey("ColorSpace");
+ 									if (imgColorSpace)
+ 									{
+ 										PDFColorSpace retval = getCSType(imgColorSpace);
+ 										if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 											usedColorSpaces.append(retval);
+ 									}
+-									PdfObject* sMaskObj = xObjectDict->FindKey("SMask");
++									PdfObject* sMaskObj = xObject->GetIndirectKey("SMask");
+ 									if (sMaskObj)
+ 										hasTransparency = true;
+ 									PDFImage img;
+ 									img.imgName = args[0].GetName().GetEscapedName().c_str();
+-									double width = xObjectDict->FindKey("Width")->GetReal();
+-									double height = xObjectDict->FindKey("Height")->GetReal();
++									double width = xObject->GetIndirectKey("Width")->GetReal();
++									double height = xObject->GetIndirectKey("Height")->GetReal();
+ 									img.dpiX = qRound(width/(currGS.ctm.m11()/72));
+ 									img.dpiY = qRound(height/(currGS.ctm.m22()/72));
+ 									imgs.append(img);
+@@ -1074,9 +1125,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 									usedColorSpaces.append(CS_DeviceCMYK);
+ 								else if (!processedNamedCS.contains(csName))
+ 								{
+-									if (colorSpacesDict && colorSpacesDict->FindKey(csName))
++									if (colorSpaceRes && colorSpaceRes->GetIndirectKey(csName))
+ 									{
+-										PdfObject* csEntry = colorSpacesDict->FindKey(csName);
++										PdfObject* csEntry = colorSpaceRes->GetIndirectKey(csName);
+ 										if (csEntry)
+ 										{
+ 											PDFColorSpace retval = getCSType(csEntry);
+@@ -1116,9 +1167,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedGS.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && extGStatesDict)
++						if (args.size() == 1 && args[0].IsName() && extGState)
+ 						{
+-							PdfObject* extGStateObj = extGStatesDict->FindKey(args[0].GetName());
++							PdfObject* extGStateObj = extGState->GetIndirectKey(args[0].GetName());
+ 							if (extGStateObj)
+ 							{
+ 								inspectExtGStateObj(extGStateObj, usedColorSpaces, hasTransparency, usedFonts, currGS);
+@@ -1147,9 +1198,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					}
+ 					else
+ 					{
+-						if (args.size() == 2 && args[0].IsName() && fontsDict)
++						if (args.size() == 2 && args[0].IsName() && fontRes)
+ 						{
+-							PdfObject* fontObj = fontsDict->FindKey(args[0].GetName());
++							PdfObject* fontObj = fontRes->GetIndirectKey(args[0].GetName());
+ 							if (fontObj)
+ 							{
+ 								PDFFont retval = getFontInfo(fontObj);
+@@ -1179,7 +1230,6 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 				args.clear();
+ 			}
+ 		}
+-#endif
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -1188,10 +1238,12 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		return false;
+ 	}
+ 	return true;
++#endif
+ }
+ 
+ void PDFAnalyzer::inspectExtGStateObj(PdfObject* extGStateObj, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, PDFGraphicState & currGS)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	PdfDictionary* extGStateDict = extGStateObj->IsDictionary() ? &(extGStateObj->GetDictionary()) : nullptr;
+ 	PdfObject* bmObj = extGStateDict ? extGStateDict->FindKey("BM") : nullptr;
+ 	if (bmObj && bmObj->IsName())
+@@ -1245,7 +1297,6 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 				currGS.font.first = font;
+ 				currGS.font.second = arr[1].GetReal();
+ 			}
+-
+ 		}
+ 	}
+ 
+@@ -1276,9 +1327,96 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		PdfObject dObjB = dObj->GetArray()[1];
+ 		currGS.dashPattern.second = dObjB.GetNumber();
+ 	}
++#else
++	PdfObject* bmObj = extGStateObj->GetIndirectKey("BM");
++	if (bmObj && bmObj->IsName())
++	{
++		currGS.blendModes.clear();
++		currGS.blendModes.append(bmObj->GetName().GetEscapedName().c_str());
++		if (!(bmObj->GetName() == "Normal" || bmObj->GetName() == "Compatible"))
++			hasTransparency = true;
++	}
++	else if (bmObj && bmObj->IsArray())
++	{
++		PdfArray arr = bmObj->GetArray();
++		currGS.blendModes.clear();
++		for (uint i = 0; i < arr.GetSize(); ++i)
++			currGS.blendModes.append(arr[i].GetName().GetEscapedName().c_str());
++		if (arr[0].IsName() && !(arr[0].GetName() == "Normal" || arr[0].GetName() == "Compatible"))
++			hasTransparency = true;
++	}
++
++	PdfObject* caObj = extGStateObj->GetIndirectKey("ca");
++	if (caObj && (caObj->IsReal() || caObj->IsNumber()))
++	{
++		currGS.fillAlphaConstant = caObj->GetReal();
++		if (caObj->GetReal() < 1)
++			hasTransparency = true;
++	}
++
++	PdfObject* cAObj = extGStateObj->GetIndirectKey("CA");
++	if (cAObj && (cAObj->IsReal() || cAObj->IsNumber()))
++	{
++		if (cAObj->GetReal() < 1)
++			hasTransparency = true;
++	}
++
++	PdfObject* sMaskObj = extGStateObj->GetIndirectKey("SMask");
++	if (sMaskObj && !(sMaskObj->IsName() && sMaskObj->GetName() == "None"))
++		hasTransparency = true;
++
++	PdfObject* fontObj = extGStateObj->GetIndirectKey("Font");
++	if (fontObj && fontObj->IsArray())
++	{
++		PdfArray arr = fontObj->GetArray();
++		if (arr[0].IsReference())
++		{
++			PdfReference ref = arr[0].GetReference();
++			PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
++			if (fontObject)
++			{
++				PDFFont font = getFontInfo(fontObject);
++				usedFonts.append(font);
++				currGS.font.first = font;
++				currGS.font.second = arr[1].GetReal();
++			}
++
++		}
++	}
++
++	PdfObject* lwObj = extGStateObj->GetIndirectKey("LW");
++	if (lwObj)
++		currGS.lineWidth = lwObj->GetReal();
++
++	PdfObject* lcObj = extGStateObj->GetIndirectKey("LC");
++	if (lcObj)
++		currGS.lineCap = lcObj->GetNumber();
++
++	PdfObject* ljObj = extGStateObj->GetIndirectKey("LJ");
++	if (ljObj)
++		currGS.lineJoin = ljObj->GetNumber();
++
++	PdfObject* mlObj = extGStateObj->GetIndirectKey("ML");
++	if (mlObj)
++		currGS.miterLimit = mlObj->GetReal();
++
++	PdfObject* dObj = extGStateObj->GetIndirectKey("D");
++	if (dObj)
++	{
++		PdfObject dObjA = dObj->GetArray()[0];
++		PdfArray dashArr = dObjA.GetArray();
++		currGS.dashPattern.first.clear();
++		for (uint i = 0; i < dashArr.GetSize(); ++i)
++			currGS.dashPattern.first.append(dashArr[i].GetNumber());
++		PdfObject dObjB = dObj->GetArray()[1];
++		currGS.dashPattern.second = dObjB.GetNumber();
++	}
++#endif
+ }
++
+ PDFFont PDFAnalyzer::getFontInfo(PdfObject* fontObj)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	PDFFont currFont;
+ 	const PdfDictionary* fontDict = fontObj->IsDictionary() ? &(fontObj->GetDictionary()) : nullptr;
+ 	if (!fontDict)
+@@ -1307,11 +1445,7 @@ PDFFont PDFAnalyzer::getFontInfo(PdfObje
+ 		if (descendantFonts && descendantFonts->IsArray())
+ 		{
+ 			const PdfReference& refDescFont = descendantFonts->GetArray()[0].GetReference();
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 			PdfObject* descendantFont = descendantFonts->GetDocument()->GetObjects().GetObject(refDescFont);
+-#else
+-			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
+-#endif
+ 			PdfDictionary* descendantFontDict = (descendantFont && descendantFont->IsDictionary()) ? &(descendantFont->GetDictionary()) : nullptr;
+ 			const PdfObject* subtypeDescFont = descendantFontDict->FindKey("Subtype");
+ 			fontDesc = &(descendantFontDict->MustGetKey("FontDescriptor"));
+@@ -1345,6 +1479,62 @@ PDFFont PDFAnalyzer::getFontInfo(PdfObje
+ 		}
+ 	}
+ 	return currFont;
++#else
++	PDFFont currFont;
++	PdfObject* subtype = fontObj->GetIndirectKey("Subtype");
++	if (!subtype || !subtype->IsName())
++		return currFont;
++
++	PdfObject* fontDesc = fontObj->GetIndirectKey("FontDescriptor");
++	if (subtype->GetName() == "Type1")
++		currFont.fontType = F_Type1;
++	else if (subtype->GetName() == "MMType1")
++		currFont.fontType = F_MMType1;
++	else if (subtype->GetName() == "TrueType")
++		currFont.fontType = F_TrueType;
++	else if (subtype->GetName() == "Type3")
++	{
++		currFont.fontType = F_Type3;
++		currFont.isEmbedded = true;
++		fontDesc = nullptr;
++	}
++	else if (subtype->GetName() == "Type0")
++	{
++		PdfObject* descendantFonts = fontObj->GetIndirectKey("DescendantFonts");
++		if (descendantFonts && descendantFonts->IsArray())
++		{
++			PdfReference refDescFont = descendantFonts->GetArray()[0].GetReference();
++			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
++			PdfObject* subtypeDescFont = descendantFont->GetIndirectKey("Subtype");
++			fontDesc = descendantFont->MustGetIndirectKey("FontDescriptor");
++			if (subtypeDescFont && subtypeDescFont->IsName())
++			{
++				if (subtypeDescFont->GetName() == "CIDFontType0")
++					currFont.fontType = F_CIDFontType0;
++				else if (subtypeDescFont->GetName() == "CIDFontType2")
++					currFont.fontType = F_CIDFontType2;
++			}
++		}
++	}
++	if (fontDesc)
++	{
++		PdfObject* fontFile = fontDesc->GetIndirectKey("FontFile");
++		PdfObject* fontFile2 = fontDesc->GetIndirectKey("FontFile2");
++		PdfObject* fontFile3 = fontDesc->GetIndirectKey("FontFile3");
++		if (fontFile && fontFile->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile2 && fontFile2->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile3 && fontFile3->HasStream())
++		{
++			currFont.isEmbedded = true;
++			PdfObject* ff3Subtype = fontFile3->GetIndirectKey("Subtype");
++			if (ff3Subtype && ff3Subtype->IsName() && ff3Subtype->GetName() == "OpenType")
++				currFont.isOpenType = true;
++		}
++	}
++	return currFont;
++#endif
+ }
+ #else
+ PDFAnalyzer::PDFAnalyzer(QString & filename) : QObject()
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9826,7 +9826,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page.GetRotationRaw();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9845,11 +9845,11 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx()) + " "
++								 + Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+ 			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
+@@ -9947,7 +9947,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page.GetRotationRaw();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9966,11 +9966,11 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx()) + " "
++								 + Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+ 			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
+@@ -10072,20 +10072,16 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ #else
+ 	try
+ 	{
+-		PoDoFo::PdfPage* page = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
+-		PoDoFo::PdfObject* pageObj = page ? page->GetObject() : nullptr;
+-		PoDoFo::PdfObject* contents = page ? page->GetContents() : nullptr;
++		PoDoFo::PdfPage*   page      = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
++		PoDoFo::PdfObject* pageObj   = page ? page->GetObject() : nullptr;
++		PoDoFo::PdfObject* contents  = page ? page->GetContents() : nullptr;
+ 		PoDoFo::PdfObject* resources = page ? page->GetResources() : nullptr;
+-		PoDoFo::PdfDictionary* pageObjDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+-		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
++		for (PoDoFo::PdfObject* par = pageObj; par && !resources; par = par->GetIndirectKey("Parent"))
+ 		{
+-			resources = par->FindKey("Resources");
+-			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
+-			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
++			resources = par->GetIndirectKey("Resources");
+ 		}
+-		if (contents && contents->GetDataType() == PoDoFo::ePdfDataType_Dictionary)
++		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Dictionary)
+ 		{
+-			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
+ 			PoDoFo::PdfStream* stream = contents->GetStream();
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+@@ -10098,7 +10094,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -10117,22 +10113,21 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx())  + " "
++								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+-			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			nextObj = page->GetObject()->GetIndirectKey("Group");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+ 			/*
+-			PoDoFo::PdfObject parents = pageDict->FindKey("StructParents");
++			PoDoFo::PdfObject parents = page->GetObject()->GetIndirectKey("StructParents");
+ 			if (parents)
+ 			{
+ 				xParents = writer.newObject();
+@@ -10151,13 +10146,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			if (mbuffer[mlen - 1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+-			nextObj = contentsDict.FindKey("Filter");
++			nextObj = contents->GetIndirectKey("Filter");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Filter ");
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+-			nextObj = contentsDict.FindKey("DecodeParms");
++			nextObj = contents->GetIndirectKey("DecodeParms");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/DecodeParms ");
+@@ -10168,7 +10163,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 				EncodeArrayToStream(buffer, xObj);
+ 			}  // disconnect QByteArray from raw data
+-			free(mbuffer);
++			free (mbuffer);
+ 			PutDoc("\nendstream");
+ 			writer.endObj(xObj);
+ 			// write resources
+@@ -10223,7 +10218,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -10242,15 +10237,14 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx())  + " "
++								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+-			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			nextObj = page->GetObject()->GetIndirectKey("Group");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+@@ -10326,7 +10320,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			imgInfo.ResNum = ResCount;
+ 			ResCount++;
+ 			// Avoid a divide-by-zero if width/height are less than 1 point:
+-			imgInfo.Width = qMax(1, (int) imgWidth);
++			imgInfo.Width  = qMax(1, (int) imgWidth);
+ 			imgInfo.Height = qMax(1, (int) imgHeight);
+ 			imgInfo.xa = sx * imgWidth / imgInfo.Width;
+ 			imgInfo.ya = sy * imgHeight / imgInfo.Height;
+--- a/scribus/plugins/import/ai/importai.cpp
++++ b/scribus/plugins/import/ai/importai.cpp
+@@ -579,87 +579,115 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		qDebug() << "Failed to open QFile outf in AIPlug::extractFromPDF";
+ 		return false;
+ 	}
++
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	try
+ 	{
+-#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+-		PoDoFo::PdfError::EnableDebug( false );
+-		PoDoFo::PdfError::EnableLogging( false );
+-#endif
+ 		PoDoFo::PdfMemDocument doc;
+ 		doc.Load(infile.toLocal8Bit().data());
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+-		PoDoFo::PdfPage* curPage = &(doc.GetPages().GetPageAt(0));
++
++		PoDoFo::PdfPage& curPage = doc.GetPages().GetPageAt(0);
++		PoDoFo::PdfObject& pageObj = curPage.GetObject();
++		PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++		PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
++		if (piece != nullptr)
++		{
++			PoDoFo::PdfDictionary* pieceDict = piece->IsDictionary() ? &(piece->GetDictionary()) : nullptr;
++			PoDoFo::PdfObject *illy = pieceDict ? pieceDict->FindKey("Illustrator") : nullptr;
++			if (illy != nullptr)
++			{
++				PoDoFo::PdfDictionary* illyDict = illy->IsDictionary() ? &(illy->GetDictionary()) : nullptr;
++				PoDoFo::PdfObject *priv = illyDict ? illyDict->FindKey("Private") : nullptr;
++				if (priv == nullptr)
++					priv = illy;
++				int num = 0;
++				PoDoFo::PdfDictionary* privDict = priv->IsDictionary() ? &(priv->GetDictionary()) : nullptr;
++				PoDoFo::PdfObject *numBl = privDict ? privDict->FindKey("NumBlock") : nullptr;
++				if (numBl != nullptr)
++					num = numBl->GetNumber() + 1;
++				if (num == 0)
++					num = 99999;
++				QString name = "AIPrivateData%1";
++				QString Key = name.arg(1);
++				PoDoFo::PdfObject *data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++				if (data == nullptr)
++				{
++					name = "AIPDFPrivateData%1";
++					Key = name.arg(1);
++					data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++				}
++				if (data != nullptr)
++				{
++					if (num == 2)
++					{
++						Key = name.arg(1);
++						data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++						PoDoFo::PdfObjectStream const* stream = data->GetStream();
++						PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++						qint64 bLen = strBuffer.size();
++						const char* Buffer = strBuffer.c_str();
++						outf.write(Buffer, bLen);
++					}
++					else
++					{
++						for (int a = 2; a < num; a++)
++						{
++							Key = name.arg(a);
++							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							if (data == nullptr)
++								break;
++							PoDoFo::PdfObjectStream const* stream = data->GetStream();
++							PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++							qint64 bLen = strBuffer.size();
++							const char* Buffer = strBuffer.c_str();
++							outf.write(Buffer, bLen);
++						}
++					}
++				}
++				ret = true;
++			}
++		}
++		outf.close();
++	}
+ #else
++	try
++	{
++		PoDoFo::PdfError::EnableDebug( false );
++		PoDoFo::PdfError::EnableLogging( false );
++		PoDoFo::PdfMemDocument doc( infile.toLocal8Bit().data() );
+ 		PoDoFo::PdfPage *curPage = doc.GetPage(0);
+-#endif
+ 		if (curPage != nullptr)
+ 		{
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+-			PoDoFo::PdfObject* pageObj = &(curPage->GetObject());
+-#else
+-			PoDoFo::PdfObject* pageObj = curPage->GetObject();
+-#endif
+-			PoDoFo::PdfDictionary* pageDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+-			PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
++			PoDoFo::PdfObject *piece = curPage->GetObject()->GetIndirectKey("PieceInfo");
+ 			if (piece != nullptr)
+ 			{
+-				PoDoFo::PdfDictionary* pieceDict = piece->IsDictionary() ? &(piece->GetDictionary()) : nullptr;
+-				PoDoFo::PdfObject *illy = pieceDict ? pieceDict->FindKey("Illustrator") : nullptr;
++				PoDoFo::PdfObject *illy = piece->GetIndirectKey("Illustrator");
+ 				if (illy != nullptr)
+ 				{
+-					PoDoFo::PdfDictionary* illyDict = illy->IsDictionary() ? &(illy->GetDictionary()) : nullptr;
+-					PoDoFo::PdfObject *priv = illyDict ? illyDict->FindKey("Private") : nullptr;
++					PoDoFo::PdfObject *priv = illy->GetIndirectKey("Private");
+ 					if (priv == nullptr)
+ 						priv = illy;
+ 					int num = 0;
+-					PoDoFo::PdfDictionary* privDict = priv->IsDictionary() ? &(priv->GetDictionary()) : nullptr;
+-					PoDoFo::PdfObject *numBl = privDict ? privDict->FindKey("NumBlock") : nullptr;
++					PoDoFo::PdfObject *numBl = priv->GetIndirectKey("NumBlock");
+ 					if (numBl != nullptr)
+ 						num = numBl->GetNumber() + 1;
+ 					if (num == 0)
+ 						num = 99999;
+ 					QString name = "AIPrivateData%1";
+ 					QString Key = name.arg(1);
+-					PoDoFo::PdfObject *data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++					PoDoFo::PdfObject *data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 					if (data == nullptr)
+ 					{
+ 						name = "AIPDFPrivateData%1";
+ 						Key = name.arg(1);
+-						data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++						data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 					}
+ 					if (data != nullptr)
+ 					{
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 						if (num == 2)
+ 						{
+ 							Key = name.arg(1);
+-							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+-							PoDoFo::PdfObjectStream const* stream = data->GetStream();
+-							PoDoFo::charbuff strBuffer = stream->GetCopy(false);
+-							qint64 bLen = strBuffer.size();
+-							const char* Buffer = strBuffer.c_str();
+-							outf.write(Buffer, bLen);
+-						}
+-						else
+-						{
+-							for (int a = 2; a < num; a++)
+-							{
+-								Key = name.arg(a);
+-								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+-								if (data == nullptr)
+-									break;
+-								PoDoFo::PdfObjectStream const* stream = data->GetStream();
+-								PoDoFo::charbuff strBuffer = stream->GetCopy(false);
+-								qint64 bLen = strBuffer.size();
+-								const char* Buffer = strBuffer.c_str();
+-								outf.write(Buffer, bLen);
+-							}
+-						}
+-#else
+-						if (num == 2)
+-						{
+-							Key = name.arg(1);
+-							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 							PoDoFo::PdfStream const *stream = data->GetStream();
+ 							PoDoFo::PdfMemoryOutputStream oStream(1);
+ 							stream->GetFilteredCopy(&oStream);
+@@ -674,7 +702,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 							for (int a = 2; a < num; a++)
+ 							{
+ 								Key = name.arg(a);
+-								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++								data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 								if (data == nullptr)
+ 									break;
+ 								PoDoFo::PdfStream const *stream = data->GetStream();
+@@ -687,7 +715,6 @@ bool AIPlug::extractFromPDF(const QStrin
+ 								free( Buffer );
+ 							}
+ 						}
+-#endif
+ 					}
+ 					ret = true;
+ 				}
+@@ -695,6 +722,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		}
+ 		outf.close();
+ 	}
++#endif // (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	catch (PoDoFo::PdfError& e)
+ 	{
+ 		outf.close();
+@@ -704,7 +732,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		QFile::remove(outfile);
+ 		return false;
+ 	}
+-#endif
++#endif // HAVE_PODOFO
+ 	return ret;
+ }
+ 
diff --git a/srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch b/srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch
new file mode 100644
index 0000000000000..c01558c04f98d
--- /dev/null
+++ b/srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch
@@ -0,0 +1,22 @@
+From 148fc05557975267b05ebe670822793999ea3e0a Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 5 Jun 2023 21:15:35 +0000
+Subject: [PATCH 11/13] Fix typo
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25504 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit bd2ba29c16218bc715cde93109e6c0b9be48e4be)
+---
+ CMakeLists_Dependencies.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/CMakeLists_Dependencies.cmake
++++ b/CMakeLists_Dependencies.cmake
+@@ -8,7 +8,7 @@ if (WITH_PODOFO)
+ 	if (LIBPODOFO_FOUND)
+ 		message("PoDoFo found OK")
+ 		set(HAVE_PODOFO ON)
+-		if(LIBPODOFO_VERSION VERSION_GREATER "0.10.0")
++		if(LIBPODOFO_VERSION VERSION_GREATER_EQUAL "0.10.0")
+ 			message(STATUS "PoDoFo Version:" ${LIBPODOFO_VERSION})
+ 			if (CMAKE_CXX_STANDARD LESS 17)
+ 				message(STATUS "C++17 is the minimum C++ standard since podofo 0.10.0")
diff --git a/srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch b/srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch
new file mode 100644
index 0000000000000..2d51a8ef9b793
--- /dev/null
+++ b/srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch
@@ -0,0 +1,107 @@
+From 6ae729e1b45f92428168475c316f3b45a8e99d74 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 4 Sep 2023 21:58:38 +0000
+Subject: [PATCH 12/13] Adapt CMake FindLIBPODOFO.cmake to use pkgconfig, and
+ allow custom find path. Still testing.
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25625 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 628a630d7c45d942605ac227c530f9c889395832)
+---
+ cmake/modules/FindLIBPODOFO.cmake        | 48 +++++++++++++++++-------
+ scribus/plugins/import/ai/CMakeLists.txt | 13 +++----
+ 2 files changed, 41 insertions(+), 20 deletions(-)
+
+--- a/cmake/modules/FindLIBPODOFO.cmake
++++ b/cmake/modules/FindLIBPODOFO.cmake
+@@ -12,23 +12,45 @@ if(WIN32)
+ 	endif(NOT DEFINED LIBPODOFO_SHARED)
+ endif(WIN32)
+ 
+-find_path(LIBPODOFO_INCLUDE_DIR
+-	NAMES podofo/podofo.h
+-	PATHS
+-	"${LIBPODOFO_DIR}/include"
+-	"${LIBPODOFO_DIR}/src"
+-	"${LIBPODOFO_DIR}"
++set(LIBPODOFO_FIND_QUIETLY OFF)
++
++find_package(PkgConfig QUIET)
++if(DEFINED LIBPODOFO_DIR_CUSTOM)
++	set(ENV{PKG_CONFIG_PATH} "${LIBPODOFO_DIR_CUSTOM}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
++endif()
++pkg_search_module(libpodofo REQUIRED libpodofo podofo)
++
++if (DEFINED LIBPODOFO_DIR_CUSTOM)
++	find_path(LIBPODOFO_INCLUDE_DIR
++		NAMES podofo/podofo.h
++		PATHS
++		"${LIBPODOFO_DIR_CUSTOM}/include"
++		"${LIBPODOFO_DIR_CUSTOM}"
++		PATH_SUFFIXES podofo
++		NO_DEFAULT_PATH
+ 	)
+ 
+-set(LIBPODOFO_FIND_QUIETLY ON)
++	find_library(LIBPODOFO_LIBRARY
++		NAMES libpodofo podofo
++		PATHS
++		"${LIBPODOFO_DIR_CUSTOM}/lib"
++		"${LIBPODOFO_DIR_CUSTOM}"
++		NO_DEFAULT_PATH
++	)
++else()
++	find_path(LIBPODOFO_INCLUDE_DIR
++		NAMES podofo/podofo.h
++		PATHS
++		${libpodofo_INCLUDE_DIRS}
++	)
+ 
+-find_library(LIBPODOFO_LIBRARY
+-	NAMES libpodofo podofo
+-	PATHS
+-	"${LIBPODOFO_DIR}/lib"
+-	"${LIBPODOFO_DIR}/src"
+-	"${LIBPODOFO_DIR}"
++	find_library(LIBPODOFO_LIBRARY
++		NAMES libpodofo podofo
++		PATHS
++		${libpodofo_LIBRARY_DIRS}
+ 	)
++endif()
++
+ 
+ if(LIBPODOFO_INCLUDE_DIR AND LIBPODOFO_LIBRARY)
+ 	if(NOT LIBPODOFO_CONFIG_H)
+--- a/scribus/plugins/import/ai/CMakeLists.txt
++++ b/scribus/plugins/import/ai/CMakeLists.txt
+@@ -1,14 +1,15 @@
+ include_directories(
+ 	${CMAKE_SOURCE_DIR}
+ 	${CMAKE_SOURCE_DIR}/scribus
+-	${PODOFO_INCLUDES}
++	${LIBPODOFO_INCLUDE_DIR}
+ 	${SCRIBUS_AUTOGEN_INCLUDE_PATH}
+ )
+ 
+ if(HAVE_PODOFO)
+-	include_directories(
+-		${LIBPODOFO_INCLUDE_DIR}
+-	)
++	if(OPENSSL_FOUND)
++		include_directories(${OPENSSL_INCLUDE_DIR})
++	endif()
++	include_directories(BEFORE ${LIBPODOFO_INCLUDE_DIR})
+ endif()
+ 
+ set(IMPORTAI_PLUGIN_SOURCES
+@@ -32,9 +33,7 @@ else()
+ endif()
+ 
+ if(HAVE_PODOFO)
+-	target_link_libraries(${SCRIBUS_IMPORTAI_PLUGIN}
+-		${LIBPODOFO_LIBRARY}
+-	)
++	target_link_libraries(${SCRIBUS_IMPORTAI_PLUGIN} ${LIBPODOFO_LIBRARY})
+ endif()
+ 
+ if(WANT_PCH)
diff --git a/srcpkgs/scribus/patches/cmake-buildtype-none.patch b/srcpkgs/scribus/patches/cmake-buildtype-none.patch
index ea1df49410ed6..95a3da339b29b 100644
--- a/srcpkgs/scribus/patches/cmake-buildtype-none.patch
+++ b/srcpkgs/scribus/patches/cmake-buildtype-none.patch
@@ -1,5 +1,3 @@
-Index: CMakeLists.txt
-===================================================================
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -75,11 +75,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -14,7 +12,7 @@ Index: CMakeLists.txt
  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
  set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
  set(CMAKE_SKIP_BUILD_RPATH TRUE)
-@@ -330,15 +325,6 @@ include (CMakeLists_Directories.cmake)
+@@ -344,15 +339,6 @@ include (CMakeLists_Directories.cmake)
  
  #Convert our simpler command line option to the CMake style
  #None, Debug, Release, .. or custom ones
@@ -27,3 +25,6 @@ Index: CMakeLists.txt
 -if(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
 -	set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Set Release Build Type" FORCE)
 -endif()
+ 
+ set(CMAKE_ENABLE_EXPORTS ON)
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 3138a842546af..a43acf7ccd761 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,7 +1,7 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=12
+revision=13
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
  -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
@@ -9,7 +9,7 @@ hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel
  hunspell-devel poppler-cpp-devel python3-devel harfbuzz-devel
- libgraphicsmagick-devel libpodofo0.9.7-devel libpagemaker-devel libqxp-devel
+ libgraphicsmagick-devel libpodofo-devel libpagemaker-devel libqxp-devel
  libmspub-devel libcdr-devel libfreehand-devel libvisio-devel"
 depends="ghostscript"
 short_desc="Open Source DTP (Desktop Publishing) application"

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Poppler 23.12.0
  2023-09-17 21:02 [PR PATCH] Poppler 23.09.0 mhmdanas
                   ` (5 preceding siblings ...)
  2023-12-14 15:18 ` sgn
@ 2023-12-14 15:20 ` sgn
  2023-12-15 23:39 ` [PR PATCH] [Updated] " sgn
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: sgn @ 2023-12-14 15:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 195 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/46107#issuecomment-1856045781

Comment:
I will update libreoffice, so no revbump for libreoffice.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] Poppler 23.12.0
  2023-09-17 21:02 [PR PATCH] Poppler 23.09.0 mhmdanas
                   ` (6 preceding siblings ...)
  2023-12-14 15:20 ` sgn
@ 2023-12-15 23:39 ` sgn
  2023-12-15 23:40 ` sgn
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: sgn @ 2023-12-15 23:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1285 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/mhmdanas/void-packages poppler-23.09.0
https://github.com/void-linux/void-packages/pull/46107

Poppler 23.12.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES** (and built all revdeps successfully)

[ci skip]
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/46107.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-23.09.0-46107.patch --]
[-- Type: text/x-diff, Size: 181743 bytes --]

From 7ae6ba302921ab22b83e1b0505915cea96c754d8 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 1/7] poppler: update to 23.12.0.

---
 common/shlibs            |  2 +-
 srcpkgs/poppler/template | 13 ++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 66d0045a2898f..393b7436cefa2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -345,7 +345,7 @@ libMagickCore-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagickWand-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagick++-7.Q16HDRI.so.5 libmagick-7.0.11.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.130 libpoppler-23.08.0_1
+libpoppler.so.133 libpoppler-23.12.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 2be3e5ab35e47..456e5c2fecb22 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -1,18 +1,17 @@
 # Template file for 'poppler'
 #
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
-#
-# Revbump libreoffice on SO version bumps.
 pkgname=poppler
-version=23.08.0
+version=23.12.0
 revision=1
-_testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
+_testVersion=400f3ff05b2b1c0ae17797a0bd50e75e35c1f1b1
 create_wrksrc=yes
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DENABLE_QT5=OFF -DENABLE_QT6=OFF -DENABLE_UTILS=ON
+ -DENABLE_BOOST=$(vopt_if boost ON OFF)
  -DTESTDATADIR='${XBPS_BUILDDIR}/poppler-${version}/testdatadir'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
@@ -25,8 +24,8 @@ homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz
  https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
-checksum="4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
- ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
+checksum="beba398c9d37a9b6d02486496635e08f1df3d437cfe61dab2593f47c4d14cdbb
+ 0d850a1d06944671c991be6822b7146ade401b06aad560ff39b254a028074525"
 
 build_options="gir boost"
 build_options_default="gir boost"

From c0ee023c4391bbc9ab23dac69d468c1bb6c31401 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 2/7] poppler-qt5: update to 23.12.0.

---
 srcpkgs/poppler-qt5/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a48ed659920e..8dc1d149bf0c5 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,7 +4,7 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=23.08.0
+version=23.12.0
 revision=1
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
@@ -21,7 +21,7 @@ license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz"
-checksum=4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
+checksum=beba398c9d37a9b6d02486496635e08f1df3d437cfe61dab2593f47c4d14cdbb
 # fails to find a bunch of files
 make_check=no
 

From c462ba5a32b776ece5d171da9904d18e7f88335a Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 3/7] inkscape: revbump for poppler-23.12.0.

---
 srcpkgs/inkscape/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 916822078cd27..a23bf4e87e61c 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.3.2
-revision=1
+revision=2
 build_style=cmake
 make_check_target="check"
 hostmakedepends="automake gettext glib-devel intltool libgraphicsmagick-devel

From f86926d1720dffa9fe4748a035939796954a95ad Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 4/7] ipe: revbump for poppler-23.12.0.

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index 65b92385af994..06347934d9897 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.26
-revision=10
+revision=11
 _tools_commit=v7.2.24.1
 create_wrksrc=yes
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"

From d23bc455f92ef7a50832003c607c325818a91223 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 5/7] kitinerary: revbump for poppler-23.12.0.

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 31236a166ef2c..5575e4dfb57f5 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=23.08.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config
  qt5-host-tools qt5-qmake qt5-tools-devel"

From 16840fb2aa77af396f191e64b839acd9e6029e5c Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 6/7] pdf2djvu: revbump for poppler-23.12.0.

Close: #46107
---
 srcpkgs/pdf2djvu/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdf2djvu/template b/srcpkgs/pdf2djvu/template
index 5a6f3ddf4ed35..982ce2458751c 100644
--- a/srcpkgs/pdf2djvu/template
+++ b/srcpkgs/pdf2djvu/template
@@ -1,7 +1,7 @@
 # Template file for 'pdf2djvu'
 pkgname=pdf2djvu
 version=0.9.19
-revision=5
+revision=6
 build_style=gnu-configure
 hostmakedepends="pkg-config djvulibre gettext"
 makedepends="djvulibre-devel poppler-devel libgraphicsmagick-devel exiv2-devel libuuid-devel"

From f0f8aeecb8bada626b67b0163649d9ce9063ce6c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 14 Dec 2023 14:01:26 +0700
Subject: [PATCH 7/7] scribus: for poppler 23.12.0

---
 ...r-22.03.0-force-poppler-0.86-minimum.patch |  526 ++++++
 .../0002-poppler-22.03.0-memleak.patch        |   94 +
 .../0005-podofo-0.10-find-podofo.patch        |   37 +
 ...-swap-podofo-poppler-dep-check-order.patch |  109 ++
 .../0007-podofo-0.10-minimum-0.9.0.patch      |   22 +
 .../0008-podofo-0.10-drop-old-compat.patch    |   48 +
 ...dofo-0.10-avoid-confusion-with-m_doc.patch |   67 +
 .../0010-podofo-0.10-indentation-fix.patch    |   22 +
 .../patches/0011-podofo-0.10-code-style.patch |  141 ++
 .../0012-podofo-0.10-preparation.patch        |  514 ++++++
 ...013-podofo-0.10-compat-podofo-0.10.x.patch | 1602 +++++++++++++++++
 ...0014-podofo-0.10-compat-podofo-0.9.6.patch |  853 +++++++++
 .../patches/0015-podofo-0.10-cmake-fix.patch  |   22 +
 .../0016-podofo-0.10-use-pkgconfig.patch      |  107 ++
 .../patches/cmake-buildtype-none.patch        |    7 +-
 srcpkgs/scribus/template                      |    4 +-
 16 files changed, 4170 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch
 create mode 100644 srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch
 create mode 100644 srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch
 create mode 100644 srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch
 create mode 100644 srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch
 create mode 100644 srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch
 create mode 100644 srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch
 create mode 100644 srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch
 create mode 100644 srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch
 create mode 100644 srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch
 create mode 100644 srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch

diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch
new file mode 100644
index 0000000000000..f205f45dea3d5
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch
@@ -0,0 +1,526 @@
+From e013e8126d2100e8e56dea5b836ad43275429389 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:48:29 +0000
+Subject: [PATCH] Enforce poppler version >= 0.86.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24985 11d20701-8431-0410-a711-e3c959e3b870
+---
+ cmake/modules/Findpoppler.cmake          |   4 +-
+ scribus/plugins/import/pdf/importpdf.cpp |  65 ++-----------
+ scribus/plugins/import/pdf/slaoutput.cpp | 114 -----------------------
+ scribus/plugins/import/pdf/slaoutput.h   |   7 --
+ 4 files changed, 10 insertions(+), 180 deletions(-)
+
+--- a/cmake/modules/Findpoppler.cmake
++++ b/cmake/modules/Findpoppler.cmake
+@@ -1,8 +1,8 @@
+ #include(FindPkgConfig)
+ find_package(PkgConfig QUIET)
+-pkg_search_module(poppler libpoppler>=0.62.0 poppler>=0.62.0)
++pkg_search_module(poppler libpoppler>=0.86.0 poppler>=0.86.0)
+ if (poppler_FOUND)
+-	pkg_search_module(poppler_cpp REQUIRED libpoppler-cpp>=0.62.0 poppler-cpp>=0.62.0)
++	pkg_search_module(poppler_cpp REQUIRED libpoppler-cpp>=0.86.0 poppler-cpp>=0.86.0)
+ endif(poppler_FOUND)
+  
+ find_path(poppler_INCLUDE_DIR
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -75,20 +75,15 @@ PdfPlug::PdfPlug(ScribusDoc* doc, int fl
+ 
+ QImage PdfPlug::readThumbnail(const QString& fName)
+ {
+-	QString pdfFile = QDir::toNativeSeparators(fName);
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
+ 	globalParams.reset(new GlobalParams());
+-#else
+-	std::unique_ptr<GlobalParams> globalParamsPtr(new GlobalParams());
+-	globalParams = globalParamsPtr.get();
+-#endif
++	globalParams->setErrQuiet(gTrue);
+ 
+-#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
++	QString pdfFile = QDir::toNativeSeparators(fName);
++#if defined(Q_OS_WIN32)
+ 	auto fname = new GooString(pdfFile.toUtf8().data());
+ #else
+ 	auto fname = new GooString(QFile::encodeName(pdfFile).data());
+ #endif
+-	globalParams->setErrQuiet(gTrue);
+ 
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+ 	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
+@@ -333,19 +328,15 @@ bool PdfPlug::convert(const QString& fn)
+ 		qApp->processEvents();
+ 	}
+ 
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
+ 	globalParams.reset(new GlobalParams());
+-#else
+-	std::unique_ptr<GlobalParams> globalParamsPtr(new GlobalParams());
+-	globalParams = globalParamsPtr.get();
+-#endif
+-#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
++	globalParams->setErrQuiet(gTrue);
++
++#if defined(Q_OS_WIN32)
+ 	auto fname = new GooString(fn.toUtf8().data());
+ #else
+ 	auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
+-	globalParams->setErrQuiet(gTrue);
+-//	globalParams->setPrintCommands(gTrue);
++
+ 	QList<OptionalContentGroup*> ocgGroups;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+ 	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
+@@ -365,7 +356,7 @@ bool PdfPlug::convert(const QString& fn)
+ 			QString text = QInputDialog::getText(mw, tr("Open PDF-File"), tr("Password"), QLineEdit::Normal, "", &ok);
+ 			if (ok && !text.isEmpty())
+ 			{
+-#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
++#if defined(Q_OS_WIN32)
+ 				auto fname = new GooString(fn.toUtf8().data());
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+@@ -383,9 +374,6 @@ bool PdfPlug::convert(const QString& fn)
+ 			{
+ 				if (m_progressDialog)
+ 					m_progressDialog->close();
+-#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
+-				delete globalParams;
+-#endif
+ 				return false;
+ 			}
+ 			if (m_progressDialog)
+@@ -495,7 +483,6 @@ bool PdfPlug::convert(const QString& fn)
+ 							}
+ 							else
+ 							{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 69, 0)
+ 								const auto& ocgs = ocg->getOCGs ();
+ 								for (const auto& ocg : ocgs)
+ 								{
+@@ -507,25 +494,11 @@ bool PdfPlug::convert(const QString& fn)
+ 										ocgNames.append(ocgName);
+ 									}
+ 								}
+-#else
+-								GooList *ocgs = ocg->getOCGs ();
+-								for (int i = 0; i < ocgs->getLength (); ++i)
+-								{
+-									OptionalContentGroup *oc = (OptionalContentGroup *)ocgs->get(i);
+-									QString ocgName = UnicodeParsedString(oc->getName());
+-									if (!ocgNames.contains(ocgName))
+-									{
+-										ocgGroups.prepend(oc);
+-										ocgNames.append(ocgName);
+-									}
+-								}
+-#endif
+ 							}
+ 						}
+ 					}
+ 					else
+ 					{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 69, 0)
+ 						const auto& ocgs = ocg->getOCGs ();
+ 						for (const auto& ocg : ocgs)
+ 						{
+@@ -537,19 +510,6 @@ bool PdfPlug::convert(const QString& fn)
+ 								ocgNames.append(ocgName);
+ 							}
+ 						}
+-#else
+-						GooList *ocgs = ocg->getOCGs ();
+-						for (int i = 0; i < ocgs->getLength (); ++i)
+-						{
+-							OptionalContentGroup *oc = (OptionalContentGroup *)ocgs->get(i);
+-							QString ocgName = UnicodeParsedString(oc->getName());
+-							if (!ocgNames.contains(ocgName))
+-							{
+-								ocgGroups.prepend(oc);
+-								ocgNames.append(ocgName);
+-							}
+-						}
+-#endif
+ 					}
+ 				}
+ 
+@@ -788,13 +748,8 @@ bool PdfPlug::convert(const QString& fn)
+ 							names = catDict.dictLookup("OpenAction");
+ 							if (names.isDict())
+ 							{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 								std::unique_ptr<LinkAction> linkActionUPtr = LinkAction::parseAction(&names, pdfDoc->getCatalog()->getBaseURI());
+ 								LinkAction *linkAction = linkActionUPtr.get();
+-#else
+-								LinkAction *linkAction = nullptr;
+-								linkAction = LinkAction::parseAction(&names, pdfDoc->getCatalog()->getBaseURI());
+-#endif
+ 								if (linkAction && (linkAction->getKind() == actionJavaScript))
+ 								{
+ 									LinkJavaScript *jsa = (LinkJavaScript*) linkAction;
+@@ -862,11 +817,7 @@ bool PdfPlug::convert(const QString& fn)
+ 		}
+ 		pdfDoc.reset();
+ 	}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
+ 	globalParams.reset();
+-#else
+-	globalParams = nullptr;
+-#endif
+ 
+ //	qDebug() << "converting finished";
+ //	qDebug() << "Imported" << m_elements.count() << "Elements";
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -332,15 +332,9 @@ LinkAction* SlaOutputDev::SC_getAction(A
+ }
+ 
+ /* Replacement for the crippled Poppler function LinkAction* AnnotWidget::getAdditionalAction(AdditionalActionsType type) */
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *ano)
+ {
+ 	std::unique_ptr<LinkAction> linkAction;
+-#else
+-LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *ano)
+-{
+-	LinkAction *linkAction = nullptr;
+-#endif
+ 	Object obj;
+ 	Ref refa = ano->getRef();
+ 
+@@ -467,11 +461,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 				if (dst->isPageRef())
+ 				{
+ 					Ref dstr = dst->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 					pagNum = pdfDoc->findPage(dstr);
+-#else
+-					pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 				}
+ 				else
+ 					pagNum = dst->getPageNum();
+@@ -485,11 +475,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 			POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 			if (ndst)
+ 			{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 				std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-				LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 				if (dstn)
+ 				{
+ 					if (dstn->getKind() == destXYZ)
+@@ -497,11 +483,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 						if (dstn->isPageRef())
+ 						{
+ 							Ref dstr = dstn->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 							pagNum = pdfDoc->findPage(dstr);
+-#else
+-							pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 						}
+ 						else
+ 							pagNum = dstn->getPageNum();
+@@ -533,11 +515,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 			POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 			if (ndst)
+ 			{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 				std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-				LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 				if (dstn)
+ 				{
+ 					if (dstn->getKind() == destXYZ)
+@@ -985,11 +963,7 @@ void SlaOutputDev::handleActions(PageIte
+ 					if (dst->isPageRef())
+ 					{
+ 						Ref dstr = dst->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 						pagNum = pdfDoc->findPage(dstr);
+-#else
+-						pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 					}
+ 					else
+ 						pagNum = dst->getPageNum();
+@@ -1005,11 +979,7 @@ void SlaOutputDev::handleActions(PageIte
+ 				POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 				if (ndst)
+ 				{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 					std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-					LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 					if (dstn)
+ 					{
+ 						if (dstn->getKind() == destXYZ)
+@@ -1017,11 +987,7 @@ void SlaOutputDev::handleActions(PageIte
+ 							if (dstn->isPageRef())
+ 							{
+ 								Ref dstr = dstn->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 								pagNum = pdfDoc->findPage(dstr);
+-#else
+-								pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 							}
+ 							else
+ 								pagNum = dstn->getPageNum();
+@@ -1061,11 +1027,7 @@ void SlaOutputDev::handleActions(PageIte
+ 				POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 				if (ndst)
+ 				{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 					std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-					LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 					if (dstn)
+ 					{
+ 						if (dstn->getKind() == destXYZ)
+@@ -1139,143 +1101,91 @@ void SlaOutputDev::handleActions(PageIte
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setD_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("E", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setE_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("X", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setX_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("Fo", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setFo_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("Bl", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setBl_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("C", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setC_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("F", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setF_act(UnicodeParsedString(jsa->getScript()));
+@@ -1283,22 +1193,14 @@ void SlaOutputDev::handleActions(PageIte
+ 				ite->annotation().setFormat(5);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("K", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setK_act(UnicodeParsedString(jsa->getScript()));
+@@ -1306,33 +1208,21 @@ void SlaOutputDev::handleActions(PageIte
+ 				ite->annotation().setFormat(5);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("V", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setV_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ }
+ 
+@@ -1342,11 +1232,7 @@ void SlaOutputDev::startDoc(PDFDoc *doc,
+ 	catalog = catA;
+ 	pdfDoc = doc;
+ 	updateGUICounter = 0;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 84, 0)
+ 	m_fontEngine = new SplashFontEngine(true, false, false, true);
+-#else
+-	m_fontEngine = new SplashFontEngine(globalParams->getEnableFreeType(), false, false, true);
+-#endif
+ }
+ 
+ void SlaOutputDev::startPage(int pageNum, GfxState *, XRef *)
+--- a/scribus/plugins/import/pdf/slaoutput.h
++++ b/scribus/plugins/import/pdf/slaoutput.h
+@@ -30,9 +30,6 @@ for which a new license (GPL+exception)
+ #include "selection.h"
+ #include "vgradient.h"
+ 
+-#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 73, 0)
+-#include <poppler/goo/gtypes.h>
+-#endif
+ #include <poppler/Object.h>
+ #include <poppler/OutputDev.h>
+ #include <poppler/Gfx.h>
+@@ -163,11 +160,7 @@ public:
+ 	virtual ~SlaOutputDev();
+ 
+ 	LinkAction* SC_getAction(AnnotWidget *ano);
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 	std::unique_ptr<LinkAction> SC_getAdditionalAction(const char *key, AnnotWidget *ano);
+-#else
+-	LinkAction* SC_getAdditionalAction(const char *key, AnnotWidget *ano);
+-#endif
+ 	static GBool annotations_callback(Annot *annota, void *user_data);
+ 	bool handleTextAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
+ 	bool handleLinkAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch
new file mode 100644
index 0000000000000..d40f35ad966e9
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch
@@ -0,0 +1,94 @@
+From 48263954a7dee0be815b00f417ae365ab26cdd85 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Thu, 3 Mar 2022 00:18:06 +0000
+Subject: [PATCH] #16764: Better patch, avoid a memory leak
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24989 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 34 +++++++++---------------
+ scribus/util_os.cpp                      |  2 ++
+ 2 files changed, 15 insertions(+), 21 deletions(-)
+
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -58,6 +58,7 @@ for which a new license (GPL+exception)
+ #include "util.h"
+ #include "util_formats.h"
+ #include "util_math.h"
++#include "util_os.h"
+ 
+ #include "ui/customfdialog.h"
+ #include "ui/missing.h"
+@@ -79,15 +80,12 @@ QImage PdfPlug::readThumbnail(const QStr
+ 	globalParams->setErrQuiet(gTrue);
+ 
+ 	QString pdfFile = QDir::toNativeSeparators(fName);
+-#if defined(Q_OS_WIN32)
+-	auto fname = new GooString(pdfFile.toUtf8().data());
+-#else
+-	auto fname = new GooString(QFile::encodeName(pdfFile).data());
+-#endif
+-
++	QByteArray encodedFileName = os_is_win() ? pdfFile.toUtf8() : QFile::encodeName(pdfFile);
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+-	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++	auto fname = std::make_unique<GooString>(encodedFileName.data());
++	PDFDoc pdfDoc{ std::move(fname) };
+ #else
++	auto fname = new GooString(encodedFileName.data());
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
+ #endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+@@ -331,17 +329,14 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams.reset(new GlobalParams());
+ 	globalParams->setErrQuiet(gTrue);
+ 
+-#if defined(Q_OS_WIN32)
+-	auto fname = new GooString(fn.toUtf8().data());
+-#else
+-	auto fname = new GooString(QFile::encodeName(fn).data());
+-#endif
+-
+ 	QList<OptionalContentGroup*> ocgGroups;
++	QByteArray encodedFileName = os_is_win() ? fn.toUtf8() : QFile::encodeName(fn);
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+-	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++	auto fname = std::make_unique<GooString>(encodedFileName.data());
++	auto pdfDoc = std::make_unique<PDFDoc>(std::move(fname));
+ #else
+-	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++	auto fname = new GooString(encodedFileName.data());
++	auto pdfDoc = std::make_unique<PDFDoc>(fname, nullptr, nullptr, nullptr);
+ #endif
+ 	if (pdfDoc)
+ 	{
+@@ -356,15 +351,12 @@ bool PdfPlug::convert(const QString& fn)
+ 			QString text = QInputDialog::getText(mw, tr("Open PDF-File"), tr("Password"), QLineEdit::Normal, "", &ok);
+ 			if (ok && !text.isEmpty())
+ 			{
+-#if defined(Q_OS_WIN32)
+-				auto fname = new GooString(fn.toUtf8().data());
+-#else
+-				auto fname = new GooString(QFile::encodeName(fn).data());
+-#endif
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				auto fname = std::make_unique<GooString>(encodedFileName.data());
+ 				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
+-				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++				pdfDoc.reset(new PDFDoc(std::move(fname), userPW, userPW, nullptr));
+ #else
++				auto fname = new GooString(encodedFileName.data());
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
+ #endif
+--- a/scribus/util_os.cpp
++++ b/scribus/util_os.cpp
+@@ -22,6 +22,8 @@ for which a new license (GPL+exception)
+ 
+ #include <QtGlobal>
+ 
++#include "util_os.h"
++
+ bool os_is_osx()
+ {
+ #ifdef Q_OS_MACOS
diff --git a/srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch b/srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch
new file mode 100644
index 0000000000000..261428153a96f
--- /dev/null
+++ b/srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch
@@ -0,0 +1,37 @@
+From 3d02faaa2e17eef67826abd52d56b4a9b2b9c1ba Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Sun, 4 Jun 2023 17:00:34 +0000
+Subject: [PATCH 01/13] Update CMake PoDoFo finder to allow for PoDoFo 0.10.0
+ podofo-config.h location
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25493 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit bd70705c05bd383d1a9b3ab12224988ff8475722)
+---
+ cmake/modules/FindLIBPODOFO.cmake | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+--- a/cmake/modules/FindLIBPODOFO.cmake
++++ b/cmake/modules/FindLIBPODOFO.cmake
+@@ -32,7 +32,14 @@ find_library(LIBPODOFO_LIBRARY
+ 
+ if(LIBPODOFO_INCLUDE_DIR AND LIBPODOFO_LIBRARY)
+ 	if(NOT LIBPODOFO_CONFIG_H)
+-		set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h")
++		#PoDoFo before 0.10.0
++		if (EXISTS "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h")
++			set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h. PoDoFo <=0.10.0")
++		endif()
++		#PoDoFo 0.10.0 or higher
++		if (EXISTS "${LIBPODOFO_INCLUDE_DIR}/podofo/auxiliary/podofo_config.h")
++			set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/auxiliary/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h. PoDoFo >=0.10.0")
++		endif()
+ 	endif()
+ 
+ 	file(STRINGS "${LIBPODOFO_CONFIG_H}" PODOFO_MAJOR_VER_LINE REGEX "^#define[ \t]+PODOFO_VERSION_MAJOR[ \t]+[0-9]+$")
+@@ -79,4 +86,6 @@ if(NOT LIBPODOFO_FIND_QUIETLY)
+ 		message("podofo lib: not found")
+ 	endif(LIBPODOFO_LIBRARY)
+ 	message("PoDoFo cflags: ${useshared}")
++	message("PoDoFo config file ${LIBPODOFO_CONFIG_H}")
++	message("PoDoFo version ${LIBPODOFO_VERSION}")
+ endif(NOT LIBPODOFO_FIND_QUIETLY)
diff --git a/srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch b/srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch
new file mode 100644
index 0000000000000..47c644f418b22
--- /dev/null
+++ b/srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch
@@ -0,0 +1,109 @@
+From 45ed6b8664675d78de1b3dbde2c9684111805811 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 5 Jun 2023 20:57:47 +0000
+Subject: [PATCH 02/13] Swap dependency checking for podofo and poppler to the
+ beginning to force C++17 when their versions require it
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25500 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 81b3cf609ff01400f6f804c98ee58febc4494908)
+---
+ CMakeLists_Dependencies.cmake | 74 +++++++++++++++++++++--------------
+ 1 file changed, 44 insertions(+), 30 deletions(-)
+
+--- a/CMakeLists_Dependencies.cmake
++++ b/CMakeLists_Dependencies.cmake
+@@ -1,6 +1,48 @@
+ ##############################################################################################################
+ ########## Find Dependencies                                                                        ##########
+ 
++#<<PoDoFo for AI PDF import
++option(WITH_PODOFO "Enable support for PDF embedded in AI" ON)
++if (WITH_PODOFO)
++	find_package(LIBPODOFO)
++	if (LIBPODOFO_FOUND)
++		message("PoDoFo found OK")
++		set(HAVE_PODOFO ON)
++		if(LIBPODOFO_VERSION VERSION_GREATER "0.10.0")
++			message(STATUS "PoDoFo Version:" ${LIBPODOFO_VERSION})
++			if (CMAKE_CXX_STANDARD LESS 17)
++				message(STATUS "C++17 is the minimum C++ standard since podofo 0.10.0")
++				message(STATUS "Enabling C++17 compiler features")
++				set(CMAKE_CXX_STANDARD 17)
++			endif()
++		endif()
++	else()
++		message("PoDoFo NOT found - Disabling support for PDF embedded in AI")
++	endif()
++endif()
++#>>PoDoFo for AI PDF import
++
++#<<Poppler for PDF import
++find_package(poppler REQUIRED)
++if (poppler_FOUND)
++	set(HAVE_POPPLER ON)
++	message(STATUS "Found poppler")
++	message(STATUS "Found poppler libs: ${poppler_LIBRARY}")
++	message(STATUS "Found poppler includes: ${poppler_INCLUDE_DIR}")
++	if (poppler_VERSION VERSION_GREATER_EQUAL 22.01.0)
++		message(STATUS "Poppler Version:" ${poppler_VERSION})
++		if (CMAKE_CXX_STANDARD LESS 17)
++			message(STATUS "C++17 is the minimum C++ standard since poppler 22.01.0")
++			message(STATUS "Enabling C++17 compiler features")
++			set(CMAKE_CXX_STANDARD 17)
++		endif()
++	endif()
++else()
++	message(FATAL_ERROR "Could not find poppler library")
++endif()
++#>>Poppler for PDF import
++
++
+ #<< Qt
+ #Qt less than 6
+ set(CMAKE_PREFIX_PATH "${QT_PREFIX}/lib/cmake")
+@@ -257,18 +299,7 @@ if (WANT_HUNSPELL)
+ endif()
+ #>>HUNSPELL for Spelling support
+ 
+-#<<PoDoFo for AI PDF import
+-option(WITH_PODOFO "Enable support for PDF embedded in AI" ON)
+-if (WITH_PODOFO)
+-	find_package(LIBPODOFO)
+-	if (LIBPODOFO_FOUND)
+-		message("PoDoFo found OK")
+-		set(HAVE_PODOFO ON)
+-	else()
+-		message("PoDoFo NOT found - Disabling support for PDF embedded in AI")
+-	endif()
+-endif()
+-#>>PoDoFo for AI PDF import
++
+ 
+ #<<Boost for 2Geom Tools
+ option(WITH_BOOST "Enable support for Boost based enhancements" ON)
+@@ -298,24 +329,7 @@ else()
+ endif()
+ #>> GraphicsMagick for image import
+ 
+-#<<Poppler for PDF import
+-find_package(poppler REQUIRED)
+-if (poppler_FOUND)
+-	set(HAVE_POPPLER ON)
+-	message(STATUS "Found poppler")
+-	message(STATUS "Found poppler libs: ${poppler_LIBRARY}")
+-	message(STATUS "Found poppler includes: ${poppler_INCLUDE_DIR}")
+-	if (poppler_VERSION VERSION_GREATER_EQUAL 22.01.0)
+-		message(STATUS "Poppler Version:" ${poppler_VERSION})
+-		message(STATUS "C++17 is the minimum C++ standard since poppler 22.01.0")
+-		if (CMAKE_CXX_STANDARD LESS 17)
+-			message(FATAL_ERROR "Please set -DWANT_CPP17=ON on your CMake command line")
+-		endif()
+-	endif()
+-else()
+-	message(FATAL_ERROR "Could not find poppler library")
+-endif()
+-#>>Poppler for PDF import
++
+ 
+ # librevenge for MsPub import
+ pkg_check_modules(LIBREVENGE librevenge-0.0)
diff --git a/srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch b/srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch
new file mode 100644
index 0000000000000..d5503bf50d7e6
--- /dev/null
+++ b/srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch
@@ -0,0 +1,22 @@
+From 2a2c95fda05bbb089c12807261b7a9339635b488 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 5 Jun 2023 21:32:27 +0000
+Subject: [PATCH 03/13] Bump minimum podofo version to 0.9.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25506 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 9233e1e20a006155e90e2893cb2a133949ec7a68)
+---
+ CMakeLists_Dependencies.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/CMakeLists_Dependencies.cmake
++++ b/CMakeLists_Dependencies.cmake
+@@ -4,7 +4,7 @@
+ #<<PoDoFo for AI PDF import
+ option(WITH_PODOFO "Enable support for PDF embedded in AI" ON)
+ if (WITH_PODOFO)
+-	find_package(LIBPODOFO)
++	find_package(LIBPODOFO 0.9.0)
+ 	if (LIBPODOFO_FOUND)
+ 		message("PoDoFo found OK")
+ 		set(HAVE_PODOFO ON)
diff --git a/srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch b/srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch
new file mode 100644
index 0000000000000..9cbfd8e3b9abf
--- /dev/null
+++ b/srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch
@@ -0,0 +1,48 @@
+From 60007314a17cfd9ef4d81689868ca1b4e91d5c89 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Mon, 5 Jun 2023 21:37:40 +0000
+Subject: [PATCH 04/13] Code cleanup now possible thanks to podofo >= 0.9.0
+ requirement
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25509 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit a43ad2030f6a6a7ccc1d7fc6cdcd7a652e1263c3)
+---
+ scribus/pdflib_core.cpp | 8 --------
+ 1 file changed, 8 deletions(-)
+
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9861,16 +9861,12 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			char * mbuffer = nullptr;
+ 			long mlen = 0;
+ 
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 7, 99))
+ 			// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
+ 			PoDoFo::PdfMemoryOutputStream oStream(1);
+ 			stream->GetCopy(&oStream);
+ 			oStream.Close();
+ 			mlen = oStream.GetLength();
+ 			mbuffer = oStream.TakeBuffer();
+-#else
+-			stream->GetCopy(&mbuffer, &mlen);
+-#endif
+ 			if (mbuffer[mlen-1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+@@ -10158,16 +10154,12 @@ void PDFLibCore::copyPoDoFoObject(const
+ 		char * mbuffer = nullptr;
+ 		long mlen = 0;
+ 
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 7, 99))
+ 		// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
+ 		PoDoFo::PdfMemoryOutputStream oStream(1);
+ 		stream->GetCopy(&oStream);
+ 		oStream.Close();
+ 		mlen = oStream.GetLength();
+ 		mbuffer = oStream.TakeBuffer();
+-#else
+-		stream->GetCopy(&mbuffer, &mlen);
+-#endif
+ 		if (mbuffer[mlen-1] == '\n')
+ 			--mlen;
+ 		PutDoc("\nstream\n");
diff --git a/srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch b/srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch
new file mode 100644
index 0000000000000..d545d347e28e1
--- /dev/null
+++ b/srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch
@@ -0,0 +1,67 @@
+From 99e2d400ad6ad7fbf4e2ad1a4277521eaad46d28 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Sun, 4 Jun 2023 21:31:53 +0000
+Subject: [PATCH 05/13] Rename m_doc in pdf_analyser to avoid confusion with
+ m_doc in other code
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25495 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit b5aeed8093e06cf3df456f5ad26f76f6ca442bff)
+---
+ scribus/pdf_analyzer.cpp | 12 ++++++------
+ scribus/pdf_analyzer.h   |  2 +-
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -75,11 +75,11 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 		nameMapInited = true;
+ 	}
+ 
+-	m_doc = nullptr;
++	m_pdfdoc = nullptr;
+ 
+ 	PdfError::EnableDebug( false );
+ 	try {
+-		m_doc = new PdfMemDocument(filename.toLocal8Bit().data());
++		m_pdfdoc = new PdfMemDocument(filename.toLocal8Bit().data());
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -91,14 +91,14 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 
+ PDFAnalyzer::~PDFAnalyzer()
+ {
+-	delete m_doc;
++	delete m_pdfdoc;
+ }
+ 
+ bool PDFAnalyzer::inspectPDF(int pageNum, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
+-	if (!m_doc)
++	if (!m_pdfdoc)
+ 		return false;
+-	PdfPage* page = m_doc->GetPage(pageNum);
++	PdfPage* page = m_pdfdoc->GetPage(pageNum);
+ 	return page?inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs):false;
+ }
+ 
+@@ -725,7 +725,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		if (arr[0].IsReference())
+ 		{
+ 			PdfReference ref = arr[0].GetReference();
+-			PdfObject* fontObject = m_doc->GetObjects().GetObject(ref);
++		PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
+ 			if (fontObject)
+ 			{
+ 				PDFFont font = getFontInfo(fontObject);
+--- a/scribus/pdf_analyzer.h
++++ b/scribus/pdf_analyzer.h
+@@ -162,7 +162,7 @@ public:
+ #ifdef HAVE_PODOFO
+ private:
+ 	// pointer to the PoDoFo Pdf's object
+-	PoDoFo::PdfMemDocument* m_doc;
++	PoDoFo::PdfMemDocument* m_pdfdoc;
+ 
+ 	// Path to the analyzed file
+ 	QString m_filename;
diff --git a/srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch b/srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch
new file mode 100644
index 0000000000000..f6c890ebf60d9
--- /dev/null
+++ b/srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch
@@ -0,0 +1,22 @@
+From ed854091944c93a74cdb3a4dbd6ed14e95ab6a9c Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Mon, 5 Jun 2023 21:03:08 +0000
+Subject: [PATCH 06/13] Small indentation fix
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25503 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit fd576ca6d40856ca3cfb32482b24fa15783665d5)
+---
+ scribus/pdf_analyzer.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -725,7 +725,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		if (arr[0].IsReference())
+ 		{
+ 			PdfReference ref = arr[0].GetReference();
+-		PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
++			PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
+ 			if (fontObject)
+ 			{
+ 				PDFFont font = getFontInfo(fontObject);
diff --git a/srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch b/srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch
new file mode 100644
index 0000000000000..973eb17f714b5
--- /dev/null
+++ b/srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch
@@ -0,0 +1,141 @@
+From 9cd60ef7831fff69f2dacc2bf216c3537b2cd6e9 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Sat, 12 Aug 2023 21:12:49 +0000
+Subject: [PATCH 07/13] PDFAnalyzer: code style fixes and cleanups
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25573 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 9be7a29f08a00bb3c10024cd9a31a82742d42e22)
+---
+ scribus/pdf_analyzer.cpp | 56 +++++++++++++++++++++-------------------
+ 1 file changed, 30 insertions(+), 26 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -78,7 +78,8 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 	m_pdfdoc = nullptr;
+ 
+ 	PdfError::EnableDebug( false );
+-	try {
++	try
++	{
+ 		m_pdfdoc = new PdfMemDocument(filename.toLocal8Bit().data());
+ 	}
+ 	catch (PdfError & e)
+@@ -99,12 +100,13 @@ bool PDFAnalyzer::inspectPDF(int pageNum
+ 	if (!m_pdfdoc)
+ 		return false;
+ 	PdfPage* page = m_pdfdoc->GetPage(pageNum);
+-	return page?inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs):false;
++	return page ? inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs) : false;
+ }
+ 
+ PDFColorSpace PDFAnalyzer::getCSType(PdfObject* cs)
+ {
+-	try {
++	try
++	{
+ 		// colorspace is either a name or an array
+ 		if (cs && cs->IsName())
+ 		{
+@@ -165,20 +167,21 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ bool PDFAnalyzer::inspectCanvas(PdfCanvas* canvas, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
+ 	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
+-	PdfObject* colorSpaceRes;
+-	PdfObject* xObjects;
+-	PdfObject* transGroup;
+-	PdfObject* extGState;
+-	PdfObject* fontRes;
++	PdfObject* colorSpaceRes { nullptr };
++	PdfObject* xObjects { nullptr };
++	PdfObject* transGroup { nullptr };
++	PdfObject* extGState { nullptr };
++	PdfObject* fontRes { nullptr };
+ 	QMap<PdfName, PDFColorSpace> processedNamedCS;
+ 	QMap<PdfName, PDFFont> processedNamedFont;
+ 	QList<PdfName> processedNamedXObj;
+ 	QList<PdfName> processedNamedGS;
+-	try {
++	try
++	{
+ 		// get hold of a PdfObject pointer of this canvas
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
+-		PdfObject* canvasObject = page?(page->GetObject()):((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
+ 
+ 		// find a resource with ColorSpace entry
+ 		PdfObject* resources = canvas->GetResources();
+@@ -186,13 +189,13 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		{
+ 			resources = par->GetIndirectKey("Resources");
+ 		}
+-		colorSpaceRes = resources?resources->GetIndirectKey("ColorSpace"):nullptr;
+-		xObjects = resources?resources->GetIndirectKey("XObject"):nullptr;
+-		extGState = resources?resources->GetIndirectKey("ExtGState"):nullptr;
+-		fontRes = resources?resources->GetIndirectKey("Font"):nullptr;
++		colorSpaceRes = resources ? resources->GetIndirectKey("ColorSpace") : nullptr;
++		xObjects = resources ? resources->GetIndirectKey("XObject") : nullptr;
++		extGState = resources ? resources->GetIndirectKey("ExtGState") : nullptr;
++		fontRes = resources ? resources->GetIndirectKey("Font") : nullptr;
+ 
+ 		// getting the transparency group of this content stream (if available)
+-		transGroup = canvasObject?canvasObject->GetIndirectKey("Group"):nullptr;
++		transGroup = canvasObject ? canvasObject->GetIndirectKey("Group") : nullptr;
+ 		if (transGroup)
+ 		{
+ 			PdfObject* subtype = transGroup->GetIndirectKey("S");
+@@ -219,7 +222,8 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		return false;
+ 	}
+ 
+-	try {
++	try
++	{
+ 		// start parsing the content stream
+ 		PdfContentsTokenizer tokenizer(canvas);
+ 		EPdfContentsType t;
+@@ -502,7 +506,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						if (args.size() == 1 && args[0].IsName() && xObjects)
+ 						{
+ 							PdfObject* xObject = xObjects->GetIndirectKey(args[0].GetName());
+-							PdfObject* subtypeObject = xObject?xObject->GetIndirectKey("Subtype"):nullptr;
++							PdfObject* subtypeObject = xObject ? xObject->GetIndirectKey("Subtype") : nullptr;
+ 							if (subtypeObject && subtypeObject->IsName())
+ 							{
+ 								if (subtypeObject->GetName() == "Image")
+@@ -557,10 +561,10 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						PdfName cs("CS");
+ 						if (args.contains(colorspace) || args.contains(cs))
+ 						{
+-							int csIdx = args.contains(colorspace)?args.indexOf(colorspace):args.indexOf(cs);
+-							if (args[csIdx+1].IsName())
++							int csIdx = args.contains(colorspace) ? args.indexOf(colorspace) : args.indexOf(cs);
++							if (args[csIdx + 1].IsName())
+ 							{
+-								PdfName csName = args[csIdx+1].GetName();
++								PdfName csName = args[csIdx + 1].GetName();
+ 								if ((csName == "G" || csName == "DeviceGray") && !usedColorSpaces.contains(CS_DeviceGray))
+ 									usedColorSpaces.append(CS_DeviceGray);
+ 								else if ((csName == "RGB" || csName == "DeviceRGB") && !usedColorSpaces.contains(CS_DeviceRGB))
+@@ -594,14 +598,14 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						PdfName w("W");
+ 						if ((args.contains(height) || args.contains(h)) && (args.contains(width) || args.contains(w)))
+ 						{
+-							int heightIdx = args.contains(height)?args.indexOf(height):args.indexOf(h);
+-							int widthIdx = args.contains(width)?args.indexOf(width):args.indexOf(w);
+-							double height = args[heightIdx+1].GetReal();
+-							double width = args[widthIdx+1].GetReal();
++							int heightIdx = args.contains(height) ? args.indexOf(height) : args.indexOf(h);
++							int widthIdx = args.contains(width) ? args.indexOf(width) : args.indexOf(w);
++							double height = args[heightIdx + 1].GetReal();
++							double width = args[widthIdx + 1].GetReal();
+ 							PDFImage img;
+ 							img.imgName = "Inline Image";
+-							img.dpiX = qRound(width/(currGS.ctm.m11()/72));
+-							img.dpiY = qRound(height/(currGS.ctm.m22()/72));
++							img.dpiX = qRound(width / (currGS.ctm.m11() / 72));
++							img.dpiY = qRound(height / (currGS.ctm.m22() / 72));
+ 							imgs.append(img);
+ 						}
+ 						inlineImgDict = false;
diff --git a/srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch b/srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch
new file mode 100644
index 0000000000000..654d870140683
--- /dev/null
+++ b/srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch
@@ -0,0 +1,514 @@
+From bb6c0716035bcdc9fd4bd536d1ed6f01a1c6e9fa Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Sat, 12 Aug 2023 23:28:11 +0000
+Subject: [PATCH 08/13] Preparation work for PoDoFo 0.10.0x support: get rid of
+ GetIndirectKey() calls
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25579 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit fbd5eb474e0e6f522c6089756424592ecf0dc0a4)
+---
+ scribus/pdf_analyzer.cpp               | 204 ++++++++++++++-----------
+ scribus/pdflib_core.cpp                |  28 ++--
+ scribus/plugins/import/ai/importai.cpp |  21 ++-
+ 3 files changed, 148 insertions(+), 105 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -167,11 +167,10 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ bool PDFAnalyzer::inspectCanvas(PdfCanvas* canvas, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
+ 	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
+-	PdfObject* colorSpaceRes { nullptr };
+-	PdfObject* xObjects { nullptr };
+-	PdfObject* transGroup { nullptr };
+-	PdfObject* extGState { nullptr };
+-	PdfObject* fontRes { nullptr };
++	PdfDictionary* colorSpacesDict { nullptr };
++	PdfDictionary* xObjectsDict { nullptr };
++	PdfDictionary* extGStatesDict { nullptr };
++	PdfDictionary* fontsDict { nullptr };
+ 	QMap<PdfName, PDFColorSpace> processedNamedCS;
+ 	QMap<PdfName, PDFFont> processedNamedFont;
+ 	QList<PdfName> processedNamedXObj;
+@@ -182,30 +181,41 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
+ 		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++		PdfDictionary* canvasDict = (canvasObject && canvasObject->IsDictionary()) ? &(canvasObject->GetDictionary()) : nullptr;
+ 
+ 		// find a resource with ColorSpace entry
+ 		PdfObject* resources = canvas->GetResources();
+-		for (PdfObject* par = canvasObject; par && !resources; par = par->GetIndirectKey("Parent"))
++		for (PdfDictionary* par = canvasDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+-			resources = par->GetIndirectKey("Resources");
++			resources = par->FindKey("Resources");
++			PdfObject* parentObj = par->FindKey("Parent");
++			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
+ 		}
+-		colorSpaceRes = resources ? resources->GetIndirectKey("ColorSpace") : nullptr;
+-		xObjects = resources ? resources->GetIndirectKey("XObject") : nullptr;
+-		extGState = resources ? resources->GetIndirectKey("ExtGState") : nullptr;
+-		fontRes = resources ? resources->GetIndirectKey("Font") : nullptr;
++
++		PdfDictionary* resourcesDict = (resources && resources->IsDictionary()) ? &(resources->GetDictionary()) : nullptr;
++		PdfObject* colorSpaceRes = resourcesDict ? resourcesDict->FindKey("ColorSpace") : nullptr;
++		PdfObject* xObjects = resourcesDict ? resourcesDict->FindKey("XObject") : nullptr;
++		PdfObject* extGState = resourcesDict ? resourcesDict->FindKey("ExtGState") : nullptr;
++		PdfObject* fontRes = resourcesDict ? resourcesDict->FindKey("Font") : nullptr;
++
++		colorSpacesDict = (colorSpaceRes && colorSpaceRes->IsDictionary()) ? &(colorSpaceRes->GetDictionary()) : nullptr;
++		xObjectsDict = (xObjects && xObjects->IsDictionary()) ? &(xObjects->GetDictionary()) : nullptr;
++		extGStatesDict = (extGState && extGState->IsDictionary()) ? &(extGState->GetDictionary()) : nullptr;
++		fontsDict = (fontRes && fontRes->IsDictionary()) ? &(fontRes->GetDictionary()) : nullptr;
+ 
+ 		// getting the transparency group of this content stream (if available)
+-		transGroup = canvasObject ? canvasObject->GetIndirectKey("Group") : nullptr;
+-		if (transGroup)
++		PdfObject* transGroup = canvasDict ? canvasDict->FindKey("Group") : nullptr;
++		PdfDictionary* transGroupDict = (transGroup && transGroup->IsDictionary()) ? &(transGroup->GetDictionary()) : nullptr;
++		if (transGroupDict)
+ 		{
+-			PdfObject* subtype = transGroup->GetIndirectKey("S");
++			const PdfObject* subtype = transGroupDict->FindKey("S");
+ 			if (subtype && subtype->GetName() == "Transparency")
+ 			{
+ 				// having transparency group means there's transparency in the PDF
+ 				hasTransparency = true;
+ 
+ 				// reporting the color space used in transparency group (Section 7.5.5, PDF 1.6 Spec)
+-				PdfObject* cs = transGroup->GetIndirectKey("CS");
++				PdfObject* cs = transGroupDict->FindKey("CS");
+ 				if (cs)
+ 				{
+ 					PDFColorSpace retval = getCSType(cs);
+@@ -380,9 +390,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -449,9 +459,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -503,28 +513,29 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedXObj.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && xObjects)
++						if (args.size() == 1 && args[0].IsName() && xObjectsDict)
+ 						{
+-							PdfObject* xObject = xObjects->GetIndirectKey(args[0].GetName());
+-							PdfObject* subtypeObject = xObject ? xObject->GetIndirectKey("Subtype") : nullptr;
++							PdfObject* xObject = xObjectsDict->FindKey(args[0].GetName());
++							PdfDictionary* xObjectDict = (xObject && xObject->IsDictionary()) ? &(xObject->GetDictionary()) : nullptr;
++							PdfObject* subtypeObject = xObjectDict ? xObjectDict->FindKey("Subtype") : nullptr;
+ 							if (subtypeObject && subtypeObject->IsName())
+ 							{
+ 								if (subtypeObject->GetName() == "Image")
+ 								{
+-									PdfObject* imgColorSpace = xObject->GetIndirectKey("ColorSpace");
++									PdfObject* imgColorSpace = xObjectDict->FindKey("ColorSpace");
+ 									if (imgColorSpace)
+ 									{
+ 										PDFColorSpace retval = getCSType(imgColorSpace);
+ 										if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 											usedColorSpaces.append(retval);
+ 									}
+-									PdfObject* sMaskObj = xObject->GetIndirectKey("SMask");
++									PdfObject* sMaskObj = xObjectDict->FindKey("SMask");
+ 									if (sMaskObj)
+ 										hasTransparency = true;
+ 									PDFImage img;
+ 									img.imgName = args[0].GetName().GetEscapedName().c_str();
+-									double width = xObject->GetIndirectKey("Width")->GetReal();
+-									double height = xObject->GetIndirectKey("Height")->GetReal();
++									double width = xObjectDict->FindKey("Width")->GetReal();
++									double height = xObjectDict->FindKey("Height")->GetReal();
+ 									img.dpiX = qRound(width/(currGS.ctm.m11()/72));
+ 									img.dpiY = qRound(height/(currGS.ctm.m22()/72));
+ 									imgs.append(img);
+@@ -573,9 +584,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 									usedColorSpaces.append(CS_DeviceCMYK);
+ 								else if (!processedNamedCS.contains(csName))
+ 								{
+-									if (colorSpaceRes && colorSpaceRes->GetIndirectKey(csName))
++									if (colorSpacesDict && colorSpacesDict->FindKey(csName))
+ 									{
+-										PdfObject* csEntry = colorSpaceRes->GetIndirectKey(csName);
++										PdfObject* csEntry = colorSpacesDict->FindKey(csName);
+ 										if (csEntry)
+ 										{
+ 											PDFColorSpace retval = getCSType(csEntry);
+@@ -615,9 +626,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedGS.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && extGState)
++						if (args.size() == 1 && args[0].IsName() && extGStatesDict)
+ 						{
+-							PdfObject* extGStateObj = extGState->GetIndirectKey(args[0].GetName());
++							PdfObject* extGStateObj = extGStatesDict->FindKey(args[0].GetName());
+ 							if (extGStateObj)
+ 							{
+ 								inspectExtGStateObj(extGStateObj, usedColorSpaces, hasTransparency, usedFonts, currGS);
+@@ -646,9 +657,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					}
+ 					else
+ 					{
+-						if (args.size() == 2 && args[0].IsName() && fontRes)
++						if (args.size() == 2 && args[0].IsName() && fontsDict)
+ 						{
+-							PdfObject* fontObj = fontRes->GetIndirectKey(args[0].GetName());
++							PdfObject* fontObj = fontsDict->FindKey(args[0].GetName());
+ 							if (fontObj)
+ 							{
+ 								PDFFont retval = getFontInfo(fontObj);
+@@ -687,9 +698,11 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 	}
+ 	return true;
+ }
++
+ void PDFAnalyzer::inspectExtGStateObj(PdfObject* extGStateObj, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, PDFGraphicState & currGS)
+ {
+-	PdfObject* bmObj = extGStateObj->GetIndirectKey("BM");
++	PdfDictionary* extGStateDict = extGStateObj->IsDictionary() ? &(extGStateObj->GetDictionary()) : nullptr;
++	PdfObject* bmObj = extGStateDict ? extGStateDict->FindKey("BM") : nullptr;
+ 	if (bmObj && bmObj->IsName())
+ 	{
+ 		currGS.blendModes.clear();
+@@ -706,23 +719,27 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		if (arr[0].IsName() && !(arr[0].GetName() == "Normal" || arr[0].GetName() == "Compatible"))
+ 			hasTransparency = true;
+ 	}
+-	PdfObject* caObj = extGStateObj->GetIndirectKey("ca");
++
++	PdfObject* caObj = extGStateDict ? extGStateDict->FindKey("ca") : nullptr;
+ 	if (caObj && (caObj->IsReal() || caObj->IsNumber()))
+ 	{
+ 		currGS.fillAlphaConstant = caObj->GetReal();
+ 		if (caObj->GetReal() < 1)
+ 			hasTransparency = true;
+ 	}
+-	PdfObject* cAObj = extGStateObj->GetIndirectKey("CA");
++
++	PdfObject* cAObj = extGStateDict ? extGStateDict->FindKey("CA") : nullptr;
+ 	if (cAObj && (cAObj->IsReal() || cAObj->IsNumber()))
+ 	{
+ 		if (cAObj->GetReal() < 1)
+-		hasTransparency = true;
++			hasTransparency = true;
+ 	}
+-	PdfObject* sMaskObj = extGStateObj->GetIndirectKey("SMask");
++
++	PdfObject* sMaskObj = extGStateDict ? extGStateDict->FindKey("SMask") : nullptr;
+ 	if (sMaskObj && !(sMaskObj->IsName() && sMaskObj->GetName() == "None"))
+ 		hasTransparency = true;
+-	PdfObject* fontObj = extGStateObj->GetIndirectKey("Font");
++
++	PdfObject* fontObj = extGStateDict ? extGStateDict->FindKey("Font") : nullptr;
+ 	if (fontObj && fontObj->IsArray())
+ 	{
+ 		PdfArray arr = fontObj->GetArray();
+@@ -740,19 +757,24 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 
+ 		}
+ 	}
+-	PdfObject* lwObj = extGStateObj->GetIndirectKey("LW");
++
++	PdfObject* lwObj = extGStateDict ? extGStateDict->FindKey("LW") : nullptr;
+ 	if (lwObj)
+ 		currGS.lineWidth = lwObj->GetReal();
+-	PdfObject* lcObj = extGStateObj->GetIndirectKey("LC");
++
++	PdfObject* lcObj = extGStateDict ? extGStateDict->FindKey("LC") : nullptr;
+ 	if (lcObj)
+ 		currGS.lineCap = lcObj->GetNumber();
+-	PdfObject* ljObj = extGStateObj->GetIndirectKey("LJ");
++
++	PdfObject* ljObj = extGStateDict ? extGStateDict->FindKey("LJ") : nullptr;
+ 	if (ljObj)
+ 		currGS.lineJoin = ljObj->GetNumber();
+-	PdfObject* mlObj = extGStateObj->GetIndirectKey("ML");
++
++	PdfObject* mlObj = extGStateDict ? extGStateDict->FindKey("ML") : nullptr;
+ 	if (mlObj)
+ 		currGS.miterLimit = mlObj->GetReal();
+-	PdfObject* dObj = extGStateObj->GetIndirectKey("D");
++
++	PdfObject* dObj = extGStateDict ? extGStateDict->FindKey("D") : nullptr;
+ 	if (dObj)
+ 	{
+ 		PdfObject dObjA = dObj->GetArray()[0];
+@@ -767,56 +789,64 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ PDFFont PDFAnalyzer::getFontInfo(PdfObject* fontObj)
+ {
+ 	PDFFont currFont;
+-	PdfObject* subtype = fontObj->GetIndirectKey("Subtype");
+-	if (subtype && subtype->IsName())
++	const PdfDictionary* fontDict = fontObj->IsDictionary() ? &(fontObj->GetDictionary()) : nullptr;
++	if (!fontDict)
++		return currFont;
++
++	const PdfObject* subtype = fontDict->FindKey("Subtype");
++	if (!subtype || !subtype->IsName())
++		return currFont;
++
++	const PdfObject* fontDesc = fontDict->FindKey("FontDescriptor");
++	if (subtype->GetName() == "Type1")
++		currFont.fontType = F_Type1;
++	else if (subtype->GetName() == "MMType1")
++		currFont.fontType = F_MMType1;
++	else if (subtype->GetName() == "TrueType")
++		currFont.fontType = F_TrueType;
++	else if (subtype->GetName() == "Type3")
++	{
++		currFont.fontType = F_Type3;
++		currFont.isEmbedded = true;
++		fontDesc = nullptr;
++	}
++	else if (subtype->GetName() == "Type0")
+ 	{
+-		PdfObject* fontDesc = fontObj->GetIndirectKey("FontDescriptor");
+-		if (subtype->GetName() == "Type1")
+-			currFont.fontType = F_Type1;
+-		else if (subtype->GetName() == "MMType1")
+-			currFont.fontType = F_MMType1;
+-		else if (subtype->GetName() == "TrueType")
+-			currFont.fontType = F_TrueType;
+-		else if (subtype->GetName() == "Type3")
+-		{
+-			currFont.fontType = F_Type3;
+-			currFont.isEmbedded = true;
+-			fontDesc = nullptr;
+-		}
+-		else if (subtype->GetName() == "Type0")
++		const PdfObject* descendantFonts = fontDict->FindKey("DescendantFonts");
++		if (descendantFonts && descendantFonts->IsArray())
+ 		{
+-			PdfObject* descendantFonts = fontObj->GetIndirectKey("DescendantFonts");
+-			if (descendantFonts && descendantFonts->IsArray())
++			const PdfReference& refDescFont = descendantFonts->GetArray()[0].GetReference();
++			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
++			PdfDictionary* descendantFontDict = (descendantFont && descendantFont->IsDictionary()) ? &(descendantFont->GetDictionary()) : nullptr;
++			const PdfObject* subtypeDescFont = descendantFontDict->FindKey("Subtype");
++			fontDesc = &(descendantFontDict->MustGetKey("FontDescriptor"));
++			if (subtypeDescFont && subtypeDescFont->IsName())
+ 			{
+-				PdfReference refDescFont = descendantFonts->GetArray()[0].GetReference();
+-				PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
+-				PdfObject* subtypeDescFont = descendantFont->GetIndirectKey("Subtype");
+-				fontDesc = descendantFont->MustGetIndirectKey("FontDescriptor");
+-				if (subtypeDescFont && subtypeDescFont->IsName())
+-				{
+-					if (subtypeDescFont->GetName() == "CIDFontType0")
+-						currFont.fontType = F_CIDFontType0;
+-					else if (subtypeDescFont->GetName() == "CIDFontType2")
+-						currFont.fontType = F_CIDFontType2;
+-				}
++				if (subtypeDescFont->GetName() == "CIDFontType0")
++					currFont.fontType = F_CIDFontType0;
++				else if (subtypeDescFont->GetName() == "CIDFontType2")
++					currFont.fontType = F_CIDFontType2;
+ 			}
+ 		}
+-		if (fontDesc)
++	}
++
++	const PdfDictionary* fontDescDict = (fontDesc && fontDesc->IsDictionary()) ? &(fontDesc->GetDictionary()) : nullptr;
++	if (fontDescDict)
++	{
++		const PdfObject* fontFile = fontDescDict->FindKey("FontFile");
++		const PdfObject* fontFile2 = fontDescDict->FindKey("FontFile2");
++		const PdfObject* fontFile3 = fontDescDict->FindKey("FontFile3");
++		if (fontFile && fontFile->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile2 && fontFile2->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile3 && fontFile3->HasStream())
+ 		{
+-			PdfObject* fontFile = fontDesc->GetIndirectKey("FontFile");
+-			PdfObject* fontFile2 = fontDesc->GetIndirectKey("FontFile2");
+-			PdfObject* fontFile3 = fontDesc->GetIndirectKey("FontFile3");
+-			if (fontFile && fontFile->HasStream())
+-				currFont.isEmbedded = true;
+-			if (fontFile2 && fontFile2->HasStream())
+-				currFont.isEmbedded = true;
+-			if (fontFile3 && fontFile3->HasStream())
+-			{
+-				currFont.isEmbedded = true;
+-				PdfObject* ff3Subtype = fontFile3->GetIndirectKey("Subtype");
+-				if (ff3Subtype && ff3Subtype->IsName() && ff3Subtype->GetName() == "OpenType")
+-					currFont.isOpenType = true;
+-			}
++			currFont.isEmbedded = true;
++			const PdfDictionary* fontFile3Dict = fontFile3->IsDictionary() ? &(fontFile3->GetDictionary()) : nullptr;
++			const PdfObject* ff3Subtype = fontFile3Dict ? fontFile3Dict->FindKey("Subtype") : nullptr;
++			if (ff3Subtype && ff3Subtype->IsName() && ff3Subtype->GetName() == "OpenType")
++				currFont.isOpenType = true;
+ 		}
+ 	}
+ 	return currFont;
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9800,16 +9800,20 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 		PoDoFo::PdfObject* pageObj   = page ? page->GetObject() : nullptr;
+ 		PoDoFo::PdfObject* contents  = page ? page->GetContents() : nullptr;
+ 		PoDoFo::PdfObject* resources = page ? page->GetResources() : nullptr;
+-		for (PoDoFo::PdfObject* par = pageObj; par && !resources; par = par->GetIndirectKey("Parent"))
++		PoDoFo::PdfDictionary* pageObjDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
++		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+-			resources = par->GetIndirectKey("Resources");
++			resources = par->FindKey("Resources");
++			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
++			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
+ 		}
+ 		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Dictionary)
+ 		{
++			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
+ 			PoDoFo::PdfStream* stream = contents->GetStream();
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+-			PoDoFo::PdfObject* nextObj;
++			PoDoFo::PdfObject* nextObj { nullptr };
+ 			PdfId xObj = writer.newObject();
+ 			PdfId xResources = writer.newObject();
+ 			PdfId xParents = 0;
+@@ -9844,14 +9848,16 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			nextObj = page->GetObject()->GetIndirectKey("Group");
++			PoDoFo::PdfObject* pageObj = page->GetObject();
++			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+ 			/*
+-			PoDoFo::PdfObject parents = page->GetObject()->GetIndirectKey("StructParents");
++			PoDoFo::PdfObject parents = pageDict->FindKey("StructParents");
+ 			if (parents)
+ 			{
+ 				xParents = writer.newObject();
+@@ -9870,13 +9876,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			if (mbuffer[mlen-1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+-			nextObj = contents->GetIndirectKey("Filter");
++			nextObj = contentsDict.FindKey("Filter");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Filter ");
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+-			nextObj = contents->GetIndirectKey("DecodeParms");
++			nextObj = contentsDict.FindKey("DecodeParms");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/DecodeParms ");
+@@ -9967,7 +9973,9 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			nextObj = page->GetObject()->GetIndirectKey("Group");
++			PoDoFo::PdfObject* pageObj = page->GetObject();
++			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+@@ -10012,13 +10020,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ //				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+ /*
+- nextObj = contents->GetIndirectKey("Filter");
++			nextObj = contentsDict.FindKey("Filter");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Filter ");
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+-			nextObj = contents->GetIndirectKey("DecodeParms");
++			nextObj = contentsDict.FindKey("DecodeParms");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/DecodeParms ");
+--- a/scribus/plugins/import/ai/importai.cpp
++++ b/scribus/plugins/import/ai/importai.cpp
+@@ -587,36 +587,41 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		PoDoFo::PdfPage *curPage = doc.GetPage(0);
+ 		if (curPage != nullptr)
+ 		{
+-			PoDoFo::PdfObject *piece = curPage->GetObject()->GetIndirectKey("PieceInfo");
++			PoDoFo::PdfObject* pageObj = curPage->GetObject();
++			PoDoFo::PdfDictionary* pageDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
++			PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
+ 			if (piece != nullptr)
+ 			{
+-				PoDoFo::PdfObject *illy = piece->GetIndirectKey("Illustrator");
++				PoDoFo::PdfDictionary* pieceDict = piece->IsDictionary() ? &(piece->GetDictionary()) : nullptr;
++				PoDoFo::PdfObject *illy = pieceDict ? pieceDict->FindKey("Illustrator") : nullptr;
+ 				if (illy != nullptr)
+ 				{
+-					PoDoFo::PdfObject *priv = illy->GetIndirectKey("Private");
++					PoDoFo::PdfDictionary* illyDict = illy->IsDictionary() ? &(illy->GetDictionary()) : nullptr;
++					PoDoFo::PdfObject *priv = illyDict ? illyDict->FindKey("Private") : nullptr;
+ 					if (priv == nullptr)
+ 						priv = illy;
+ 					int num = 0;
+-					PoDoFo::PdfObject *numBl = priv->GetIndirectKey("NumBlock");
++					PoDoFo::PdfDictionary* privDict = priv->IsDictionary() ? &(priv->GetDictionary()) : nullptr;
++					PoDoFo::PdfObject *numBl = privDict ? privDict->FindKey("NumBlock") : nullptr;
+ 					if (numBl != nullptr)
+ 						num = numBl->GetNumber() + 1;
+ 					if (num == 0)
+ 						num = 99999;
+ 					QString name = "AIPrivateData%1";
+ 					QString Key = name.arg(1);
+-					PoDoFo::PdfObject *data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++					PoDoFo::PdfObject *data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
+ 					if (data == nullptr)
+ 					{
+ 						name = "AIPDFPrivateData%1";
+ 						Key = name.arg(1);
+-						data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++						data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
+ 					}
+ 					if (data != nullptr)
+ 					{
+ 						if (num == 2)
+ 						{
+ 							Key = name.arg(1);
+-							data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 							PoDoFo::PdfStream const *stream = data->GetStream();
+ 							PoDoFo::PdfMemoryOutputStream oStream(1);
+ 							stream->GetFilteredCopy(&oStream);
+@@ -631,7 +636,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 							for (int a = 2; a < num; a++)
+ 							{
+ 								Key = name.arg(a);
+-								data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 								if (data == nullptr)
+ 									break;
+ 								PoDoFo::PdfStream const *stream = data->GetStream();
diff --git a/srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch b/srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch
new file mode 100644
index 0000000000000..5810becb56446
--- /dev/null
+++ b/srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch
@@ -0,0 +1,1602 @@
+From bbaa1944d83a2c68e49927d5bcc462cd870beb2d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Tue, 15 Aug 2023 02:43:52 +0000
+Subject: [PATCH 09/13] #16948: Fix build with podofo 0.10.x
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25601 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 33580ae8371e993b6e199e710950702c78d7dde1)
+---
+ scribus/documentchecker.cpp                   |  18 +-
+ .../imagedataloaders/scimgdataloader_pdf.cpp  |  12 +-
+ scribus/pdf_analyzer.cpp                      | 533 +++++++++++++++++-
+ scribus/pdflib_core.cpp                       | 480 +++++++++++++---
+ scribus/pdflib_core.h                         |   4 +-
+ scribus/plugins/import/ai/importai.cpp        |  41 +-
+ 6 files changed, 985 insertions(+), 103 deletions(-)
+
+--- a/scribus/documentchecker.cpp
++++ b/scribus/documentchecker.cpp
+@@ -109,7 +109,7 @@ bool DocumentChecker::checkDocument(Scri
+ void DocumentChecker::checkPages(ScribusDoc *currDoc, const CheckerPrefs& checkerSettings)
+ {
+ 	errorCodes pageError;
+-	for (int i=0; i < currDoc->DocPages.count(); ++i )
++	for (int i = 0; i < currDoc->DocPages.count(); ++i)
+ 	{
+ 		pageError.clear();
+ 		if (checkerSettings.checkAppliedMasterDifferentSide)
+@@ -127,11 +127,11 @@ void DocumentChecker::checkPages(Scribus
+ 			}
+ 			else
+ 			{
+-				if (pageLoc==LeftPage && masterPageLocation==1)
++				if (pageLoc == LeftPage && masterPageLocation == 1)
+ 					error = false;
+-				else if (pageLoc==RightPage && masterPageLocation==0)
++				else if (pageLoc == RightPage && masterPageLocation == 0)
+ 					error = false;
+-				else if (pageLoc==MiddlePage && masterPageLocation==2)
++				else if (pageLoc == MiddlePage && masterPageLocation == 2)
+ 					error = false;
+ 				else
+ 					error = true;
+@@ -596,7 +596,7 @@ void DocumentChecker::checkItems(Scribus
+ 								}
+ 								if (checkerSettings.checkNotCMYKOrSpot)
+ 								{
+-									for (int i=0; i<usedColorSpaces.size(); ++i)
++									for (int i = 0; i < usedColorSpaces.size(); ++i)
+ 									{
+ 										if (usedColorSpaces[i] == CS_DeviceRGB || usedColorSpaces[i] == CS_ICCBased || usedColorSpaces[i] == CS_CalGray
+ 											|| usedColorSpaces[i] == CS_CalRGB || usedColorSpaces[i] == CS_Lab)
+@@ -608,7 +608,7 @@ void DocumentChecker::checkItems(Scribus
+ 								}
+ 								if (checkerSettings.checkDeviceColorsAndOutputIntent && currDoc->HasCMS)
+ 								{
+-									for (int i=0; i<usedColorSpaces.size(); ++i)
++									for (int i = 0; i < usedColorSpaces.size(); ++i)
+ 									{
+ 										if (currPrintProfCS == ColorSpace_Cmyk && (usedColorSpaces[i] == CS_DeviceRGB || usedColorSpaces[i] == CS_DeviceGray))
+ 										{
+@@ -627,7 +627,7 @@ void DocumentChecker::checkItems(Scribus
+ 								itemError.insert(Transparency, 0);
+ 							if (checkerSettings.checkFontNotEmbedded || checkerSettings.checkFontIsOpenType)
+ 							{
+-								for (int i=0; i<usedFonts.size(); ++i)
++								for (int i = 0; i < usedFonts.size(); ++i)
+ 								{
+ 									PDFFont currentFont = usedFonts[i];
+ 									if (!currentFont.isEmbedded && checkerSettings.checkFontNotEmbedded)
+@@ -638,7 +638,7 @@ void DocumentChecker::checkItems(Scribus
+ 							}
+ 							if (checkerSettings.checkResolution)
+ 							{
+-								for (int i=0; i<imgs.size(); ++i)
++								for (int i = 0; i < imgs.size(); ++i)
+ 								{
+ 									if ((imgs[i].dpiX < checkerSettings.minResolution) || (imgs[i].dpiY < checkerSettings.minResolution))
+ 										itemError.insert(ImageDPITooLow, 0);
+@@ -655,7 +655,7 @@ void DocumentChecker::checkItems(Scribus
+ 				if ( currItem->frameOverflows() && (checkerSettings.checkOverflow) && (!((currItem->isAnnotation()) && ((currItem->annotation().Type() == Annotation::Combobox) || (currItem->annotation().Type() == Annotation::Listbox)))))
+ 					itemError.insert(TextOverflow, 0);
+ 
+-				if (checkerSettings.checkEmptyTextFrames && (currItem->itemText.length()==0 || currItem->frameUnderflows()))
++				if (checkerSettings.checkEmptyTextFrames && (currItem->itemText.length() == 0 || currItem->frameUnderflows()))
+ 				{
+ 					bool isEmptyAnnotation = (currItem->isAnnotation() && 
+ 					                         ((currItem->annotation().Type() == Annotation::Link) ||
+--- a/scribus/imagedataloaders/scimgdataloader_pdf.cpp
++++ b/scribus/imagedataloaders/scimgdataloader_pdf.cpp
+@@ -55,10 +55,16 @@ bool ScImgDataLoader_PDF::loadPicture(co
+ #ifdef HAVE_PODOFO
+ 	try
+ 	{
+-		PoDoFo::PdfError::EnableDebug( false );
+-		PoDoFo::PdfError::EnableLogging( false );
+-		PoDoFo::PdfMemDocument doc( fn.toLocal8Bit().data() );
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PoDoFo::PdfMemDocument doc;
++		doc.Load(fn.toLocal8Bit().data());
++		m_imageInfoRecord.numberOfPages = doc.GetPages().GetCount();
++#else
++		PoDoFo::PdfError::EnableDebug(false);
++		PoDoFo::PdfError::EnableLogging(false);
++		PoDoFo::PdfMemDocument doc(fn.toLocal8Bit().data());
+ 		m_imageInfoRecord.numberOfPages = doc.GetPageCount();
++#endif
+ 		if (page > m_imageInfoRecord.numberOfPages)
+ 		{
+ 			qDebug() << "Incorrect page number specified!";
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -30,6 +30,10 @@ for which a new license (GPL+exception)
+ #ifdef HAVE_PODOFO
+ using namespace PoDoFo;
+ 
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
++#define IsRealStrict IsReal
++#endif
++
+ static QHash<QString, PDFContentStreamKeyword> kwNameMap;
+ 
+ // we gonna need a map from string values to the defined enum of pdf keywords
+@@ -77,10 +81,13 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 
+ 	m_pdfdoc = nullptr;
+ 
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+ 	PdfError::EnableDebug( false );
++#endif
+ 	try
+ 	{
+-		m_pdfdoc = new PdfMemDocument(filename.toLocal8Bit().data());
++		m_pdfdoc = new PdfMemDocument();
++		m_pdfdoc->Load(filename.toLocal8Bit().data());
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -99,7 +106,12 @@ bool PDFAnalyzer::inspectPDF(int pageNum
+ {
+ 	if (!m_pdfdoc)
+ 		return false;
++
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++	PdfPage* page = &(m_pdfdoc->GetPages().GetPageAt(pageNum));
++#else
+ 	PdfPage* page = m_pdfdoc->GetPage(pageNum);
++#endif
+ 	return page ? inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs) : false;
+ }
+ 
+@@ -139,7 +151,13 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ 					PdfObject* pBase = &base;
+ 					if (base.IsReference())
+ 					{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++						PdfDocument* pdfdoc = cs->GetDocument();
++						PdfIndirectObjectList& pdf_iol = pdfdoc->GetObjects();
++						pBase = pdf_iol.GetObject(base.GetReference());
++#else
+ 						pBase = cs->GetOwner()->GetObject(base.GetReference());
++#endif
+ 					}
+ #if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 9, 7))
+ 					pBase->SetOwner(cs->GetOwner());
+@@ -180,11 +198,21 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		// get hold of a PdfObject pointer of this canvas
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PdfObject* canvasObject = page ? &(page->GetObject()) : &(dynamic_cast<PdfXObject*>(canvas)->GetObject());
++
++#else
+ 		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++#endif
+ 		PdfDictionary* canvasDict = (canvasObject && canvasObject->IsDictionary()) ? &(canvasObject->GetDictionary()) : nullptr;
+ 
+ 		// find a resource with ColorSpace entry
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PdfResources* canvasRsrc = canvas->GetResources();
++		PdfObject* resources = &(canvasRsrc->GetObject());
++#else
+ 		PdfObject* resources = canvas->GetResources();
++#endif
+ 		for (PdfDictionary* par = canvasDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+ 			resources = par->FindKey("Resources");
+@@ -234,6 +262,468 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 
+ 	try
+ 	{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		// start parsing the content stream
++		PdfContentReaderArgs tokenizerArgs = { PdfContentReaderFlags::DontFollowXObjectForms };
++		PdfContentStreamReader tokenizer(*canvas, tokenizerArgs);
++		PdfContent pdfContent;
++		PdfVariant var;
++		bool readToken;
++
++		int tokenNumber = 0;
++		bool inlineImgDict = false;
++		QList<PdfVariant> args;
++		QStack<PDFGraphicState> gsStack;
++		PDFGraphicState currGS;
++		while ((readToken = tokenizer.TryReadNext(pdfContent)))
++		{
++			++tokenNumber;
++			if (pdfContent.Type == PdfContentType::Operator)
++			{
++				args.clear();
++				int stackSize = pdfContent.Stack.size();
++				for (size_t i = 0; i < stackSize; ++i)
++					args.append(pdfContent.Stack[stackSize - 1 - i]);
++				switch (pdfContent.Operator)
++				{
++				case PdfOperator::q:
++					gsStack.push(currGS);
++					break;
++				case PdfOperator::Q:
++					currGS = gsStack.pop();
++					break;
++				case PdfOperator::cm:
++				{
++					if (args.size() == 6)
++					{
++						double mt[6];
++						for (int i = 0; i < 6; ++i)
++						{
++							mt[i] = args[i].GetReal();
++						}
++						QTransform transMatrix(mt[0], mt[1], mt[2], mt[3], mt[4], mt[5]);
++						currGS.ctm = transMatrix * currGS.ctm;
++					}
++				}
++				break;
++				case PdfOperator::w:
++					currGS.lineWidth = args[0].GetReal();
++					break;
++				case PdfOperator::J:
++					currGS.lineCap = args[0].GetNumber();
++					break;
++				case PdfOperator::j:
++					currGS.lineJoin = args[0].GetNumber();
++					break;
++				case PdfOperator::M:
++					currGS.lineJoin = args[0].GetReal();
++					break;
++				case PdfOperator::d:
++				{
++					currGS.dashPattern.first.clear();
++					PdfArray dashArr = args[0].GetArray();
++					for (uint i = 0; i < dashArr.size(); ++i)
++						currGS.dashPattern.first.append(dashArr[i].GetNumber());
++					currGS.dashPattern.second = args[1].GetNumber();
++				}
++				break;
++				case PdfOperator::g:
++					if (!usedColorSpaces.contains(CS_DeviceGray))
++						usedColorSpaces.append(CS_DeviceGray);
++					currGS.fillCS = CS_DeviceGray;
++					currGS.fillColor.clear();
++					currGS.fillColor.append(args[0].GetReal());
++					break;
++				case PdfOperator::G:
++					if (!usedColorSpaces.contains(CS_DeviceGray))
++						usedColorSpaces.append(CS_DeviceGray);
++					currGS.strokeCS = CS_DeviceGray;
++					currGS.strokeColor.clear();
++					currGS.strokeColor.append(args[0].GetReal());
++					break;
++				case PdfOperator::rg:
++					if (!usedColorSpaces.contains(CS_DeviceRGB))
++						usedColorSpaces.append(CS_DeviceRGB);
++					currGS.fillCS = CS_DeviceRGB;
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.fillColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::RG:
++					if (!usedColorSpaces.contains(CS_DeviceRGB))
++						usedColorSpaces.append(CS_DeviceRGB);
++					currGS.strokeCS = CS_DeviceRGB;
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.strokeColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::k:
++					if (!usedColorSpaces.contains(CS_DeviceCMYK))
++						usedColorSpaces.append(CS_DeviceCMYK);
++					currGS.fillCS = CS_DeviceCMYK;
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.fillColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::K:
++					if (!usedColorSpaces.contains(CS_DeviceCMYK))
++						usedColorSpaces.append(CS_DeviceCMYK);
++					currGS.strokeCS = CS_DeviceCMYK;
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.strokeColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::cs:
++				{
++					if (args.size() == 1 && args[0].IsName())
++					{
++						if (args[0].GetName() == "DeviceGray")
++						{
++							currGS.fillCS = CS_DeviceGray;
++							currGS.fillColor.clear();
++							currGS.fillColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceGray))
++								usedColorSpaces.append(CS_DeviceGray);
++						}
++						else if (args[0].GetName() == "DeviceRGB")
++						{
++							currGS.fillCS = CS_DeviceRGB;
++							currGS.fillColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.fillColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceRGB))
++								usedColorSpaces.append(CS_DeviceRGB);
++						}
++						else if (args[0].GetName() == "DeviceCMYK")
++						{
++							currGS.fillCS = CS_DeviceCMYK;
++							currGS.fillColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.fillColor.append(0);
++							currGS.fillColor.append(1);
++							if (!usedColorSpaces.contains(CS_DeviceCMYK))
++								usedColorSpaces.append(CS_DeviceCMYK);
++						}
++						else if (args[0].GetName() == "Pattern")
++						{
++							currGS.fillCS = CS_Pattern;
++							if (!usedColorSpaces.contains(CS_Pattern))
++								usedColorSpaces.append(CS_Pattern);
++						}
++						else
++						{
++							if (processedNamedCS.contains(args[0].GetName()))
++							{
++								currGS.fillCS = processedNamedCS.value(args[0].GetName());
++							}
++							else
++							{
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								{
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PDFColorSpace retval = getCSType(csEntry);
++									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++										usedColorSpaces.append(retval);
++									currGS.fillCS = retval;
++									processedNamedCS.insert(args[0].GetName(), retval);
++								}
++								else
++								{
++									qDebug() << "Supplied colorspace is undefined! File:" << m_filename;
++									return false;
++								}
++							}
++						}
++					}
++					else
++					{
++						qDebug() << "Wrong syntax in specifying color space! File:" << m_filename;
++						return false;
++					}
++				}
++				break;
++				case PdfOperator::CS:
++				{
++					if (args.size() == 1 && args[0].IsName())
++					{
++						if (args[0].GetName() == "DeviceGray")
++						{
++							currGS.strokeCS = CS_DeviceGray;
++							currGS.strokeColor.clear();
++							currGS.strokeColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceGray))
++								usedColorSpaces.append(CS_DeviceGray);
++						}
++						else if (args[0].GetName() == "DeviceRGB")
++						{
++							currGS.fillCS = CS_DeviceRGB;
++							currGS.strokeColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.strokeColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceRGB))
++								usedColorSpaces.append(CS_DeviceRGB);
++						}
++						else if (args[0].GetName() == "DeviceCMYK")
++						{
++							currGS.fillCS = CS_DeviceCMYK;
++							currGS.strokeColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.strokeColor.append(0);
++							currGS.strokeColor.append(1);
++							if (!usedColorSpaces.contains(CS_DeviceCMYK))
++								usedColorSpaces.append(CS_DeviceCMYK);
++						}
++						else if (args[0].GetName() == "Pattern")
++						{
++							currGS.fillCS = CS_Pattern;
++							if (!usedColorSpaces.contains(CS_Pattern))
++								usedColorSpaces.append(CS_Pattern);
++						}
++						else
++						{
++							if (processedNamedCS.contains(args[0].GetName()))
++							{
++								currGS.strokeCS = processedNamedCS.value(args[0].GetName());
++							}
++							else
++							{
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								{
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PDFColorSpace retval = getCSType(csEntry);
++									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++										usedColorSpaces.append(retval);
++									currGS.strokeCS = retval;
++									processedNamedCS.insert(args[0].GetName(), retval);
++								}
++								else
++								{
++									qDebug() << "Supplied colorspace is undefined! File:" << m_filename;
++									return false;
++								}
++							}
++						}
++					}
++					else
++					{
++						qDebug() << "Wrong syntax in specifying color space! File:" << m_filename;
++						return false;
++					}
++				}
++				break;
++				case PdfOperator::sc:
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.fillColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::SC:
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.strokeColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::scn:
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++					{
++						if (args[i].IsRealStrict() || args[i].IsNumber())
++							currGS.fillColor.append(args[i].GetReal());
++					}
++					break;
++				case PdfOperator::SCN:
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++					{
++						if (args[i].IsRealStrict() || args[i].IsNumber())
++							currGS.strokeColor.append(args[i].GetReal());
++					}
++					break;
++				case PdfOperator::Do: // image or form XObject
++					// Handled in PdfContentType::DoXObject
++					break;
++				case PdfOperator::BI:
++					inlineImgDict = true;
++					break;
++				case PdfOperator::ID:
++					if (inlineImgDict)
++					{
++						PdfName colorspace("ColorSpace");
++						PdfName cs("CS");
++						if (args.contains(colorspace) || args.contains(cs))
++						{
++							int csIdx = args.contains(colorspace) ? args.indexOf(colorspace) : args.indexOf(cs);
++							if (args[csIdx + 1].IsName())
++							{
++								PdfName csName = args[csIdx + 1].GetName();
++								if ((csName == "G" || csName == "DeviceGray") && !usedColorSpaces.contains(CS_DeviceGray))
++									usedColorSpaces.append(CS_DeviceGray);
++								else if ((csName == "RGB" || csName == "DeviceRGB") && !usedColorSpaces.contains(CS_DeviceRGB))
++									usedColorSpaces.append(CS_DeviceRGB);
++								else if ((csName == "CMYK" || csName == "DeviceCMYK") && !usedColorSpaces.contains(CS_DeviceCMYK))
++									usedColorSpaces.append(CS_DeviceCMYK);
++								else if (!processedNamedCS.contains(csName))
++								{
++									if (colorSpacesDict && colorSpacesDict->FindKey(csName))
++									{
++										PdfObject* csEntry = colorSpacesDict->FindKey(csName);
++										if (csEntry)
++										{
++											PDFColorSpace retval = getCSType(csEntry);
++											if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++												usedColorSpaces.append(retval);
++											processedNamedCS.insert(csName, retval);
++										}
++									}
++									else
++									{
++										qDebug() << "Supplied colorspace for inline image is undefined!";
++										return false;
++									}
++								}
++							}
++						}
++						PdfName height("Height");
++						PdfName h("H");
++						PdfName width("Width");
++						PdfName w("W");
++						if ((args.contains(height) || args.contains(h)) && (args.contains(width) || args.contains(w)))
++						{
++							int heightIdx = args.contains(height) ? args.indexOf(height) : args.indexOf(h);
++							int widthIdx = args.contains(width) ? args.indexOf(width) : args.indexOf(w);
++							double height = args[heightIdx + 1].GetReal();
++							double width = args[widthIdx + 1].GetReal();
++							PDFImage img;
++							img.imgName = "Inline Image";
++							img.dpiX = qRound(width / (currGS.ctm.m11() / 72));
++							img.dpiY = qRound(height / (currGS.ctm.m22() / 72));
++							imgs.append(img);
++						}
++						inlineImgDict = false;
++					}
++					break;
++				case PdfOperator::gs:
++				{
++					if (!processedNamedGS.contains(args[0].GetName()))
++					{
++						if (args.size() == 1 && args[0].IsName() && extGStatesDict)
++						{
++							PdfObject* extGStateObj = extGStatesDict->FindKey(args[0].GetName());
++							if (extGStateObj)
++							{
++								inspectExtGStateObj(extGStateObj, usedColorSpaces, hasTransparency, usedFonts, currGS);
++							}
++							else
++							{
++								qDebug() << "Named graphic state used with gs operator is undefined in current ExtGState. File:" << m_filename;
++								return false;
++							}
++							processedNamedGS.append(args[0].GetName());
++						}
++						else
++						{
++							qDebug() << "Wrong syntax in applying extended graphic state (gs operator) or there's no ExtGState defined! File:" << m_filename;
++							return false;
++						}
++					}
++				}
++				break;
++				case PdfOperator::Tf:
++				{
++					if (processedNamedFont.contains(args[0].GetName()))
++					{
++						currGS.font.first = processedNamedFont.value(args[0].GetName());
++						currGS.font.second = args[1].GetReal();
++					}
++					else
++					{
++						if (args.size() == 2 && args[0].IsName() && fontsDict)
++						{
++							PdfObject* fontObj = fontsDict->FindKey(args[0].GetName());
++							if (fontObj)
++							{
++								PDFFont retval = getFontInfo(fontObj);
++								usedFonts.append(retval);
++								processedNamedFont.insert(args[0].GetName(), retval);
++								currGS.font.first = retval;
++								currGS.font.second = args[1].GetReal();
++							}
++							else
++							{
++								qDebug() << "The specified font cannot be found in current Resources! File:" << m_filename;
++								return false;
++							}
++						}
++						else
++						{
++							qDebug() << "Wrong syntax in use of Tf operator or there's no Font defined in current Resources dictionary! File:" << m_filename;
++							return false;
++						}
++					}
++				}
++				break;
++				case PdfOperator::Unknown:
++				default:
++					break;
++				}
++				args.clear();
++			}
++			if (pdfContent.Type == PdfContentType::DoXObject)
++			{
++				args.clear();
++				int stackSize = pdfContent.Stack.size();
++				for (size_t i = 0; i < stackSize; ++i)
++					args.append(pdfContent.Stack[stackSize - 1 - i]);
++				if (!processedNamedXObj.contains(args[0].GetName()))
++				{
++					if (args.size() == 1 && args[0].IsName() && xObjectsDict)
++					{
++						PdfObject* xObject = xObjectsDict->FindKey(args[0].GetName());
++						PdfDictionary* xObjectDict = (xObject && xObject->IsDictionary()) ? &(xObject->GetDictionary()) : nullptr;
++						PdfObject* subtypeObject = xObjectDict ? xObjectDict->FindKey("Subtype") : nullptr;
++						if (subtypeObject && subtypeObject->IsName())
++						{
++							if (subtypeObject->GetName() == "Image")
++							{
++								PdfObject* imgColorSpace = xObjectDict->FindKey("ColorSpace");
++								if (imgColorSpace)
++								{
++									PDFColorSpace retval = getCSType(imgColorSpace);
++									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++										usedColorSpaces.append(retval);
++								}
++								PdfObject* sMaskObj = xObjectDict->FindKey("SMask");
++								if (sMaskObj)
++									hasTransparency = true;
++								PDFImage img;
++								img.imgName = args[0].GetName().GetEscapedName().c_str();
++								double width = xObjectDict->FindKey("Width")->GetReal();
++								double height = xObjectDict->FindKey("Height")->GetReal();
++								img.dpiX = qRound(width / (currGS.ctm.m11() / 72));
++								img.dpiY = qRound(height / (currGS.ctm.m22() / 72));
++								imgs.append(img);
++							}
++							else if (subtypeObject->GetName() == "Form")
++							{
++								std::unique_ptr<PdfXObjectForm> xObj;
++								PdfXObject::TryCreateFromObject(*xObject, xObj);
++								inspectCanvas(xObj.get(), usedColorSpaces, hasTransparency, usedFonts, imgs); // recursive call
++							}
++						}
++						else
++						{
++							qDebug() << "Supplied external object is undefined! File:" << m_filename;
++							return false;
++						}
++						processedNamedXObj.append(args[0].GetName());
++					}
++					else
++					{
++						qDebug() << "Wrong syntax for Do operator or there's no XObject defined! File:" << m_filename;
++						return false;
++					}
++				}
++			}
++		}
++#else
+ 		// start parsing the content stream
+ 		PdfContentsTokenizer tokenizer(canvas);
+ 		EPdfContentsType t;
+@@ -269,7 +759,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					if (args.size() == 6)
+ 					{
+ 						double mt[6];
+-						for (int i=0; i<6; ++i)
++						for (int i = 0; i < 6; ++i)
+ 						{
+ 							mt[i] = args[i].GetReal();
+ 						}
+@@ -294,7 +784,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					currGS.dashPattern.first.clear();
+ 					PdfArray dashArr = args[0].GetArray();
+-					for (uint i=0; i<dashArr.size(); ++i)
++					for (uint i = 0; i < dashArr.size(); ++i)
+ 						currGS.dashPattern.first.append(dashArr[i].GetNumber());
+ 					currGS.dashPattern.second = args[1].GetNumber();
+ 					}
+@@ -318,7 +808,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceRGB);
+ 					currGS.fillCS = CS_DeviceRGB;
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.fillColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_RG:
+@@ -326,7 +816,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceRGB);
+ 					currGS.strokeCS = CS_DeviceRGB;
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.strokeColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_k:
+@@ -334,7 +824,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceCMYK);
+ 					currGS.fillCS = CS_DeviceCMYK;
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.fillColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_K:
+@@ -342,7 +832,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceCMYK);
+ 					currGS.strokeCS = CS_DeviceCMYK;
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.strokeColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_cs:
+@@ -361,7 +851,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceRGB;
+ 							currGS.fillColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.fillColor.append(0);
+ 							if (!usedColorSpaces.contains(CS_DeviceRGB))
+ 								usedColorSpaces.append(CS_DeviceRGB);
+@@ -370,7 +860,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceCMYK;
+ 							currGS.fillColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.fillColor.append(0);
+ 							currGS.fillColor.append(1);
+ 							if (!usedColorSpaces.contains(CS_DeviceCMYK))
+@@ -430,7 +920,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceRGB;
+ 							currGS.strokeColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.strokeColor.append(0);
+ 							if (!usedColorSpaces.contains(CS_DeviceRGB))
+ 								usedColorSpaces.append(CS_DeviceRGB);
+@@ -439,7 +929,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceCMYK;
+ 							currGS.strokeColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.strokeColor.append(0);
+ 							currGS.strokeColor.append(1);
+ 							if (!usedColorSpaces.contains(CS_DeviceCMYK))
+@@ -485,17 +975,17 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					break;
+ 				case KW_sc:
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.fillColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_SC:
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.strokeColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_scn:
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 					{
+ 						if (args[i].IsReal() || args[i].IsNumber())
+ 							currGS.fillColor.append(args[i].GetReal());
+@@ -503,7 +993,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					break;
+ 				case KW_SCN:
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 					{
+ 						if (args[i].IsReal() || args[i].IsNumber())
+ 							currGS.strokeColor.append(args[i].GetReal());
+@@ -689,6 +1179,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 				args.clear();
+ 			}
+ 		}
++#endif
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -714,14 +1205,14 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 	{
+ 		PdfArray arr = bmObj->GetArray();
+ 		currGS.blendModes.clear();
+-		for(uint i=0; i<arr.GetSize(); ++i)
++		for (uint i = 0; i < arr.GetSize(); ++i)
+ 			currGS.blendModes.append(arr[i].GetName().GetEscapedName().c_str());
+ 		if (arr[0].IsName() && !(arr[0].GetName() == "Normal" || arr[0].GetName() == "Compatible"))
+ 			hasTransparency = true;
+ 	}
+ 
+ 	PdfObject* caObj = extGStateDict ? extGStateDict->FindKey("ca") : nullptr;
+-	if (caObj && (caObj->IsReal() || caObj->IsNumber()))
++	if (caObj && (caObj->IsRealStrict() || caObj->IsNumber()))
+ 	{
+ 		currGS.fillAlphaConstant = caObj->GetReal();
+ 		if (caObj->GetReal() < 1)
+@@ -729,7 +1220,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 	}
+ 
+ 	PdfObject* cAObj = extGStateDict ? extGStateDict->FindKey("CA") : nullptr;
+-	if (cAObj && (cAObj->IsReal() || cAObj->IsNumber()))
++	if (cAObj && (cAObj->IsRealStrict() || cAObj->IsNumber()))
+ 	{
+ 		if (cAObj->GetReal() < 1)
+ 			hasTransparency = true;
+@@ -780,7 +1271,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		PdfObject dObjA = dObj->GetArray()[0];
+ 		PdfArray dashArr = dObjA.GetArray();
+ 		currGS.dashPattern.first.clear();
+-		for (uint i=0; i<dashArr.GetSize(); ++i)
++		for (uint i = 0; i < dashArr.GetSize(); ++i)
+ 			currGS.dashPattern.first.append(dashArr[i].GetNumber());
+ 		PdfObject dObjB = dObj->GetArray()[1];
+ 		currGS.dashPattern.second = dObjB.GetNumber();
+@@ -816,7 +1307,11 @@ PDFFont PDFAnalyzer::getFontInfo(PdfObje
+ 		if (descendantFonts && descendantFonts->IsArray())
+ 		{
+ 			const PdfReference& refDescFont = descendantFonts->GetArray()[0].GetReference();
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++			PdfObject* descendantFont = descendantFonts->GetDocument()->GetObjects().GetObject(refDescFont);
++#else
+ 			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
++#endif
+ 			PdfDictionary* descendantFontDict = (descendantFont && descendantFont->IsDictionary()) ? &(descendantFont->GetDictionary()) : nullptr;
+ 			const PdfObject* subtypeDescFont = descendantFontDict->FindKey("Subtype");
+ 			fontDesc = &(descendantFontDict->MustGetKey("FontDescriptor"));
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9783,22 +9783,298 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 	QScopedPointer<PoDoFo::PdfMemDocument> doc;
+ 	try
+ 	{
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PoDoFo::PdfError::EnableDebug(false);
+ 		PoDoFo::PdfError::EnableLogging(false);
+-		doc.reset(new PoDoFo::PdfMemDocument(fn.toLocal8Bit().data()));
++#endif
++		doc.reset(new PoDoFo::PdfMemDocument());
++		doc->Load(fn.toLocal8Bit().data());
+ 	}
+-	catch(PoDoFo::PdfError& e)
++	catch (PoDoFo::PdfError& e)
+ 	{
+ 		qDebug() << "PoDoFo error, falling back to raster!";
+ 		e.PrintErrorMsg();
+ 		return false;
+ 	}
+ 
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	try
+ 	{
+-		PoDoFo::PdfPage*   page      = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
+-		PoDoFo::PdfObject* pageObj   = page ? page->GetObject() : nullptr;
+-		PoDoFo::PdfObject* contents  = page ? page->GetContents() : nullptr;
++		PoDoFo::PdfPage& page = doc->GetPages().GetPageAt(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
++		PoDoFo::PdfObject& pageObj = page.GetObject();
++		PoDoFo::PdfObject* contents = page.GetContents() ? &(page.GetContents()->GetObject()) : nullptr;
++		PoDoFo::PdfObject* resources = page.GetResources() ? &(page.GetResources()->GetObject()) : nullptr;
++		PoDoFo::PdfDictionary* pageObjDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
++		{
++			resources = par->FindKey("Resources");
++			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
++			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
++		}
++		if (contents && contents->GetDataType() == PoDoFo::PdfDataType::Dictionary)
++		{
++			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
++			PoDoFo::PdfObjectStream* stream = contents->GetStream();
++			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
++			QList<PoDoFo::PdfReference> referencedObjects;
++			PoDoFo::PdfObject* nextObj { nullptr };
++			PdfId xObj = writer.newObject();
++			PdfId xResources = writer.newObject();
++			PdfId xParents = 0;
++			importedObjects[page.GetObject().GetIndirectReference()] = xObj;
++			writer.startObj(xObj);
++			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
++			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
++			int rotation = page.GetRotationRaw();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
++			QTransform pageM;
++			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
++			pageM.rotate(rotation);
++			if (rotation == 90)
++				pageM.translate(0.0, -imgHeight);
++			else if (rotation == 180)
++				pageM.translate(-imgWidth, -imgHeight);
++			else if (rotation == 270)
++				pageM.translate(-imgWidth, 0.0);
++			pageM.scale(imgWidth, imgHeight);
++			pageM = pageM.inverted();
++			PutDoc("\n/BBox [" + Pdf::toPdf(pageRect.GetLeft()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetLeft() + pageRect.Width));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
++			PutDoc("]");
++			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
++			PutDoc("]");
++			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
++			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			if (nextObj)
++			{
++				PutDoc("\n/Group "); // PDF 1.4
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++			/*
++			PoDoFo::PdfObject parents = pageDict->FindKey("StructParents");
++			if (parents)
++			{
++				xParents = writer.newObject();
++				PutDoc("\n/StructParents " + Pdf::toPdf(xParents)); // required if page uses structured content
++			}
++			*/
++
++			const char* mbuffer = nullptr;
++			long mlen = 0;
++			PoDoFo::charbuff strBuff = stream->GetCopy(true);
++			mlen = strBuff.size();
++			mbuffer = strBuff.c_str();
++			if (mbuffer[mlen - 1] == '\n')
++				--mlen;
++			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
++			nextObj = contentsDict.FindKey("Filter");
++			if (nextObj)
++			{
++				PutDoc("\n/Filter ");
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++			nextObj = contentsDict.FindKey("DecodeParms");
++			if (nextObj)
++			{
++				PutDoc("\n/DecodeParms ");
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++			PutDoc("\n>>\nstream\n");
++			{
++				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
++				EncodeArrayToStream(buffer, xObj);
++			}  // disconnect QByteArray from raw data
++			PutDoc("\nendstream");
++			writer.endObj(xObj);
++			// write resources
++			if (resources)
++			{
++				copyPoDoFoObject(resources, xResources, importedObjects);
++			}
++			else
++			{
++				writer.startObj(xResources);
++				PutDoc("<< >>");
++				writer.endObj(xResources);
++			}
++			if (xParents)
++			{
++				// create structured parents
++			}
++			// write referenced objects
++			PoDoFo::PdfIndirectObjectList& allObjects = contents->GetDocument()->GetObjects();
++			for (int i = 0; i < referencedObjects.size(); ++i)
++			{
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects.GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
++			}
++
++			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
++			imgInfo.ResNum = ResCount;
++			ResCount++;
++			// Avoid a divide-by-zero if width/height are less than 1 point:
++			imgInfo.Width = qMax(1, (int) imgWidth);
++			imgInfo.Height = qMax(1, (int) imgHeight);
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
++			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
++			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
++			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
++			imgInfo.sya = sy * imgHeight / imgInfo.Height;
++
++			return true;
++		}
++		if (contents && contents->GetDataType() == PoDoFo::PdfDataType::Array)//Page contents might be an array
++		{
++			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
++			QList<PoDoFo::PdfReference> referencedObjects;
++			PoDoFo::PdfObject* nextObj;
++			PdfId xObj = writer.newObject();
++			PdfId xResources = writer.newObject();
++			PdfId xParents = 0;
++			importedObjects[page.GetObject().GetIndirectReference()] = xObj;
++			writer.startObj(xObj);
++			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
++			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
++			int rotation = page.GetRotationRaw();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
++			QTransform pageM;
++			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
++			pageM.rotate(rotation);
++			if (rotation == 90)
++				pageM.translate(0.0, -imgHeight);
++			else if (rotation == 180)
++				pageM.translate(-imgWidth, -imgHeight);
++			else if (rotation == 270)
++				pageM.translate(-imgWidth, 0.0);
++			pageM.scale(imgWidth, imgHeight);
++			pageM = pageM.inverted();
++			PutDoc("\n/BBox [" + Pdf::toPdf(pageRect.GetLeft()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetLeft() + pageRect.Width));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
++			PutDoc("]");
++			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
++			PutDoc("]");
++			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
++			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			if (nextObj)
++			{
++				PutDoc("\n/Group "); // PDF 1.4
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++
++			const char* mbuffer = nullptr;
++			long mlen = 0;
++			PoDoFo::charbuff strBuffer;
++			PoDoFo::StringStreamDevice strStreamDev(strBuffer);
++			PoDoFo::PdfArray carray(page.GetContents()->GetObject().GetArray());
++			for (unsigned int ci = 0; ci < carray.size(); ++ci)
++			{
++				if (carray[ci].HasStream())
++				{
++					carray[ci].GetStream()->CopyTo(strStreamDev, false);
++				}
++				else if (carray[ci].IsReference())
++				{
++					nextObj = doc->GetObjects().GetObject(carray[ci].GetReference());
++
++					while (nextObj != nullptr)
++					{
++						if (nextObj->IsReference())
++						{
++							nextObj = doc->GetObjects().GetObject(nextObj->GetReference());
++						}
++						else if (nextObj->HasStream())
++						{
++							nextObj->GetStream()->CopyTo(strStreamDev, false);
++							break;
++						}
++					}
++				}
++			}
++			// end of copy
++			mlen = strBuffer.size();
++			mbuffer = strBuffer.c_str();
++
++			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
++			PutDoc("\n>>\nstream\n");
++			{
++				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
++				EncodeArrayToStream(buffer, xObj);
++			}  // disconnect QByteArray from raw data
++			PutDoc("\nendstream");
++			writer.endObj(xObj);
++			// write resources
++			if (resources)
++			{
++				copyPoDoFoObject(resources, xResources, importedObjects);
++			}
++			else
++			{
++				writer.startObj(xResources);
++				PutDoc("<< >>");
++				writer.endObj(xResources);
++			}
++			if (xParents)
++			{
++				// create structured parents
++			}
++			// write referenced objects
++			PoDoFo::PdfIndirectObjectList& allObjects = contents->GetDocument()->GetObjects();
++			for (int i = 0; i < referencedObjects.size(); ++i)
++			{
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects.GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
++			}
++
++			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
++			imgInfo.ResNum = ResCount;
++			ResCount++;
++			// Avoid a divide-by-zero if width/height are less than 1 point:
++			imgInfo.Width = qMax(1, (int) imgWidth);
++			imgInfo.Height = qMax(1, (int) imgHeight);
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
++			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
++			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
++			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
++			imgInfo.sya = sy * imgHeight / imgInfo.Height;
++
++			return true;
++		}
++	}
++	catch (PoDoFo::PdfError& e)
++	{
++		fatalError = true;
++		qDebug() << "PoDoFo error!";
++		e.PrintErrorMsg();
++		return false;
++	}
++#else
++	try
++	{
++		PoDoFo::PdfPage* page = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
++		PoDoFo::PdfObject* pageObj = page ? page->GetObject() : nullptr;
++		PoDoFo::PdfObject* contents = page ? page->GetContents() : nullptr;
+ 		PoDoFo::PdfObject* resources = page ? page->GetResources() : nullptr;
+ 		PoDoFo::PdfDictionary* pageObjDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+ 		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
+@@ -9807,13 +10083,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
+ 			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
+ 		}
+-		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Dictionary)
++		if (contents && contents->GetDataType() == PoDoFo::ePdfDataType_Dictionary)
+ 		{
+ 			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
+ 			PoDoFo::PdfStream* stream = contents->GetStream();
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+-			PoDoFo::PdfObject* nextObj { nullptr };
++			const PoDoFo::PdfObject* nextObj { nullptr };
+ 			PdfId xObj = writer.newObject();
+ 			PdfId xResources = writer.newObject();
+ 			PdfId xParents = 0;
+@@ -9822,7 +10098,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9841,14 +10117,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-								 + Pdf::toPdf(pageM.m12()) + " "
+-								 + Pdf::toPdf(pageM.m21()) + " "
+-								 + Pdf::toPdf(pageM.m22()) + " "
+-								 + Pdf::toPdf(pageM.dx())  + " "
+-								 + Pdf::toPdf(pageM.dy())  + " ");
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfObject* pageObj = page->GetObject();
+ 			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+ 			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+@@ -9864,16 +10139,16 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				PutDoc("\n/StructParents " + Pdf::toPdf(xParents)); // required if page uses structured content
+ 			}
+ 			*/
+-			char * mbuffer = nullptr;
+-			long mlen = 0;
+ 
+ 			// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
++			char* mbuffer = nullptr;
++			long mlen = 0;
+ 			PoDoFo::PdfMemoryOutputStream oStream(1);
+ 			stream->GetCopy(&oStream);
+ 			oStream.Close();
+ 			mlen = oStream.GetLength();
+ 			mbuffer = oStream.TakeBuffer();
+-			if (mbuffer[mlen-1] == '\n')
++			if (mbuffer[mlen - 1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+ 			nextObj = contentsDict.FindKey("Filter");
+@@ -9893,7 +10168,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 				EncodeArrayToStream(buffer, xObj);
+ 			}  // disconnect QByteArray from raw data
+-			free (mbuffer);
++			free(mbuffer);
+ 			PutDoc("\nendstream");
+ 			writer.endObj(xObj);
+ 			// write resources
+@@ -9915,18 +10190,19 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PoDoFo::PdfVecObjects* allObjects = contents->GetOwner();
+ 			for (int i=0; i < referencedObjects.size(); ++i)
+ 			{
+-				nextObj = allObjects->GetObject(referencedObjects[i]);
+-				copyPoDoFoObject(nextObj, importedObjects[nextObj->Reference()], importedObjects);
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects->GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
+ 			}
+ 
+ 			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
+ 			imgInfo.ResNum = ResCount;
+ 			ResCount++;
+ 			// Avoid a divide-by-zero if width/height are less than 1 point:
+-			imgInfo.Width  = qMax(1, (int) imgWidth);
++			imgInfo.Width = qMax(1, (int) imgWidth);
+ 			imgInfo.Height = qMax(1, (int) imgHeight);
+-			imgInfo.xa  = sx * imgWidth / imgInfo.Width;
+-			imgInfo.ya  = sy * imgHeight / imgInfo.Height;
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
+ 			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
+ 			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
+ 			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
+@@ -9934,7 +10210,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 
+ 			return true;
+ 		}
+-		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Array)//Page contents might be an array
++		if (contents && contents->GetDataType() == PoDoFo::ePdfDataType_Array)//Page contents might be an array
+ 		{
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+@@ -9947,7 +10223,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9966,14 +10242,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-								 + Pdf::toPdf(pageM.m12()) + " "
+-								 + Pdf::toPdf(pageM.m21()) + " "
+-								 + Pdf::toPdf(pageM.m22()) + " "
+-								 + Pdf::toPdf(pageM.dx())  + " "
+-								 + Pdf::toPdf(pageM.dy())  + " ");
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfObject* pageObj = page->GetObject();
+ 			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+ 			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+@@ -9982,11 +10257,10 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+ 
+-			char * mbuffer = nullptr;
+-			long mlen = 0;
+ 			// copied from podofoimpose
+-			PoDoFo::PdfMemoryOutputStream outMemStream (1);
+-//			PoDoFo::PdfFilteredEncodeStream outMemStream (outMemStreamRaw, ePdfFilter_FlateDecode, false);
++			char* mbuffer = nullptr;
++			long mlen = 0;
++			PoDoFo::PdfMemoryOutputStream outMemStream(1);
+ 			PoDoFo::PdfArray carray(page->GetContents()->GetArray());
+ 			for (unsigned int ci = 0; ci < carray.size(); ++ci)
+ 			{
+@@ -10000,7 +10274,6 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 
+ 					while (nextObj != nullptr)
+ 					{
+-
+ 						if (nextObj->IsReference())
+ 						{
+ 							nextObj = doc->GetObjects().GetObject(nextObj->GetReference());
+@@ -10016,29 +10289,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			// end of copy
+ 			mlen = outMemStream.GetLength();
+ 			mbuffer = outMemStream.TakeBuffer();
+-//			if (mbuffer[mlen-1] == '\n')
+-//				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+-/*
+-			nextObj = contentsDict.FindKey("Filter");
+-			if (nextObj)
+-			{
+-				PutDoc("\n/Filter ");
+-				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+-			}
+-			nextObj = contentsDict.FindKey("DecodeParms");
+-			if (nextObj)
+-			{
+-				PutDoc("\n/DecodeParms ");
+-				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+-			}
+-*/
+ 			PutDoc("\n>>\nstream\n");
+ 			{
+ 				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 				EncodeArrayToStream(buffer, xObj);
+ 			}  // disconnect QByteArray from raw data
+-			free (mbuffer);
++			free(mbuffer);
+ 			PutDoc("\nendstream");
+ 			writer.endObj(xObj);
+ 			// write resources
+@@ -10058,20 +10315,21 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			}
+ 			// write referenced objects
+ 			PoDoFo::PdfVecObjects* allObjects = contents->GetOwner();
+-			for (int i=0; i < referencedObjects.size(); ++i)
++			for (int i = 0; i < referencedObjects.size(); ++i)
+ 			{
+-				nextObj = allObjects->GetObject(referencedObjects[i]);
+-				copyPoDoFoObject(nextObj, importedObjects[nextObj->Reference()], importedObjects);
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects->GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
+ 			}
+ 
+ 			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
+ 			imgInfo.ResNum = ResCount;
+ 			ResCount++;
+ 			// Avoid a divide-by-zero if width/height are less than 1 point:
+-			imgInfo.Width  = qMax(1, (int) imgWidth);
++			imgInfo.Width = qMax(1, (int) imgWidth);
+ 			imgInfo.Height = qMax(1, (int) imgHeight);
+-			imgInfo.xa  = sx * imgWidth / imgInfo.Width;
+-			imgInfo.ya  = sy * imgHeight / imgInfo.Height;
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
+ 			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
+ 			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
+ 			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
+@@ -10079,24 +10337,76 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 
+ 			return true;
+ 		}
+-
+ 	}
+-	catch(PoDoFo::PdfError& e)
++	catch (PoDoFo::PdfError& e)
+ 	{
+ 		fatalError = true;
+ 		qDebug() << "PoDoFo error!";
+ 		e.PrintErrorMsg();
+ 		return false;
+ 	}
+-#endif
++#endif // PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0)
++
++#endif // HAVE_PODOFO
+ 	return false;
+ }
+ 
+ 
+ #if HAVE_PODOFO
+ 
+-void PDFLibCore::copyPoDoFoDirect(const PoDoFo::PdfVariant* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, PdfId>& importedObjects)
++void PDFLibCore::copyPoDoFoDirect(const PoDoFo::PdfObject* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, PdfId>& importedObjects)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++	switch (obj->GetDataType())
++	{
++	case PoDoFo::PdfDataType::Reference:
++	{
++		const PoDoFo::PdfReference& reference(obj->GetReference());
++		PdfId objNr;
++		if (!importedObjects.contains(reference))
++		{
++			objNr = writer.newObject();
++			importedObjects[reference] = objNr;
++			referencedObjects.append(reference);
++		}
++		else
++		{
++			objNr = importedObjects[reference];
++		}
++		PutDoc(" " + Pdf::toPdf(objNr) + " 0 R");
++		break;
++	}
++	case PoDoFo::PdfDataType::Array:
++	{
++		const PoDoFo::PdfArray& array(obj->GetArray());
++		PutDoc("[");
++		for (uint i = 0; i < array.size(); ++i)
++			copyPoDoFoDirect(&(array[i]), referencedObjects, importedObjects);
++		PutDoc("]");
++		break;
++	}
++	case PoDoFo::PdfDataType::Dictionary:
++	{
++		const PoDoFo::PdfDictionary& dict(obj->GetDictionary());
++		PutDoc("<<");
++		for (auto k = dict.begin(); k != dict.end(); ++k)
++		{
++			std::string str("\n/" + k->first.GetEscapedName());
++			PutDoc(QByteArray::fromRawData(str.data(), str.size()));
++			copyPoDoFoDirect(&k->second, referencedObjects, importedObjects);
++		}
++		PutDoc(" >>");
++		break;
++	}
++	default:
++	{
++		std::string str;
++		obj->GetVariant().ToString(str);
++		str = " " + str;
++		PutDoc(QByteArray::fromRawData(str.data(), str.size()));
++	}
++	}
++#else
+ 	switch (obj->GetDataType())
+ 	{
+ 		case PoDoFo::ePdfDataType_Reference:
+@@ -10147,11 +10457,41 @@ void PDFLibCore::copyPoDoFoDirect(const
+ 			PutDoc(QByteArray::fromRawData(str.data(), str.size()));
+ 		}
+ 	}
+-
++#endif
+ }
+ 
+ void PDFLibCore::copyPoDoFoObject(const PoDoFo::PdfObject* obj, PdfId scObjID, QMap<PoDoFo::PdfReference, PdfId>& importedObjects)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++	const PoDoFo::PdfIndirectObjectList& allObjects = obj->GetDocument()->GetObjects();
++	QList<PoDoFo::PdfReference> referencedObjects;
++	writer.startObj(scObjID);
++	copyPoDoFoDirect(obj, referencedObjects, importedObjects);
++	if (obj->HasStream())
++	{
++		const PoDoFo::PdfObjectStream* stream = obj->GetStream();
++		PoDoFo::charbuff strBuff = stream->GetCopy(true);
++		const char* mbuffer = strBuff.c_str();
++		size_t mlen = strBuff.size();
++		if (mbuffer[mlen - 1] == '\n')
++			--mlen;
++		PutDoc("\nstream\n");
++		{
++			QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
++			EncodeArrayToStream(buffer, scObjID);
++		}
++		PutDoc("\nendstream");
++	}
++	PutDoc("");
++	writer.endObj(scObjID);
++	// recurse:
++	for (int i = 0; i < referencedObjects.size(); ++i)
++	{
++		const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++		const PoDoFo::PdfObject* nextObj = allObjects.GetObject(pdfRef);
++		copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
++	}
++#else
+ 	PoDoFo::PdfVecObjects* allObjects = obj->GetOwner();
+ 	QList<PoDoFo::PdfReference> referencedObjects;
+ 	writer.startObj(scObjID);
+@@ -10159,7 +10499,7 @@ void PDFLibCore::copyPoDoFoObject(const
+ 	if (obj->HasStream())
+ 	{
+ 		const PoDoFo::PdfStream* stream = obj->GetStream();
+-		char * mbuffer = nullptr;
++		char* mbuffer = nullptr;
+ 		long mlen = 0;
+ 
+ 		// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
+@@ -10168,14 +10508,14 @@ void PDFLibCore::copyPoDoFoObject(const
+ 		oStream.Close();
+ 		mlen = oStream.GetLength();
+ 		mbuffer = oStream.TakeBuffer();
+-		if (mbuffer[mlen-1] == '\n')
++		if (mbuffer[mlen - 1] == '\n')
+ 			--mlen;
+ 		PutDoc("\nstream\n");
+ 		{
+ 			QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 			EncodeArrayToStream(buffer, scObjID);
+ 		}  // disconnect QByteArray from raw data
+-		free (mbuffer);
++		free(mbuffer);
+ 		PutDoc("\nendstream");
+ 	}
+ 	PutDoc("");
+@@ -10183,9 +10523,11 @@ void PDFLibCore::copyPoDoFoObject(const
+ 	// recurse:
+ 	for (int i=0; i < referencedObjects.size(); ++i)
+ 	{
+-		PoDoFo::PdfObject* nextObj = allObjects->GetObject(referencedObjects[i]);
+-		copyPoDoFoObject(nextObj, importedObjects[nextObj->Reference()], importedObjects);
++		const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++		const PoDoFo::PdfObject* nextObj = allObjects->GetObject(pdfRef);
++		copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
+ 	}
++#endif
+ }
+ #endif
+ 
+--- a/scribus/pdflib_core.h
++++ b/scribus/pdflib_core.h
+@@ -225,8 +225,8 @@ private:
+ 	bool    PDF_Image(PageItem* c, const QString& fn, double sx, double sy, double x, double y, bool fromAN = false, const QString& Profil = "", bool Embedded = false, eRenderIntent Intent = Intent_Relative_Colorimetric, QByteArray* output = nullptr);
+ 	bool    PDF_EmbeddedPDF(PageItem* c, const QString& fn, double sx, double sy, double x, double y, ShIm& imgInfo, bool &fatalError);
+ #if HAVE_PODOFO
+-	void copyPoDoFoObject(const PoDoFo::PdfObject* obj, uint scObjID, QMap<PoDoFo::PdfReference, uint>& importedObjects);
+-	void copyPoDoFoDirect(const PoDoFo::PdfVariant* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, uint>& importedObjects);
++	void copyPoDoFoObject(const PoDoFo::PdfObject* obj, PdfId scObjID, QMap<PoDoFo::PdfReference, uint>& importedObjects);
++	void copyPoDoFoDirect(const PoDoFo::PdfObject* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, uint>& importedObjects);
+ #endif
+ 
+ 	quint32 encode32dVal(double val) const;
+--- a/scribus/plugins/import/ai/importai.cpp
++++ b/scribus/plugins/import/ai/importai.cpp
+@@ -581,13 +581,24 @@ bool AIPlug::extractFromPDF(const QStrin
+ 	}
+ 	try
+ 	{
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PoDoFo::PdfError::EnableDebug( false );
+ 		PoDoFo::PdfError::EnableLogging( false );
+-		PoDoFo::PdfMemDocument doc( infile.toLocal8Bit().data() );
++#endif
++		PoDoFo::PdfMemDocument doc;
++		doc.Load(infile.toLocal8Bit().data());
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PoDoFo::PdfPage* curPage = &(doc.GetPages().GetPageAt(0));
++#else
+ 		PoDoFo::PdfPage *curPage = doc.GetPage(0);
++#endif
+ 		if (curPage != nullptr)
+ 		{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++			PoDoFo::PdfObject* pageObj = &(curPage->GetObject());
++#else
+ 			PoDoFo::PdfObject* pageObj = curPage->GetObject();
++#endif
+ 			PoDoFo::PdfDictionary* pageDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+ 			PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
+ 			if (piece != nullptr)
+@@ -618,6 +629,33 @@ bool AIPlug::extractFromPDF(const QStrin
+ 					}
+ 					if (data != nullptr)
+ 					{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++						if (num == 2)
++						{
++							Key = name.arg(1);
++							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							PoDoFo::PdfObjectStream const* stream = data->GetStream();
++							PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++							qint64 bLen = strBuffer.size();
++							const char* Buffer = strBuffer.c_str();
++							outf.write(Buffer, bLen);
++						}
++						else
++						{
++							for (int a = 2; a < num; a++)
++							{
++								Key = name.arg(a);
++								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++								if (data == nullptr)
++									break;
++								PoDoFo::PdfObjectStream const* stream = data->GetStream();
++								PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++								qint64 bLen = strBuffer.size();
++								const char* Buffer = strBuffer.c_str();
++								outf.write(Buffer, bLen);
++							}
++						}
++#else
+ 						if (num == 2)
+ 						{
+ 							Key = name.arg(1);
+@@ -649,6 +687,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 								free( Buffer );
+ 							}
+ 						}
++#endif
+ 					}
+ 					ret = true;
+ 				}
diff --git a/srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch b/srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch
new file mode 100644
index 0000000000000..750d8fa0a9440
--- /dev/null
+++ b/srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch
@@ -0,0 +1,853 @@
+From 000d73d22b362a010bd4c80e6076343bc62119f3 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 16 Aug 2023 20:54:40 +0000
+Subject: [PATCH 10/13] #17005: Restore compatibility with podofo <= 0.9.6
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25604 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 6ca4984f122b46a6ab03300efab6b858b5c77a2d)
+---
+ scribus/pdf_analyzer.cpp               | 274 +++++++++++++++++++++----
+ scribus/pdflib_core.cpp                |  80 ++++----
+ scribus/plugins/import/ai/importai.cpp | 134 +++++++-----
+ 3 files changed, 350 insertions(+), 138 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -30,10 +30,6 @@ for which a new license (GPL+exception)
+ #ifdef HAVE_PODOFO
+ using namespace PoDoFo;
+ 
+-#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+-#define IsRealStrict IsReal
+-#endif
+-
+ static QHash<QString, PDFContentStreamKeyword> kwNameMap;
+ 
+ // we gonna need a map from string values to the defined enum of pdf keywords
+@@ -184,6 +180,7 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ 
+ bool PDFAnalyzer::inspectCanvas(PdfCanvas* canvas, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
+ 	PdfDictionary* colorSpacesDict { nullptr };
+ 	PdfDictionary* xObjectsDict { nullptr };
+@@ -198,21 +195,12 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		// get hold of a PdfObject pointer of this canvas
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PdfObject* canvasObject = page ? &(page->GetObject()) : &(dynamic_cast<PdfXObject*>(canvas)->GetObject());
+-
+-#else
+-		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
+-#endif
+ 		PdfDictionary* canvasDict = (canvasObject && canvasObject->IsDictionary()) ? &(canvasObject->GetDictionary()) : nullptr;
+ 
+ 		// find a resource with ColorSpace entry
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PdfResources* canvasRsrc = canvas->GetResources();
+ 		PdfObject* resources = &(canvasRsrc->GetObject());
+-#else
+-		PdfObject* resources = canvas->GetResources();
+-#endif
+ 		for (PdfDictionary* par = canvasDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+ 			resources = par->FindKey("Resources");
+@@ -262,26 +250,24 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 
+ 	try
+ 	{
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 		// start parsing the content stream
+ 		PdfContentReaderArgs tokenizerArgs = { PdfContentReaderFlags::DontFollowXObjectForms };
+ 		PdfContentStreamReader tokenizer(*canvas, tokenizerArgs);
+ 		PdfContent pdfContent;
+ 		PdfVariant var;
+-		bool readToken;
+ 
+ 		int tokenNumber = 0;
+ 		bool inlineImgDict = false;
+ 		QList<PdfVariant> args;
+ 		QStack<PDFGraphicState> gsStack;
+ 		PDFGraphicState currGS;
+-		while ((readToken = tokenizer.TryReadNext(pdfContent)))
++		while (tokenizer.TryReadNext(pdfContent))
+ 		{
+ 			++tokenNumber;
+ 			if (pdfContent.Type == PdfContentType::Operator)
+ 			{
+ 				args.clear();
+-				int stackSize = pdfContent.Stack.size();
++				size_t stackSize = pdfContent.Stack.size();
+ 				for (size_t i = 0; i < stackSize; ++i)
+ 					args.append(pdfContent.Stack[stackSize - 1 - i]);
+ 				switch (pdfContent.Operator)
+@@ -669,7 +655,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 			if (pdfContent.Type == PdfContentType::DoXObject)
+ 			{
+ 				args.clear();
+-				int stackSize = pdfContent.Stack.size();
++				size_t stackSize = pdfContent.Stack.size();
+ 				for (size_t i = 0; i < stackSize; ++i)
+ 					args.append(pdfContent.Stack[stackSize - 1 - i]);
+ 				if (!processedNamedXObj.contains(args[0].GetName()))
+@@ -723,7 +709,73 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 				}
+ 			}
+ 		}
++	}
++	catch (PdfError & e)
++	{
++		qDebug() << "Error in parsing content stream File:" << m_filename;
++		e.PrintErrorMsg();
++		return false;
++	}
++	return true;
+ #else
++	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
++	PdfObject* colorSpaceRes { nullptr };
++	PdfObject* xObjects { nullptr };
++	PdfObject* transGroup { nullptr };
++	PdfObject* extGState { nullptr };
++	PdfObject* fontRes { nullptr };
++	QMap<PdfName, PDFColorSpace> processedNamedCS;
++	QMap<PdfName, PDFFont> processedNamedFont;
++	QList<PdfName> processedNamedXObj;
++	QList<PdfName> processedNamedGS;
++	try
++	{
++		// get hold of a PdfObject pointer of this canvas
++		// needed for the finding resources code below to work
++		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
++		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++
++		// find a resource with ColorSpace entry
++		PdfObject* resources = canvas->GetResources();
++		for (PdfObject* par = canvasObject; par && !resources; par = par->GetIndirectKey("Parent"))
++		{
++			resources = par->GetIndirectKey("Resources");
++		}
++		colorSpaceRes = resources ? resources->GetIndirectKey("ColorSpace") : nullptr;
++		xObjects = resources ? resources->GetIndirectKey("XObject") : nullptr;
++		extGState = resources ? resources->GetIndirectKey("ExtGState") : nullptr;
++		fontRes = resources ? resources->GetIndirectKey("Font") : nullptr;
++
++		// getting the transparency group of this content stream (if available)
++		transGroup = canvasObject ? canvasObject->GetIndirectKey("Group") : nullptr;
++		if (transGroup)
++		{
++			PdfObject* subtype = transGroup->GetIndirectKey("S");
++			if (subtype && subtype->GetName() == "Transparency")
++			{
++				// having transparency group means there's transparency in the PDF
++				hasTransparency = true;
++
++				// reporting the color space used in transparency group (Section 7.5.5, PDF 1.6 Spec)
++				PdfObject* cs = transGroup->GetIndirectKey("CS");
++				if (cs)
++				{
++					PDFColorSpace retval = getCSType(cs);
++					if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++						usedColorSpaces.append(retval);
++				}
++			}
++		}
++	}
++	catch (PdfError & e)
++	{
++		qDebug() << "Error in analyzing stream's resources. File:" << m_filename;
++		e.PrintErrorMsg();
++		return false;
++	}
++
++	try
++	{
+ 		// start parsing the content stream
+ 		PdfContentsTokenizer tokenizer(canvas);
+ 		EPdfContentsType t;
+@@ -880,9 +932,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -949,9 +1001,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -1003,29 +1055,28 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedXObj.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && xObjectsDict)
++						if (args.size() == 1 && args[0].IsName() && xObjects)
+ 						{
+-							PdfObject* xObject = xObjectsDict->FindKey(args[0].GetName());
+-							PdfDictionary* xObjectDict = (xObject && xObject->IsDictionary()) ? &(xObject->GetDictionary()) : nullptr;
+-							PdfObject* subtypeObject = xObjectDict ? xObjectDict->FindKey("Subtype") : nullptr;
++							PdfObject* xObject = xObjects->GetIndirectKey(args[0].GetName());
++							PdfObject* subtypeObject = xObject ? xObject->GetIndirectKey("Subtype") : nullptr;
+ 							if (subtypeObject && subtypeObject->IsName())
+ 							{
+ 								if (subtypeObject->GetName() == "Image")
+ 								{
+-									PdfObject* imgColorSpace = xObjectDict->FindKey("ColorSpace");
++									PdfObject* imgColorSpace = xObject->GetIndirectKey("ColorSpace");
+ 									if (imgColorSpace)
+ 									{
+ 										PDFColorSpace retval = getCSType(imgColorSpace);
+ 										if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 											usedColorSpaces.append(retval);
+ 									}
+-									PdfObject* sMaskObj = xObjectDict->FindKey("SMask");
++									PdfObject* sMaskObj = xObject->GetIndirectKey("SMask");
+ 									if (sMaskObj)
+ 										hasTransparency = true;
+ 									PDFImage img;
+ 									img.imgName = args[0].GetName().GetEscapedName().c_str();
+-									double width = xObjectDict->FindKey("Width")->GetReal();
+-									double height = xObjectDict->FindKey("Height")->GetReal();
++									double width = xObject->GetIndirectKey("Width")->GetReal();
++									double height = xObject->GetIndirectKey("Height")->GetReal();
+ 									img.dpiX = qRound(width/(currGS.ctm.m11()/72));
+ 									img.dpiY = qRound(height/(currGS.ctm.m22()/72));
+ 									imgs.append(img);
+@@ -1074,9 +1125,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 									usedColorSpaces.append(CS_DeviceCMYK);
+ 								else if (!processedNamedCS.contains(csName))
+ 								{
+-									if (colorSpacesDict && colorSpacesDict->FindKey(csName))
++									if (colorSpaceRes && colorSpaceRes->GetIndirectKey(csName))
+ 									{
+-										PdfObject* csEntry = colorSpacesDict->FindKey(csName);
++										PdfObject* csEntry = colorSpaceRes->GetIndirectKey(csName);
+ 										if (csEntry)
+ 										{
+ 											PDFColorSpace retval = getCSType(csEntry);
+@@ -1116,9 +1167,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedGS.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && extGStatesDict)
++						if (args.size() == 1 && args[0].IsName() && extGState)
+ 						{
+-							PdfObject* extGStateObj = extGStatesDict->FindKey(args[0].GetName());
++							PdfObject* extGStateObj = extGState->GetIndirectKey(args[0].GetName());
+ 							if (extGStateObj)
+ 							{
+ 								inspectExtGStateObj(extGStateObj, usedColorSpaces, hasTransparency, usedFonts, currGS);
+@@ -1147,9 +1198,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					}
+ 					else
+ 					{
+-						if (args.size() == 2 && args[0].IsName() && fontsDict)
++						if (args.size() == 2 && args[0].IsName() && fontRes)
+ 						{
+-							PdfObject* fontObj = fontsDict->FindKey(args[0].GetName());
++							PdfObject* fontObj = fontRes->GetIndirectKey(args[0].GetName());
+ 							if (fontObj)
+ 							{
+ 								PDFFont retval = getFontInfo(fontObj);
+@@ -1179,7 +1230,6 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 				args.clear();
+ 			}
+ 		}
+-#endif
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -1188,10 +1238,12 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		return false;
+ 	}
+ 	return true;
++#endif
+ }
+ 
+ void PDFAnalyzer::inspectExtGStateObj(PdfObject* extGStateObj, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, PDFGraphicState & currGS)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	PdfDictionary* extGStateDict = extGStateObj->IsDictionary() ? &(extGStateObj->GetDictionary()) : nullptr;
+ 	PdfObject* bmObj = extGStateDict ? extGStateDict->FindKey("BM") : nullptr;
+ 	if (bmObj && bmObj->IsName())
+@@ -1245,7 +1297,6 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 				currGS.font.first = font;
+ 				currGS.font.second = arr[1].GetReal();
+ 			}
+-
+ 		}
+ 	}
+ 
+@@ -1276,9 +1327,96 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		PdfObject dObjB = dObj->GetArray()[1];
+ 		currGS.dashPattern.second = dObjB.GetNumber();
+ 	}
++#else
++	PdfObject* bmObj = extGStateObj->GetIndirectKey("BM");
++	if (bmObj && bmObj->IsName())
++	{
++		currGS.blendModes.clear();
++		currGS.blendModes.append(bmObj->GetName().GetEscapedName().c_str());
++		if (!(bmObj->GetName() == "Normal" || bmObj->GetName() == "Compatible"))
++			hasTransparency = true;
++	}
++	else if (bmObj && bmObj->IsArray())
++	{
++		PdfArray arr = bmObj->GetArray();
++		currGS.blendModes.clear();
++		for (uint i = 0; i < arr.GetSize(); ++i)
++			currGS.blendModes.append(arr[i].GetName().GetEscapedName().c_str());
++		if (arr[0].IsName() && !(arr[0].GetName() == "Normal" || arr[0].GetName() == "Compatible"))
++			hasTransparency = true;
++	}
++
++	PdfObject* caObj = extGStateObj->GetIndirectKey("ca");
++	if (caObj && (caObj->IsReal() || caObj->IsNumber()))
++	{
++		currGS.fillAlphaConstant = caObj->GetReal();
++		if (caObj->GetReal() < 1)
++			hasTransparency = true;
++	}
++
++	PdfObject* cAObj = extGStateObj->GetIndirectKey("CA");
++	if (cAObj && (cAObj->IsReal() || cAObj->IsNumber()))
++	{
++		if (cAObj->GetReal() < 1)
++			hasTransparency = true;
++	}
++
++	PdfObject* sMaskObj = extGStateObj->GetIndirectKey("SMask");
++	if (sMaskObj && !(sMaskObj->IsName() && sMaskObj->GetName() == "None"))
++		hasTransparency = true;
++
++	PdfObject* fontObj = extGStateObj->GetIndirectKey("Font");
++	if (fontObj && fontObj->IsArray())
++	{
++		PdfArray arr = fontObj->GetArray();
++		if (arr[0].IsReference())
++		{
++			PdfReference ref = arr[0].GetReference();
++			PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
++			if (fontObject)
++			{
++				PDFFont font = getFontInfo(fontObject);
++				usedFonts.append(font);
++				currGS.font.first = font;
++				currGS.font.second = arr[1].GetReal();
++			}
++
++		}
++	}
++
++	PdfObject* lwObj = extGStateObj->GetIndirectKey("LW");
++	if (lwObj)
++		currGS.lineWidth = lwObj->GetReal();
++
++	PdfObject* lcObj = extGStateObj->GetIndirectKey("LC");
++	if (lcObj)
++		currGS.lineCap = lcObj->GetNumber();
++
++	PdfObject* ljObj = extGStateObj->GetIndirectKey("LJ");
++	if (ljObj)
++		currGS.lineJoin = ljObj->GetNumber();
++
++	PdfObject* mlObj = extGStateObj->GetIndirectKey("ML");
++	if (mlObj)
++		currGS.miterLimit = mlObj->GetReal();
++
++	PdfObject* dObj = extGStateObj->GetIndirectKey("D");
++	if (dObj)
++	{
++		PdfObject dObjA = dObj->GetArray()[0];
++		PdfArray dashArr = dObjA.GetArray();
++		currGS.dashPattern.first.clear();
++		for (uint i = 0; i < dashArr.GetSize(); ++i)
++			currGS.dashPattern.first.append(dashArr[i].GetNumber());
++		PdfObject dObjB = dObj->GetArray()[1];
++		currGS.dashPattern.second = dObjB.GetNumber();
++	}
++#endif
+ }
++
+ PDFFont PDFAnalyzer::getFontInfo(PdfObject* fontObj)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	PDFFont currFont;
+ 	const PdfDictionary* fontDict = fontObj->IsDictionary() ? &(fontObj->GetDictionary()) : nullptr;
+ 	if (!fontDict)
+@@ -1307,11 +1445,7 @@ PDFFont PDFAnalyzer::getFontInfo(PdfObje
+ 		if (descendantFonts && descendantFonts->IsArray())
+ 		{
+ 			const PdfReference& refDescFont = descendantFonts->GetArray()[0].GetReference();
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 			PdfObject* descendantFont = descendantFonts->GetDocument()->GetObjects().GetObject(refDescFont);
+-#else
+-			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
+-#endif
+ 			PdfDictionary* descendantFontDict = (descendantFont && descendantFont->IsDictionary()) ? &(descendantFont->GetDictionary()) : nullptr;
+ 			const PdfObject* subtypeDescFont = descendantFontDict->FindKey("Subtype");
+ 			fontDesc = &(descendantFontDict->MustGetKey("FontDescriptor"));
+@@ -1345,6 +1479,62 @@ PDFFont PDFAnalyzer::getFontInfo(PdfObje
+ 		}
+ 	}
+ 	return currFont;
++#else
++	PDFFont currFont;
++	PdfObject* subtype = fontObj->GetIndirectKey("Subtype");
++	if (!subtype || !subtype->IsName())
++		return currFont;
++
++	PdfObject* fontDesc = fontObj->GetIndirectKey("FontDescriptor");
++	if (subtype->GetName() == "Type1")
++		currFont.fontType = F_Type1;
++	else if (subtype->GetName() == "MMType1")
++		currFont.fontType = F_MMType1;
++	else if (subtype->GetName() == "TrueType")
++		currFont.fontType = F_TrueType;
++	else if (subtype->GetName() == "Type3")
++	{
++		currFont.fontType = F_Type3;
++		currFont.isEmbedded = true;
++		fontDesc = nullptr;
++	}
++	else if (subtype->GetName() == "Type0")
++	{
++		PdfObject* descendantFonts = fontObj->GetIndirectKey("DescendantFonts");
++		if (descendantFonts && descendantFonts->IsArray())
++		{
++			PdfReference refDescFont = descendantFonts->GetArray()[0].GetReference();
++			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
++			PdfObject* subtypeDescFont = descendantFont->GetIndirectKey("Subtype");
++			fontDesc = descendantFont->MustGetIndirectKey("FontDescriptor");
++			if (subtypeDescFont && subtypeDescFont->IsName())
++			{
++				if (subtypeDescFont->GetName() == "CIDFontType0")
++					currFont.fontType = F_CIDFontType0;
++				else if (subtypeDescFont->GetName() == "CIDFontType2")
++					currFont.fontType = F_CIDFontType2;
++			}
++		}
++	}
++	if (fontDesc)
++	{
++		PdfObject* fontFile = fontDesc->GetIndirectKey("FontFile");
++		PdfObject* fontFile2 = fontDesc->GetIndirectKey("FontFile2");
++		PdfObject* fontFile3 = fontDesc->GetIndirectKey("FontFile3");
++		if (fontFile && fontFile->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile2 && fontFile2->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile3 && fontFile3->HasStream())
++		{
++			currFont.isEmbedded = true;
++			PdfObject* ff3Subtype = fontFile3->GetIndirectKey("Subtype");
++			if (ff3Subtype && ff3Subtype->IsName() && ff3Subtype->GetName() == "OpenType")
++				currFont.isOpenType = true;
++		}
++	}
++	return currFont;
++#endif
+ }
+ #else
+ PDFAnalyzer::PDFAnalyzer(QString & filename) : QObject()
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9826,7 +9826,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page.GetRotationRaw();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9845,11 +9845,11 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx()) + " "
++								 + Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+ 			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
+@@ -9947,7 +9947,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page.GetRotationRaw();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9966,11 +9966,11 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx()) + " "
++								 + Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+ 			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
+@@ -10072,20 +10072,16 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ #else
+ 	try
+ 	{
+-		PoDoFo::PdfPage* page = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
+-		PoDoFo::PdfObject* pageObj = page ? page->GetObject() : nullptr;
+-		PoDoFo::PdfObject* contents = page ? page->GetContents() : nullptr;
++		PoDoFo::PdfPage*   page      = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
++		PoDoFo::PdfObject* pageObj   = page ? page->GetObject() : nullptr;
++		PoDoFo::PdfObject* contents  = page ? page->GetContents() : nullptr;
+ 		PoDoFo::PdfObject* resources = page ? page->GetResources() : nullptr;
+-		PoDoFo::PdfDictionary* pageObjDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+-		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
++		for (PoDoFo::PdfObject* par = pageObj; par && !resources; par = par->GetIndirectKey("Parent"))
+ 		{
+-			resources = par->FindKey("Resources");
+-			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
+-			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
++			resources = par->GetIndirectKey("Resources");
+ 		}
+-		if (contents && contents->GetDataType() == PoDoFo::ePdfDataType_Dictionary)
++		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Dictionary)
+ 		{
+-			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
+ 			PoDoFo::PdfStream* stream = contents->GetStream();
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+@@ -10098,7 +10094,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -10117,22 +10113,21 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx())  + " "
++								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+-			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			nextObj = page->GetObject()->GetIndirectKey("Group");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+ 			/*
+-			PoDoFo::PdfObject parents = pageDict->FindKey("StructParents");
++			PoDoFo::PdfObject parents = page->GetObject()->GetIndirectKey("StructParents");
+ 			if (parents)
+ 			{
+ 				xParents = writer.newObject();
+@@ -10151,13 +10146,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			if (mbuffer[mlen - 1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+-			nextObj = contentsDict.FindKey("Filter");
++			nextObj = contents->GetIndirectKey("Filter");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Filter ");
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+-			nextObj = contentsDict.FindKey("DecodeParms");
++			nextObj = contents->GetIndirectKey("DecodeParms");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/DecodeParms ");
+@@ -10168,7 +10163,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 				EncodeArrayToStream(buffer, xObj);
+ 			}  // disconnect QByteArray from raw data
+-			free(mbuffer);
++			free (mbuffer);
+ 			PutDoc("\nendstream");
+ 			writer.endObj(xObj);
+ 			// write resources
+@@ -10223,7 +10218,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -10242,15 +10237,14 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx())  + " "
++								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+-			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			nextObj = page->GetObject()->GetIndirectKey("Group");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+@@ -10326,7 +10320,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			imgInfo.ResNum = ResCount;
+ 			ResCount++;
+ 			// Avoid a divide-by-zero if width/height are less than 1 point:
+-			imgInfo.Width = qMax(1, (int) imgWidth);
++			imgInfo.Width  = qMax(1, (int) imgWidth);
+ 			imgInfo.Height = qMax(1, (int) imgHeight);
+ 			imgInfo.xa = sx * imgWidth / imgInfo.Width;
+ 			imgInfo.ya = sy * imgHeight / imgInfo.Height;
+--- a/scribus/plugins/import/ai/importai.cpp
++++ b/scribus/plugins/import/ai/importai.cpp
+@@ -579,87 +579,115 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		qDebug() << "Failed to open QFile outf in AIPlug::extractFromPDF";
+ 		return false;
+ 	}
++
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	try
+ 	{
+-#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+-		PoDoFo::PdfError::EnableDebug( false );
+-		PoDoFo::PdfError::EnableLogging( false );
+-#endif
+ 		PoDoFo::PdfMemDocument doc;
+ 		doc.Load(infile.toLocal8Bit().data());
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+-		PoDoFo::PdfPage* curPage = &(doc.GetPages().GetPageAt(0));
++
++		PoDoFo::PdfPage& curPage = doc.GetPages().GetPageAt(0);
++		PoDoFo::PdfObject& pageObj = curPage.GetObject();
++		PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++		PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
++		if (piece != nullptr)
++		{
++			PoDoFo::PdfDictionary* pieceDict = piece->IsDictionary() ? &(piece->GetDictionary()) : nullptr;
++			PoDoFo::PdfObject *illy = pieceDict ? pieceDict->FindKey("Illustrator") : nullptr;
++			if (illy != nullptr)
++			{
++				PoDoFo::PdfDictionary* illyDict = illy->IsDictionary() ? &(illy->GetDictionary()) : nullptr;
++				PoDoFo::PdfObject *priv = illyDict ? illyDict->FindKey("Private") : nullptr;
++				if (priv == nullptr)
++					priv = illy;
++				int num = 0;
++				PoDoFo::PdfDictionary* privDict = priv->IsDictionary() ? &(priv->GetDictionary()) : nullptr;
++				PoDoFo::PdfObject *numBl = privDict ? privDict->FindKey("NumBlock") : nullptr;
++				if (numBl != nullptr)
++					num = numBl->GetNumber() + 1;
++				if (num == 0)
++					num = 99999;
++				QString name = "AIPrivateData%1";
++				QString Key = name.arg(1);
++				PoDoFo::PdfObject *data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++				if (data == nullptr)
++				{
++					name = "AIPDFPrivateData%1";
++					Key = name.arg(1);
++					data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++				}
++				if (data != nullptr)
++				{
++					if (num == 2)
++					{
++						Key = name.arg(1);
++						data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++						PoDoFo::PdfObjectStream const* stream = data->GetStream();
++						PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++						qint64 bLen = strBuffer.size();
++						const char* Buffer = strBuffer.c_str();
++						outf.write(Buffer, bLen);
++					}
++					else
++					{
++						for (int a = 2; a < num; a++)
++						{
++							Key = name.arg(a);
++							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							if (data == nullptr)
++								break;
++							PoDoFo::PdfObjectStream const* stream = data->GetStream();
++							PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++							qint64 bLen = strBuffer.size();
++							const char* Buffer = strBuffer.c_str();
++							outf.write(Buffer, bLen);
++						}
++					}
++				}
++				ret = true;
++			}
++		}
++		outf.close();
++	}
+ #else
++	try
++	{
++		PoDoFo::PdfError::EnableDebug( false );
++		PoDoFo::PdfError::EnableLogging( false );
++		PoDoFo::PdfMemDocument doc( infile.toLocal8Bit().data() );
+ 		PoDoFo::PdfPage *curPage = doc.GetPage(0);
+-#endif
+ 		if (curPage != nullptr)
+ 		{
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+-			PoDoFo::PdfObject* pageObj = &(curPage->GetObject());
+-#else
+-			PoDoFo::PdfObject* pageObj = curPage->GetObject();
+-#endif
+-			PoDoFo::PdfDictionary* pageDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+-			PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
++			PoDoFo::PdfObject *piece = curPage->GetObject()->GetIndirectKey("PieceInfo");
+ 			if (piece != nullptr)
+ 			{
+-				PoDoFo::PdfDictionary* pieceDict = piece->IsDictionary() ? &(piece->GetDictionary()) : nullptr;
+-				PoDoFo::PdfObject *illy = pieceDict ? pieceDict->FindKey("Illustrator") : nullptr;
++				PoDoFo::PdfObject *illy = piece->GetIndirectKey("Illustrator");
+ 				if (illy != nullptr)
+ 				{
+-					PoDoFo::PdfDictionary* illyDict = illy->IsDictionary() ? &(illy->GetDictionary()) : nullptr;
+-					PoDoFo::PdfObject *priv = illyDict ? illyDict->FindKey("Private") : nullptr;
++					PoDoFo::PdfObject *priv = illy->GetIndirectKey("Private");
+ 					if (priv == nullptr)
+ 						priv = illy;
+ 					int num = 0;
+-					PoDoFo::PdfDictionary* privDict = priv->IsDictionary() ? &(priv->GetDictionary()) : nullptr;
+-					PoDoFo::PdfObject *numBl = privDict ? privDict->FindKey("NumBlock") : nullptr;
++					PoDoFo::PdfObject *numBl = priv->GetIndirectKey("NumBlock");
+ 					if (numBl != nullptr)
+ 						num = numBl->GetNumber() + 1;
+ 					if (num == 0)
+ 						num = 99999;
+ 					QString name = "AIPrivateData%1";
+ 					QString Key = name.arg(1);
+-					PoDoFo::PdfObject *data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++					PoDoFo::PdfObject *data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 					if (data == nullptr)
+ 					{
+ 						name = "AIPDFPrivateData%1";
+ 						Key = name.arg(1);
+-						data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++						data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 					}
+ 					if (data != nullptr)
+ 					{
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 						if (num == 2)
+ 						{
+ 							Key = name.arg(1);
+-							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+-							PoDoFo::PdfObjectStream const* stream = data->GetStream();
+-							PoDoFo::charbuff strBuffer = stream->GetCopy(false);
+-							qint64 bLen = strBuffer.size();
+-							const char* Buffer = strBuffer.c_str();
+-							outf.write(Buffer, bLen);
+-						}
+-						else
+-						{
+-							for (int a = 2; a < num; a++)
+-							{
+-								Key = name.arg(a);
+-								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+-								if (data == nullptr)
+-									break;
+-								PoDoFo::PdfObjectStream const* stream = data->GetStream();
+-								PoDoFo::charbuff strBuffer = stream->GetCopy(false);
+-								qint64 bLen = strBuffer.size();
+-								const char* Buffer = strBuffer.c_str();
+-								outf.write(Buffer, bLen);
+-							}
+-						}
+-#else
+-						if (num == 2)
+-						{
+-							Key = name.arg(1);
+-							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 							PoDoFo::PdfStream const *stream = data->GetStream();
+ 							PoDoFo::PdfMemoryOutputStream oStream(1);
+ 							stream->GetFilteredCopy(&oStream);
+@@ -674,7 +702,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 							for (int a = 2; a < num; a++)
+ 							{
+ 								Key = name.arg(a);
+-								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++								data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 								if (data == nullptr)
+ 									break;
+ 								PoDoFo::PdfStream const *stream = data->GetStream();
+@@ -687,7 +715,6 @@ bool AIPlug::extractFromPDF(const QStrin
+ 								free( Buffer );
+ 							}
+ 						}
+-#endif
+ 					}
+ 					ret = true;
+ 				}
+@@ -695,6 +722,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		}
+ 		outf.close();
+ 	}
++#endif // (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	catch (PoDoFo::PdfError& e)
+ 	{
+ 		outf.close();
+@@ -704,7 +732,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		QFile::remove(outfile);
+ 		return false;
+ 	}
+-#endif
++#endif // HAVE_PODOFO
+ 	return ret;
+ }
+ 
diff --git a/srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch b/srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch
new file mode 100644
index 0000000000000..c01558c04f98d
--- /dev/null
+++ b/srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch
@@ -0,0 +1,22 @@
+From 148fc05557975267b05ebe670822793999ea3e0a Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 5 Jun 2023 21:15:35 +0000
+Subject: [PATCH 11/13] Fix typo
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25504 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit bd2ba29c16218bc715cde93109e6c0b9be48e4be)
+---
+ CMakeLists_Dependencies.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/CMakeLists_Dependencies.cmake
++++ b/CMakeLists_Dependencies.cmake
+@@ -8,7 +8,7 @@ if (WITH_PODOFO)
+ 	if (LIBPODOFO_FOUND)
+ 		message("PoDoFo found OK")
+ 		set(HAVE_PODOFO ON)
+-		if(LIBPODOFO_VERSION VERSION_GREATER "0.10.0")
++		if(LIBPODOFO_VERSION VERSION_GREATER_EQUAL "0.10.0")
+ 			message(STATUS "PoDoFo Version:" ${LIBPODOFO_VERSION})
+ 			if (CMAKE_CXX_STANDARD LESS 17)
+ 				message(STATUS "C++17 is the minimum C++ standard since podofo 0.10.0")
diff --git a/srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch b/srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch
new file mode 100644
index 0000000000000..2d51a8ef9b793
--- /dev/null
+++ b/srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch
@@ -0,0 +1,107 @@
+From 6ae729e1b45f92428168475c316f3b45a8e99d74 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 4 Sep 2023 21:58:38 +0000
+Subject: [PATCH 12/13] Adapt CMake FindLIBPODOFO.cmake to use pkgconfig, and
+ allow custom find path. Still testing.
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25625 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 628a630d7c45d942605ac227c530f9c889395832)
+---
+ cmake/modules/FindLIBPODOFO.cmake        | 48 +++++++++++++++++-------
+ scribus/plugins/import/ai/CMakeLists.txt | 13 +++----
+ 2 files changed, 41 insertions(+), 20 deletions(-)
+
+--- a/cmake/modules/FindLIBPODOFO.cmake
++++ b/cmake/modules/FindLIBPODOFO.cmake
+@@ -12,23 +12,45 @@ if(WIN32)
+ 	endif(NOT DEFINED LIBPODOFO_SHARED)
+ endif(WIN32)
+ 
+-find_path(LIBPODOFO_INCLUDE_DIR
+-	NAMES podofo/podofo.h
+-	PATHS
+-	"${LIBPODOFO_DIR}/include"
+-	"${LIBPODOFO_DIR}/src"
+-	"${LIBPODOFO_DIR}"
++set(LIBPODOFO_FIND_QUIETLY OFF)
++
++find_package(PkgConfig QUIET)
++if(DEFINED LIBPODOFO_DIR_CUSTOM)
++	set(ENV{PKG_CONFIG_PATH} "${LIBPODOFO_DIR_CUSTOM}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
++endif()
++pkg_search_module(libpodofo REQUIRED libpodofo podofo)
++
++if (DEFINED LIBPODOFO_DIR_CUSTOM)
++	find_path(LIBPODOFO_INCLUDE_DIR
++		NAMES podofo/podofo.h
++		PATHS
++		"${LIBPODOFO_DIR_CUSTOM}/include"
++		"${LIBPODOFO_DIR_CUSTOM}"
++		PATH_SUFFIXES podofo
++		NO_DEFAULT_PATH
+ 	)
+ 
+-set(LIBPODOFO_FIND_QUIETLY ON)
++	find_library(LIBPODOFO_LIBRARY
++		NAMES libpodofo podofo
++		PATHS
++		"${LIBPODOFO_DIR_CUSTOM}/lib"
++		"${LIBPODOFO_DIR_CUSTOM}"
++		NO_DEFAULT_PATH
++	)
++else()
++	find_path(LIBPODOFO_INCLUDE_DIR
++		NAMES podofo/podofo.h
++		PATHS
++		${libpodofo_INCLUDE_DIRS}
++	)
+ 
+-find_library(LIBPODOFO_LIBRARY
+-	NAMES libpodofo podofo
+-	PATHS
+-	"${LIBPODOFO_DIR}/lib"
+-	"${LIBPODOFO_DIR}/src"
+-	"${LIBPODOFO_DIR}"
++	find_library(LIBPODOFO_LIBRARY
++		NAMES libpodofo podofo
++		PATHS
++		${libpodofo_LIBRARY_DIRS}
+ 	)
++endif()
++
+ 
+ if(LIBPODOFO_INCLUDE_DIR AND LIBPODOFO_LIBRARY)
+ 	if(NOT LIBPODOFO_CONFIG_H)
+--- a/scribus/plugins/import/ai/CMakeLists.txt
++++ b/scribus/plugins/import/ai/CMakeLists.txt
+@@ -1,14 +1,15 @@
+ include_directories(
+ 	${CMAKE_SOURCE_DIR}
+ 	${CMAKE_SOURCE_DIR}/scribus
+-	${PODOFO_INCLUDES}
++	${LIBPODOFO_INCLUDE_DIR}
+ 	${SCRIBUS_AUTOGEN_INCLUDE_PATH}
+ )
+ 
+ if(HAVE_PODOFO)
+-	include_directories(
+-		${LIBPODOFO_INCLUDE_DIR}
+-	)
++	if(OPENSSL_FOUND)
++		include_directories(${OPENSSL_INCLUDE_DIR})
++	endif()
++	include_directories(BEFORE ${LIBPODOFO_INCLUDE_DIR})
+ endif()
+ 
+ set(IMPORTAI_PLUGIN_SOURCES
+@@ -32,9 +33,7 @@ else()
+ endif()
+ 
+ if(HAVE_PODOFO)
+-	target_link_libraries(${SCRIBUS_IMPORTAI_PLUGIN}
+-		${LIBPODOFO_LIBRARY}
+-	)
++	target_link_libraries(${SCRIBUS_IMPORTAI_PLUGIN} ${LIBPODOFO_LIBRARY})
+ endif()
+ 
+ if(WANT_PCH)
diff --git a/srcpkgs/scribus/patches/cmake-buildtype-none.patch b/srcpkgs/scribus/patches/cmake-buildtype-none.patch
index ea1df49410ed6..95a3da339b29b 100644
--- a/srcpkgs/scribus/patches/cmake-buildtype-none.patch
+++ b/srcpkgs/scribus/patches/cmake-buildtype-none.patch
@@ -1,5 +1,3 @@
-Index: CMakeLists.txt
-===================================================================
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -75,11 +75,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -14,7 +12,7 @@ Index: CMakeLists.txt
  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
  set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
  set(CMAKE_SKIP_BUILD_RPATH TRUE)
-@@ -330,15 +325,6 @@ include (CMakeLists_Directories.cmake)
+@@ -344,15 +339,6 @@ include (CMakeLists_Directories.cmake)
  
  #Convert our simpler command line option to the CMake style
  #None, Debug, Release, .. or custom ones
@@ -27,3 +25,6 @@ Index: CMakeLists.txt
 -if(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
 -	set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Set Release Build Type" FORCE)
 -endif()
+ 
+ set(CMAKE_ENABLE_EXPORTS ON)
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 3138a842546af..a43acf7ccd761 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,7 +1,7 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=12
+revision=13
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
  -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
@@ -9,7 +9,7 @@ hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel
  hunspell-devel poppler-cpp-devel python3-devel harfbuzz-devel
- libgraphicsmagick-devel libpodofo0.9.7-devel libpagemaker-devel libqxp-devel
+ libgraphicsmagick-devel libpodofo-devel libpagemaker-devel libqxp-devel
  libmspub-devel libcdr-devel libfreehand-devel libvisio-devel"
 depends="ghostscript"
 short_desc="Open Source DTP (Desktop Publishing) application"

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Updated] Poppler 23.12.0
  2023-09-17 21:02 [PR PATCH] Poppler 23.09.0 mhmdanas
                   ` (7 preceding siblings ...)
  2023-12-15 23:39 ` [PR PATCH] [Updated] " sgn
@ 2023-12-15 23:40 ` sgn
  2023-12-16  3:12 ` [PR PATCH] [Merged]: " sgn
  2023-12-16 12:48 ` sgn
  10 siblings, 0 replies; 12+ messages in thread
From: sgn @ 2023-12-15 23:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1285 bytes --]

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/mhmdanas/void-packages poppler-23.09.0
https://github.com/void-linux/void-packages/pull/46107

Poppler 23.12.0
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES** (and built all revdeps successfully)

[ci skip]
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/46107.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-poppler-23.09.0-46107.patch --]
[-- Type: text/x-diff, Size: 185071 bytes --]

From 7ae6ba302921ab22b83e1b0505915cea96c754d8 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 1/8] poppler: update to 23.12.0.

---
 common/shlibs            |  2 +-
 srcpkgs/poppler/template | 13 ++++++-------
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 66d0045a2898f..393b7436cefa2 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -345,7 +345,7 @@ libMagickCore-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagickWand-7.Q16HDRI.so.10 libmagick-7.1.0.10_1
 libMagick++-7.Q16HDRI.so.5 libmagick-7.0.11.1_1
 libltdl.so.7 libltdl-2.2.6_1
-libpoppler.so.130 libpoppler-23.08.0_1
+libpoppler.so.133 libpoppler-23.12.0_1
 libpoppler-glib.so.8 poppler-glib-0.18.2_1
 libpoppler-cpp.so.0 poppler-cpp-0.18.2_1
 libpoppler-qt5.so.1 poppler-qt5-0.31.0_1
diff --git a/srcpkgs/poppler/template b/srcpkgs/poppler/template
index 2be3e5ab35e47..456e5c2fecb22 100644
--- a/srcpkgs/poppler/template
+++ b/srcpkgs/poppler/template
@@ -1,18 +1,17 @@
 # Template file for 'poppler'
 #
 # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/poppler-qt5".
-#
-# Revbump libreoffice on SO version bumps.
 pkgname=poppler
-version=23.08.0
+version=23.12.0
 revision=1
-_testVersion=920c89f8f43bdfe8966c8e397e7f67f5302e9435
+_testVersion=400f3ff05b2b1c0ae17797a0bd50e75e35c1f1b1
 create_wrksrc=yes
 build_style=cmake
 build_helper="gir"
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_CPP=ON
  -DENABLE_GLIB=ON -DENABLE_GOBJECT_INTROSPECTION=$(vopt_if gir ON OFF)
- -DENABLE_QT5=OFF -DENABLE_UTILS=ON -DENABLE_BOOST=$(vopt_if boost ON OFF)
+ -DENABLE_QT5=OFF -DENABLE_QT6=OFF -DENABLE_UTILS=ON
+ -DENABLE_BOOST=$(vopt_if boost ON OFF)
  -DTESTDATADIR='${XBPS_BUILDDIR}/poppler-${version}/testdatadir'"
 hostmakedepends="pkg-config glib-devel"
 makedepends="libpng-devel libglib-devel cairo-devel tiff-devel lcms2-devel
@@ -25,8 +24,8 @@ homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz
  https://gitlab.freedesktop.org/poppler/test/-/archive/${_testVersion}/test-${_testVersion}.tar.gz"
-checksum="4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
- ca35f168a18038a2d817ea30d6c7b4ab8294a40a5f5950f3c2a15183ba08c900"
+checksum="beba398c9d37a9b6d02486496635e08f1df3d437cfe61dab2593f47c4d14cdbb
+ 0d850a1d06944671c991be6822b7146ade401b06aad560ff39b254a028074525"
 
 build_options="gir boost"
 build_options_default="gir boost"

From c0ee023c4391bbc9ab23dac69d468c1bb6c31401 Mon Sep 17 00:00:00 2001
From: triallax <triallax@tutanota.com>
Date: Sun, 17 Sep 2023 21:52:28 +0100
Subject: [PATCH 2/8] poppler-qt5: update to 23.12.0.

---
 srcpkgs/poppler-qt5/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/poppler-qt5/template b/srcpkgs/poppler-qt5/template
index 2a48ed659920e..8dc1d149bf0c5 100644
--- a/srcpkgs/poppler-qt5/template
+++ b/srcpkgs/poppler-qt5/template
@@ -4,7 +4,7 @@
 # IT IS SPLIT TO AVOID A CYCLIC DEPENDENCY: qt5 -> cups -> poppler -> qt5.
 #
 pkgname=poppler-qt5
-version=23.08.0
+version=23.12.0
 revision=1
 build_style=cmake
 configure_args="-DENABLE_UNSTABLE_API_ABI_HEADERS=ON -DENABLE_GLIB=OFF
@@ -21,7 +21,7 @@ license="GPL-2.0-or-later, GPL-3.0-or-later"
 homepage="https://poppler.freedesktop.org"
 changelog="https://gitlab.freedesktop.org/poppler/poppler/-/raw/master/NEWS"
 distfiles="https://poppler.freedesktop.org/poppler-${version}.tar.xz"
-checksum=4a4bf7fc903b9f1a2ab7d04b7c5d8220db9bc6261cc73fdb9a826dc272f49aa8
+checksum=beba398c9d37a9b6d02486496635e08f1df3d437cfe61dab2593f47c4d14cdbb
 # fails to find a bunch of files
 make_check=no
 

From c462ba5a32b776ece5d171da9904d18e7f88335a Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 3/8] inkscape: revbump for poppler-23.12.0.

---
 srcpkgs/inkscape/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/inkscape/template b/srcpkgs/inkscape/template
index 916822078cd27..a23bf4e87e61c 100644
--- a/srcpkgs/inkscape/template
+++ b/srcpkgs/inkscape/template
@@ -1,7 +1,7 @@
 # Template file for 'inkscape'
 pkgname=inkscape
 version=1.3.2
-revision=1
+revision=2
 build_style=cmake
 make_check_target="check"
 hostmakedepends="automake gettext glib-devel intltool libgraphicsmagick-devel

From f86926d1720dffa9fe4748a035939796954a95ad Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 4/8] ipe: revbump for poppler-23.12.0.

---
 srcpkgs/ipe/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ipe/template b/srcpkgs/ipe/template
index 65b92385af994..06347934d9897 100644
--- a/srcpkgs/ipe/template
+++ b/srcpkgs/ipe/template
@@ -1,7 +1,7 @@
 # Template file for 'ipe'
 pkgname=ipe
 version=7.2.26
-revision=10
+revision=11
 _tools_commit=v7.2.24.1
 create_wrksrc=yes
 hostmakedepends="pkg-config doxygen qt5-qmake qt5-tools qt5-host-tools"

From d23bc455f92ef7a50832003c607c325818a91223 Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 5/8] kitinerary: revbump for poppler-23.12.0.

---
 srcpkgs/kitinerary/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/kitinerary/template b/srcpkgs/kitinerary/template
index 31236a166ef2c..5575e4dfb57f5 100644
--- a/srcpkgs/kitinerary/template
+++ b/srcpkgs/kitinerary/template
@@ -1,7 +1,7 @@
 # Template file for 'kitinerary'
 pkgname=kitinerary
 version=23.08.0
-revision=1
+revision=2
 build_style=cmake
 hostmakedepends="extra-cmake-modules gettext kcoreaddons pkg-config
  qt5-host-tools qt5-qmake qt5-tools-devel"

From 16840fb2aa77af396f191e64b839acd9e6029e5c Mon Sep 17 00:00:00 2001
From: Mohammed Anas <triallax@tutanota.com>
Date: Tue, 12 Dec 2023 11:48:03 +0000
Subject: [PATCH 6/8] pdf2djvu: revbump for poppler-23.12.0.

Close: #46107
---
 srcpkgs/pdf2djvu/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/pdf2djvu/template b/srcpkgs/pdf2djvu/template
index 5a6f3ddf4ed35..982ce2458751c 100644
--- a/srcpkgs/pdf2djvu/template
+++ b/srcpkgs/pdf2djvu/template
@@ -1,7 +1,7 @@
 # Template file for 'pdf2djvu'
 pkgname=pdf2djvu
 version=0.9.19
-revision=5
+revision=6
 build_style=gnu-configure
 hostmakedepends="pkg-config djvulibre gettext"
 makedepends="djvulibre-devel poppler-devel libgraphicsmagick-devel exiv2-devel libuuid-devel"

From f0f8aeecb8bada626b67b0163649d9ce9063ce6c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 14 Dec 2023 14:01:26 +0700
Subject: [PATCH 7/8] scribus: for poppler 23.12.0

---
 ...r-22.03.0-force-poppler-0.86-minimum.patch |  526 ++++++
 .../0002-poppler-22.03.0-memleak.patch        |   94 +
 .../0005-podofo-0.10-find-podofo.patch        |   37 +
 ...-swap-podofo-poppler-dep-check-order.patch |  109 ++
 .../0007-podofo-0.10-minimum-0.9.0.patch      |   22 +
 .../0008-podofo-0.10-drop-old-compat.patch    |   48 +
 ...dofo-0.10-avoid-confusion-with-m_doc.patch |   67 +
 .../0010-podofo-0.10-indentation-fix.patch    |   22 +
 .../patches/0011-podofo-0.10-code-style.patch |  141 ++
 .../0012-podofo-0.10-preparation.patch        |  514 ++++++
 ...013-podofo-0.10-compat-podofo-0.10.x.patch | 1602 +++++++++++++++++
 ...0014-podofo-0.10-compat-podofo-0.9.6.patch |  853 +++++++++
 .../patches/0015-podofo-0.10-cmake-fix.patch  |   22 +
 .../0016-podofo-0.10-use-pkgconfig.patch      |  107 ++
 .../patches/cmake-buildtype-none.patch        |    7 +-
 srcpkgs/scribus/template                      |    4 +-
 16 files changed, 4170 insertions(+), 5 deletions(-)
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch
 create mode 100644 srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch
 create mode 100644 srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch
 create mode 100644 srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch
 create mode 100644 srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch
 create mode 100644 srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch
 create mode 100644 srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch
 create mode 100644 srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch
 create mode 100644 srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch
 create mode 100644 srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch
 create mode 100644 srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch
 create mode 100644 srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch
 create mode 100644 srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch

diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch
new file mode 100644
index 0000000000000..f205f45dea3d5
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-force-poppler-0.86-minimum.patch
@@ -0,0 +1,526 @@
+From e013e8126d2100e8e56dea5b836ad43275429389 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 2 Mar 2022 22:48:29 +0000
+Subject: [PATCH] Enforce poppler version >= 0.86.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24985 11d20701-8431-0410-a711-e3c959e3b870
+---
+ cmake/modules/Findpoppler.cmake          |   4 +-
+ scribus/plugins/import/pdf/importpdf.cpp |  65 ++-----------
+ scribus/plugins/import/pdf/slaoutput.cpp | 114 -----------------------
+ scribus/plugins/import/pdf/slaoutput.h   |   7 --
+ 4 files changed, 10 insertions(+), 180 deletions(-)
+
+--- a/cmake/modules/Findpoppler.cmake
++++ b/cmake/modules/Findpoppler.cmake
+@@ -1,8 +1,8 @@
+ #include(FindPkgConfig)
+ find_package(PkgConfig QUIET)
+-pkg_search_module(poppler libpoppler>=0.62.0 poppler>=0.62.0)
++pkg_search_module(poppler libpoppler>=0.86.0 poppler>=0.86.0)
+ if (poppler_FOUND)
+-	pkg_search_module(poppler_cpp REQUIRED libpoppler-cpp>=0.62.0 poppler-cpp>=0.62.0)
++	pkg_search_module(poppler_cpp REQUIRED libpoppler-cpp>=0.86.0 poppler-cpp>=0.86.0)
+ endif(poppler_FOUND)
+  
+ find_path(poppler_INCLUDE_DIR
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -75,20 +75,15 @@ PdfPlug::PdfPlug(ScribusDoc* doc, int fl
+ 
+ QImage PdfPlug::readThumbnail(const QString& fName)
+ {
+-	QString pdfFile = QDir::toNativeSeparators(fName);
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
+ 	globalParams.reset(new GlobalParams());
+-#else
+-	std::unique_ptr<GlobalParams> globalParamsPtr(new GlobalParams());
+-	globalParams = globalParamsPtr.get();
+-#endif
++	globalParams->setErrQuiet(gTrue);
+ 
+-#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
++	QString pdfFile = QDir::toNativeSeparators(fName);
++#if defined(Q_OS_WIN32)
+ 	auto fname = new GooString(pdfFile.toUtf8().data());
+ #else
+ 	auto fname = new GooString(QFile::encodeName(pdfFile).data());
+ #endif
+-	globalParams->setErrQuiet(gTrue);
+ 
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+ 	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
+@@ -333,19 +328,15 @@ bool PdfPlug::convert(const QString& fn)
+ 		qApp->processEvents();
+ 	}
+ 
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
+ 	globalParams.reset(new GlobalParams());
+-#else
+-	std::unique_ptr<GlobalParams> globalParamsPtr(new GlobalParams());
+-	globalParams = globalParamsPtr.get();
+-#endif
+-#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
++	globalParams->setErrQuiet(gTrue);
++
++#if defined(Q_OS_WIN32)
+ 	auto fname = new GooString(fn.toUtf8().data());
+ #else
+ 	auto fname = new GooString(QFile::encodeName(fn).data());
+ #endif
+-	globalParams->setErrQuiet(gTrue);
+-//	globalParams->setPrintCommands(gTrue);
++
+ 	QList<OptionalContentGroup*> ocgGroups;
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+ 	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
+@@ -365,7 +356,7 @@ bool PdfPlug::convert(const QString& fn)
+ 			QString text = QInputDialog::getText(mw, tr("Open PDF-File"), tr("Password"), QLineEdit::Normal, "", &ok);
+ 			if (ok && !text.isEmpty())
+ 			{
+-#if defined(Q_OS_WIN32) && POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 62, 0)
++#if defined(Q_OS_WIN32)
+ 				auto fname = new GooString(fn.toUtf8().data());
+ #else
+ 				auto fname = new GooString(QFile::encodeName(fn).data());
+@@ -383,9 +374,6 @@ bool PdfPlug::convert(const QString& fn)
+ 			{
+ 				if (m_progressDialog)
+ 					m_progressDialog->close();
+-#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 83, 0)
+-				delete globalParams;
+-#endif
+ 				return false;
+ 			}
+ 			if (m_progressDialog)
+@@ -495,7 +483,6 @@ bool PdfPlug::convert(const QString& fn)
+ 							}
+ 							else
+ 							{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 69, 0)
+ 								const auto& ocgs = ocg->getOCGs ();
+ 								for (const auto& ocg : ocgs)
+ 								{
+@@ -507,25 +494,11 @@ bool PdfPlug::convert(const QString& fn)
+ 										ocgNames.append(ocgName);
+ 									}
+ 								}
+-#else
+-								GooList *ocgs = ocg->getOCGs ();
+-								for (int i = 0; i < ocgs->getLength (); ++i)
+-								{
+-									OptionalContentGroup *oc = (OptionalContentGroup *)ocgs->get(i);
+-									QString ocgName = UnicodeParsedString(oc->getName());
+-									if (!ocgNames.contains(ocgName))
+-									{
+-										ocgGroups.prepend(oc);
+-										ocgNames.append(ocgName);
+-									}
+-								}
+-#endif
+ 							}
+ 						}
+ 					}
+ 					else
+ 					{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 69, 0)
+ 						const auto& ocgs = ocg->getOCGs ();
+ 						for (const auto& ocg : ocgs)
+ 						{
+@@ -537,19 +510,6 @@ bool PdfPlug::convert(const QString& fn)
+ 								ocgNames.append(ocgName);
+ 							}
+ 						}
+-#else
+-						GooList *ocgs = ocg->getOCGs ();
+-						for (int i = 0; i < ocgs->getLength (); ++i)
+-						{
+-							OptionalContentGroup *oc = (OptionalContentGroup *)ocgs->get(i);
+-							QString ocgName = UnicodeParsedString(oc->getName());
+-							if (!ocgNames.contains(ocgName))
+-							{
+-								ocgGroups.prepend(oc);
+-								ocgNames.append(ocgName);
+-							}
+-						}
+-#endif
+ 					}
+ 				}
+ 
+@@ -788,13 +748,8 @@ bool PdfPlug::convert(const QString& fn)
+ 							names = catDict.dictLookup("OpenAction");
+ 							if (names.isDict())
+ 							{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 								std::unique_ptr<LinkAction> linkActionUPtr = LinkAction::parseAction(&names, pdfDoc->getCatalog()->getBaseURI());
+ 								LinkAction *linkAction = linkActionUPtr.get();
+-#else
+-								LinkAction *linkAction = nullptr;
+-								linkAction = LinkAction::parseAction(&names, pdfDoc->getCatalog()->getBaseURI());
+-#endif
+ 								if (linkAction && (linkAction->getKind() == actionJavaScript))
+ 								{
+ 									LinkJavaScript *jsa = (LinkJavaScript*) linkAction;
+@@ -862,11 +817,7 @@ bool PdfPlug::convert(const QString& fn)
+ 		}
+ 		pdfDoc.reset();
+ 	}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 83, 0)
+ 	globalParams.reset();
+-#else
+-	globalParams = nullptr;
+-#endif
+ 
+ //	qDebug() << "converting finished";
+ //	qDebug() << "Imported" << m_elements.count() << "Elements";
+--- a/scribus/plugins/import/pdf/slaoutput.cpp
++++ b/scribus/plugins/import/pdf/slaoutput.cpp
+@@ -332,15 +332,9 @@ LinkAction* SlaOutputDev::SC_getAction(A
+ }
+ 
+ /* Replacement for the crippled Poppler function LinkAction* AnnotWidget::getAdditionalAction(AdditionalActionsType type) */
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ std::unique_ptr<LinkAction> SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *ano)
+ {
+ 	std::unique_ptr<LinkAction> linkAction;
+-#else
+-LinkAction* SlaOutputDev::SC_getAdditionalAction(const char *key, AnnotWidget *ano)
+-{
+-	LinkAction *linkAction = nullptr;
+-#endif
+ 	Object obj;
+ 	Ref refa = ano->getRef();
+ 
+@@ -467,11 +461,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 				if (dst->isPageRef())
+ 				{
+ 					Ref dstr = dst->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 					pagNum = pdfDoc->findPage(dstr);
+-#else
+-					pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 				}
+ 				else
+ 					pagNum = dst->getPageNum();
+@@ -485,11 +475,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 			POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 			if (ndst)
+ 			{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 				std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-				LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 				if (dstn)
+ 				{
+ 					if (dstn->getKind() == destXYZ)
+@@ -497,11 +483,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 						if (dstn->isPageRef())
+ 						{
+ 							Ref dstr = dstn->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 							pagNum = pdfDoc->findPage(dstr);
+-#else
+-							pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 						}
+ 						else
+ 							pagNum = dstn->getPageNum();
+@@ -533,11 +515,7 @@ bool SlaOutputDev::handleLinkAnnot(Annot
+ 			POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 			if (ndst)
+ 			{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 				std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-				LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 				if (dstn)
+ 				{
+ 					if (dstn->getKind() == destXYZ)
+@@ -985,11 +963,7 @@ void SlaOutputDev::handleActions(PageIte
+ 					if (dst->isPageRef())
+ 					{
+ 						Ref dstr = dst->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 						pagNum = pdfDoc->findPage(dstr);
+-#else
+-						pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 					}
+ 					else
+ 						pagNum = dst->getPageNum();
+@@ -1005,11 +979,7 @@ void SlaOutputDev::handleActions(PageIte
+ 				POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 				if (ndst)
+ 				{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 					std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-					LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 					if (dstn)
+ 					{
+ 						if (dstn->getKind() == destXYZ)
+@@ -1017,11 +987,7 @@ void SlaOutputDev::handleActions(PageIte
+ 							if (dstn->isPageRef())
+ 							{
+ 								Ref dstr = dstn->getPageRef();
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 76, 0)
+ 								pagNum = pdfDoc->findPage(dstr);
+-#else
+-								pagNum = pdfDoc->findPage(dstr.num, dstr.gen);
+-#endif
+ 							}
+ 							else
+ 								pagNum = dstn->getPageNum();
+@@ -1061,11 +1027,7 @@ void SlaOutputDev::handleActions(PageIte
+ 				POPPLER_CONST GooString *ndst = gto->getNamedDest();
+ 				if (ndst)
+ 				{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 					std::unique_ptr<LinkDest> dstn = pdfDoc->findDest(ndst);
+-#else
+-					LinkDest *dstn = pdfDoc->findDest(ndst);
+-#endif
+ 					if (dstn)
+ 					{
+ 						if (dstn->getKind() == destXYZ)
+@@ -1139,143 +1101,91 @@ void SlaOutputDev::handleActions(PageIte
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setD_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("E", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setE_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("X", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setX_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("Fo", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setFo_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("Bl", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setBl_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("C", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setC_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("F", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setF_act(UnicodeParsedString(jsa->getScript()));
+@@ -1283,22 +1193,14 @@ void SlaOutputDev::handleActions(PageIte
+ 				ite->annotation().setFormat(5);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("K", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setK_act(UnicodeParsedString(jsa->getScript()));
+@@ -1306,33 +1208,21 @@ void SlaOutputDev::handleActions(PageIte
+ 				ite->annotation().setFormat(5);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ 	Aact = SC_getAdditionalAction("V", ano);
+ 	if (Aact)
+ 	{
+ 		if (Aact->getKind() == actionJavaScript)
+ 		{
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 			LinkJavaScript *jsa = (LinkJavaScript*) Aact.get();
+-#else
+-			LinkJavaScript *jsa = (LinkJavaScript*) Aact;
+-#endif
+ 			if (jsa->isOk())
+ 			{
+ 				ite->annotation().setV_act(UnicodeParsedString(jsa->getScript()));
+ 				ite->annotation().setAAact(true);
+ 			}
+ 		}
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 		Aact.reset();
+-#else
+-		Aact = nullptr;
+-#endif
+ 	}
+ }
+ 
+@@ -1342,11 +1232,7 @@ void SlaOutputDev::startDoc(PDFDoc *doc,
+ 	catalog = catA;
+ 	pdfDoc = doc;
+ 	updateGUICounter = 0;
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 84, 0)
+ 	m_fontEngine = new SplashFontEngine(true, false, false, true);
+-#else
+-	m_fontEngine = new SplashFontEngine(globalParams->getEnableFreeType(), false, false, true);
+-#endif
+ }
+ 
+ void SlaOutputDev::startPage(int pageNum, GfxState *, XRef *)
+--- a/scribus/plugins/import/pdf/slaoutput.h
++++ b/scribus/plugins/import/pdf/slaoutput.h
+@@ -30,9 +30,6 @@ for which a new license (GPL+exception)
+ #include "selection.h"
+ #include "vgradient.h"
+ 
+-#if POPPLER_ENCODED_VERSION < POPPLER_VERSION_ENCODE(0, 73, 0)
+-#include <poppler/goo/gtypes.h>
+-#endif
+ #include <poppler/Object.h>
+ #include <poppler/OutputDev.h>
+ #include <poppler/Gfx.h>
+@@ -163,11 +160,7 @@ public:
+ 	virtual ~SlaOutputDev();
+ 
+ 	LinkAction* SC_getAction(AnnotWidget *ano);
+-#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(0, 86, 0)
+ 	std::unique_ptr<LinkAction> SC_getAdditionalAction(const char *key, AnnotWidget *ano);
+-#else
+-	LinkAction* SC_getAdditionalAction(const char *key, AnnotWidget *ano);
+-#endif
+ 	static GBool annotations_callback(Annot *annota, void *user_data);
+ 	bool handleTextAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
+ 	bool handleLinkAnnot(Annot* annota, double xCoor, double yCoor, double width, double height);
diff --git a/srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch b/srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch
new file mode 100644
index 0000000000000..d40f35ad966e9
--- /dev/null
+++ b/srcpkgs/scribus/patches/0002-poppler-22.03.0-memleak.patch
@@ -0,0 +1,94 @@
+From 48263954a7dee0be815b00f417ae365ab26cdd85 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Thu, 3 Mar 2022 00:18:06 +0000
+Subject: [PATCH] #16764: Better patch, avoid a memory leak
+
+git-svn-id: svn://scribus.net/trunk/Scribus@24989 11d20701-8431-0410-a711-e3c959e3b870
+---
+ scribus/plugins/import/pdf/importpdf.cpp | 34 +++++++++---------------
+ scribus/util_os.cpp                      |  2 ++
+ 2 files changed, 15 insertions(+), 21 deletions(-)
+
+--- a/scribus/plugins/import/pdf/importpdf.cpp
++++ b/scribus/plugins/import/pdf/importpdf.cpp
+@@ -58,6 +58,7 @@ for which a new license (GPL+exception)
+ #include "util.h"
+ #include "util_formats.h"
+ #include "util_math.h"
++#include "util_os.h"
+ 
+ #include "ui/customfdialog.h"
+ #include "ui/missing.h"
+@@ -79,15 +80,12 @@ QImage PdfPlug::readThumbnail(const QStr
+ 	globalParams->setErrQuiet(gTrue);
+ 
+ 	QString pdfFile = QDir::toNativeSeparators(fName);
+-#if defined(Q_OS_WIN32)
+-	auto fname = new GooString(pdfFile.toUtf8().data());
+-#else
+-	auto fname = new GooString(QFile::encodeName(pdfFile).data());
+-#endif
+-
++	QByteArray encodedFileName = os_is_win() ? pdfFile.toUtf8() : QFile::encodeName(pdfFile);
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+-	PDFDoc pdfDoc{ std::make_unique<GooString>(fname) };
++	auto fname = std::make_unique<GooString>(encodedFileName.data());
++	PDFDoc pdfDoc{ std::move(fname) };
+ #else
++	auto fname = new GooString(encodedFileName.data());
+ 	PDFDoc pdfDoc{fname, nullptr, nullptr, nullptr};
+ #endif
+ 	if (!pdfDoc.isOk() || pdfDoc.getErrorCode() == errEncrypted)
+@@ -331,17 +329,14 @@ bool PdfPlug::convert(const QString& fn)
+ 	globalParams.reset(new GlobalParams());
+ 	globalParams->setErrQuiet(gTrue);
+ 
+-#if defined(Q_OS_WIN32)
+-	auto fname = new GooString(fn.toUtf8().data());
+-#else
+-	auto fname = new GooString(QFile::encodeName(fn).data());
+-#endif
+-
+ 	QList<OptionalContentGroup*> ocgGroups;
++	QByteArray encodedFileName = os_is_win() ? fn.toUtf8() : QFile::encodeName(fn);
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
+-	auto pdfDoc = std::make_unique<PDFDoc>(std::make_unique<GooString>(fname));
++	auto fname = std::make_unique<GooString>(encodedFileName.data());
++	auto pdfDoc = std::make_unique<PDFDoc>(std::move(fname));
+ #else
+-	auto pdfDoc = std::unique_ptr<PDFDoc>(new PDFDoc(fname, nullptr, nullptr, nullptr));
++	auto fname = new GooString(encodedFileName.data());
++	auto pdfDoc = std::make_unique<PDFDoc>(fname, nullptr, nullptr, nullptr);
+ #endif
+ 	if (pdfDoc)
+ 	{
+@@ -356,15 +351,12 @@ bool PdfPlug::convert(const QString& fn)
+ 			QString text = QInputDialog::getText(mw, tr("Open PDF-File"), tr("Password"), QLineEdit::Normal, "", &ok);
+ 			if (ok && !text.isEmpty())
+ 			{
+-#if defined(Q_OS_WIN32)
+-				auto fname = new GooString(fn.toUtf8().data());
+-#else
+-				auto fname = new GooString(QFile::encodeName(fn).data());
+-#endif
+ #if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(22, 3, 0)
++				auto fname = std::make_unique<GooString>(encodedFileName.data());
+ 				std::optional<GooString> userPW(std::in_place, text.toLocal8Bit().data());
+-				pdfDoc.reset(new PDFDoc(std::make_unique<GooString>(fname), userPW, userPW, nullptr));
++				pdfDoc.reset(new PDFDoc(std::move(fname), userPW, userPW, nullptr));
+ #else
++				auto fname = new GooString(encodedFileName.data());
+ 				auto userPW = new GooString(text.toLocal8Bit().data());
+ 				pdfDoc.reset(new PDFDoc(fname, userPW, userPW, nullptr));
+ #endif
+--- a/scribus/util_os.cpp
++++ b/scribus/util_os.cpp
+@@ -22,6 +22,8 @@ for which a new license (GPL+exception)
+ 
+ #include <QtGlobal>
+ 
++#include "util_os.h"
++
+ bool os_is_osx()
+ {
+ #ifdef Q_OS_MACOS
diff --git a/srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch b/srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch
new file mode 100644
index 0000000000000..261428153a96f
--- /dev/null
+++ b/srcpkgs/scribus/patches/0005-podofo-0.10-find-podofo.patch
@@ -0,0 +1,37 @@
+From 3d02faaa2e17eef67826abd52d56b4a9b2b9c1ba Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Sun, 4 Jun 2023 17:00:34 +0000
+Subject: [PATCH 01/13] Update CMake PoDoFo finder to allow for PoDoFo 0.10.0
+ podofo-config.h location
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25493 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit bd70705c05bd383d1a9b3ab12224988ff8475722)
+---
+ cmake/modules/FindLIBPODOFO.cmake | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+--- a/cmake/modules/FindLIBPODOFO.cmake
++++ b/cmake/modules/FindLIBPODOFO.cmake
+@@ -32,7 +32,14 @@ find_library(LIBPODOFO_LIBRARY
+ 
+ if(LIBPODOFO_INCLUDE_DIR AND LIBPODOFO_LIBRARY)
+ 	if(NOT LIBPODOFO_CONFIG_H)
+-		set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h")
++		#PoDoFo before 0.10.0
++		if (EXISTS "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h")
++			set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/base/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h. PoDoFo <=0.10.0")
++		endif()
++		#PoDoFo 0.10.0 or higher
++		if (EXISTS "${LIBPODOFO_INCLUDE_DIR}/podofo/auxiliary/podofo_config.h")
++			set(LIBPODOFO_CONFIG_H "${LIBPODOFO_INCLUDE_DIR}/podofo/auxiliary/podofo_config.h" CACHE FILEPATH "Alternative place of podofo_config.h. PoDoFo >=0.10.0")
++		endif()
+ 	endif()
+ 
+ 	file(STRINGS "${LIBPODOFO_CONFIG_H}" PODOFO_MAJOR_VER_LINE REGEX "^#define[ \t]+PODOFO_VERSION_MAJOR[ \t]+[0-9]+$")
+@@ -79,4 +86,6 @@ if(NOT LIBPODOFO_FIND_QUIETLY)
+ 		message("podofo lib: not found")
+ 	endif(LIBPODOFO_LIBRARY)
+ 	message("PoDoFo cflags: ${useshared}")
++	message("PoDoFo config file ${LIBPODOFO_CONFIG_H}")
++	message("PoDoFo version ${LIBPODOFO_VERSION}")
+ endif(NOT LIBPODOFO_FIND_QUIETLY)
diff --git a/srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch b/srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch
new file mode 100644
index 0000000000000..47c644f418b22
--- /dev/null
+++ b/srcpkgs/scribus/patches/0006-podofo-0.10-swap-podofo-poppler-dep-check-order.patch
@@ -0,0 +1,109 @@
+From 45ed6b8664675d78de1b3dbde2c9684111805811 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 5 Jun 2023 20:57:47 +0000
+Subject: [PATCH 02/13] Swap dependency checking for podofo and poppler to the
+ beginning to force C++17 when their versions require it
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25500 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 81b3cf609ff01400f6f804c98ee58febc4494908)
+---
+ CMakeLists_Dependencies.cmake | 74 +++++++++++++++++++++--------------
+ 1 file changed, 44 insertions(+), 30 deletions(-)
+
+--- a/CMakeLists_Dependencies.cmake
++++ b/CMakeLists_Dependencies.cmake
+@@ -1,6 +1,48 @@
+ ##############################################################################################################
+ ########## Find Dependencies                                                                        ##########
+ 
++#<<PoDoFo for AI PDF import
++option(WITH_PODOFO "Enable support for PDF embedded in AI" ON)
++if (WITH_PODOFO)
++	find_package(LIBPODOFO)
++	if (LIBPODOFO_FOUND)
++		message("PoDoFo found OK")
++		set(HAVE_PODOFO ON)
++		if(LIBPODOFO_VERSION VERSION_GREATER "0.10.0")
++			message(STATUS "PoDoFo Version:" ${LIBPODOFO_VERSION})
++			if (CMAKE_CXX_STANDARD LESS 17)
++				message(STATUS "C++17 is the minimum C++ standard since podofo 0.10.0")
++				message(STATUS "Enabling C++17 compiler features")
++				set(CMAKE_CXX_STANDARD 17)
++			endif()
++		endif()
++	else()
++		message("PoDoFo NOT found - Disabling support for PDF embedded in AI")
++	endif()
++endif()
++#>>PoDoFo for AI PDF import
++
++#<<Poppler for PDF import
++find_package(poppler REQUIRED)
++if (poppler_FOUND)
++	set(HAVE_POPPLER ON)
++	message(STATUS "Found poppler")
++	message(STATUS "Found poppler libs: ${poppler_LIBRARY}")
++	message(STATUS "Found poppler includes: ${poppler_INCLUDE_DIR}")
++	if (poppler_VERSION VERSION_GREATER_EQUAL 22.01.0)
++		message(STATUS "Poppler Version:" ${poppler_VERSION})
++		if (CMAKE_CXX_STANDARD LESS 17)
++			message(STATUS "C++17 is the minimum C++ standard since poppler 22.01.0")
++			message(STATUS "Enabling C++17 compiler features")
++			set(CMAKE_CXX_STANDARD 17)
++		endif()
++	endif()
++else()
++	message(FATAL_ERROR "Could not find poppler library")
++endif()
++#>>Poppler for PDF import
++
++
+ #<< Qt
+ #Qt less than 6
+ set(CMAKE_PREFIX_PATH "${QT_PREFIX}/lib/cmake")
+@@ -257,18 +299,7 @@ if (WANT_HUNSPELL)
+ endif()
+ #>>HUNSPELL for Spelling support
+ 
+-#<<PoDoFo for AI PDF import
+-option(WITH_PODOFO "Enable support for PDF embedded in AI" ON)
+-if (WITH_PODOFO)
+-	find_package(LIBPODOFO)
+-	if (LIBPODOFO_FOUND)
+-		message("PoDoFo found OK")
+-		set(HAVE_PODOFO ON)
+-	else()
+-		message("PoDoFo NOT found - Disabling support for PDF embedded in AI")
+-	endif()
+-endif()
+-#>>PoDoFo for AI PDF import
++
+ 
+ #<<Boost for 2Geom Tools
+ option(WITH_BOOST "Enable support for Boost based enhancements" ON)
+@@ -298,24 +329,7 @@ else()
+ endif()
+ #>> GraphicsMagick for image import
+ 
+-#<<Poppler for PDF import
+-find_package(poppler REQUIRED)
+-if (poppler_FOUND)
+-	set(HAVE_POPPLER ON)
+-	message(STATUS "Found poppler")
+-	message(STATUS "Found poppler libs: ${poppler_LIBRARY}")
+-	message(STATUS "Found poppler includes: ${poppler_INCLUDE_DIR}")
+-	if (poppler_VERSION VERSION_GREATER_EQUAL 22.01.0)
+-		message(STATUS "Poppler Version:" ${poppler_VERSION})
+-		message(STATUS "C++17 is the minimum C++ standard since poppler 22.01.0")
+-		if (CMAKE_CXX_STANDARD LESS 17)
+-			message(FATAL_ERROR "Please set -DWANT_CPP17=ON on your CMake command line")
+-		endif()
+-	endif()
+-else()
+-	message(FATAL_ERROR "Could not find poppler library")
+-endif()
+-#>>Poppler for PDF import
++
+ 
+ # librevenge for MsPub import
+ pkg_check_modules(LIBREVENGE librevenge-0.0)
diff --git a/srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch b/srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch
new file mode 100644
index 0000000000000..d5503bf50d7e6
--- /dev/null
+++ b/srcpkgs/scribus/patches/0007-podofo-0.10-minimum-0.9.0.patch
@@ -0,0 +1,22 @@
+From 2a2c95fda05bbb089c12807261b7a9339635b488 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 5 Jun 2023 21:32:27 +0000
+Subject: [PATCH 03/13] Bump minimum podofo version to 0.9.0
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25506 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 9233e1e20a006155e90e2893cb2a133949ec7a68)
+---
+ CMakeLists_Dependencies.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/CMakeLists_Dependencies.cmake
++++ b/CMakeLists_Dependencies.cmake
+@@ -4,7 +4,7 @@
+ #<<PoDoFo for AI PDF import
+ option(WITH_PODOFO "Enable support for PDF embedded in AI" ON)
+ if (WITH_PODOFO)
+-	find_package(LIBPODOFO)
++	find_package(LIBPODOFO 0.9.0)
+ 	if (LIBPODOFO_FOUND)
+ 		message("PoDoFo found OK")
+ 		set(HAVE_PODOFO ON)
diff --git a/srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch b/srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch
new file mode 100644
index 0000000000000..9cbfd8e3b9abf
--- /dev/null
+++ b/srcpkgs/scribus/patches/0008-podofo-0.10-drop-old-compat.patch
@@ -0,0 +1,48 @@
+From 60007314a17cfd9ef4d81689868ca1b4e91d5c89 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Mon, 5 Jun 2023 21:37:40 +0000
+Subject: [PATCH 04/13] Code cleanup now possible thanks to podofo >= 0.9.0
+ requirement
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25509 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit a43ad2030f6a6a7ccc1d7fc6cdcd7a652e1263c3)
+---
+ scribus/pdflib_core.cpp | 8 --------
+ 1 file changed, 8 deletions(-)
+
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9861,16 +9861,12 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			char * mbuffer = nullptr;
+ 			long mlen = 0;
+ 
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 7, 99))
+ 			// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
+ 			PoDoFo::PdfMemoryOutputStream oStream(1);
+ 			stream->GetCopy(&oStream);
+ 			oStream.Close();
+ 			mlen = oStream.GetLength();
+ 			mbuffer = oStream.TakeBuffer();
+-#else
+-			stream->GetCopy(&mbuffer, &mlen);
+-#endif
+ 			if (mbuffer[mlen-1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+@@ -10158,16 +10154,12 @@ void PDFLibCore::copyPoDoFoObject(const
+ 		char * mbuffer = nullptr;
+ 		long mlen = 0;
+ 
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 7, 99))
+ 		// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
+ 		PoDoFo::PdfMemoryOutputStream oStream(1);
+ 		stream->GetCopy(&oStream);
+ 		oStream.Close();
+ 		mlen = oStream.GetLength();
+ 		mbuffer = oStream.TakeBuffer();
+-#else
+-		stream->GetCopy(&mbuffer, &mlen);
+-#endif
+ 		if (mbuffer[mlen-1] == '\n')
+ 			--mlen;
+ 		PutDoc("\nstream\n");
diff --git a/srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch b/srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch
new file mode 100644
index 0000000000000..d545d347e28e1
--- /dev/null
+++ b/srcpkgs/scribus/patches/0009-podofo-0.10-avoid-confusion-with-m_doc.patch
@@ -0,0 +1,67 @@
+From 99e2d400ad6ad7fbf4e2ad1a4277521eaad46d28 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Sun, 4 Jun 2023 21:31:53 +0000
+Subject: [PATCH 05/13] Rename m_doc in pdf_analyser to avoid confusion with
+ m_doc in other code
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25495 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit b5aeed8093e06cf3df456f5ad26f76f6ca442bff)
+---
+ scribus/pdf_analyzer.cpp | 12 ++++++------
+ scribus/pdf_analyzer.h   |  2 +-
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -75,11 +75,11 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 		nameMapInited = true;
+ 	}
+ 
+-	m_doc = nullptr;
++	m_pdfdoc = nullptr;
+ 
+ 	PdfError::EnableDebug( false );
+ 	try {
+-		m_doc = new PdfMemDocument(filename.toLocal8Bit().data());
++		m_pdfdoc = new PdfMemDocument(filename.toLocal8Bit().data());
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -91,14 +91,14 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 
+ PDFAnalyzer::~PDFAnalyzer()
+ {
+-	delete m_doc;
++	delete m_pdfdoc;
+ }
+ 
+ bool PDFAnalyzer::inspectPDF(int pageNum, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
+-	if (!m_doc)
++	if (!m_pdfdoc)
+ 		return false;
+-	PdfPage* page = m_doc->GetPage(pageNum);
++	PdfPage* page = m_pdfdoc->GetPage(pageNum);
+ 	return page?inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs):false;
+ }
+ 
+@@ -725,7 +725,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		if (arr[0].IsReference())
+ 		{
+ 			PdfReference ref = arr[0].GetReference();
+-			PdfObject* fontObject = m_doc->GetObjects().GetObject(ref);
++		PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
+ 			if (fontObject)
+ 			{
+ 				PDFFont font = getFontInfo(fontObject);
+--- a/scribus/pdf_analyzer.h
++++ b/scribus/pdf_analyzer.h
+@@ -162,7 +162,7 @@ public:
+ #ifdef HAVE_PODOFO
+ private:
+ 	// pointer to the PoDoFo Pdf's object
+-	PoDoFo::PdfMemDocument* m_doc;
++	PoDoFo::PdfMemDocument* m_pdfdoc;
+ 
+ 	// Path to the analyzed file
+ 	QString m_filename;
diff --git a/srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch b/srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch
new file mode 100644
index 0000000000000..f6c890ebf60d9
--- /dev/null
+++ b/srcpkgs/scribus/patches/0010-podofo-0.10-indentation-fix.patch
@@ -0,0 +1,22 @@
+From ed854091944c93a74cdb3a4dbd6ed14e95ab6a9c Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Mon, 5 Jun 2023 21:03:08 +0000
+Subject: [PATCH 06/13] Small indentation fix
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25503 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit fd576ca6d40856ca3cfb32482b24fa15783665d5)
+---
+ scribus/pdf_analyzer.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -725,7 +725,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		if (arr[0].IsReference())
+ 		{
+ 			PdfReference ref = arr[0].GetReference();
+-		PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
++			PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
+ 			if (fontObject)
+ 			{
+ 				PDFFont font = getFontInfo(fontObject);
diff --git a/srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch b/srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch
new file mode 100644
index 0000000000000..973eb17f714b5
--- /dev/null
+++ b/srcpkgs/scribus/patches/0011-podofo-0.10-code-style.patch
@@ -0,0 +1,141 @@
+From 9cd60ef7831fff69f2dacc2bf216c3537b2cd6e9 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Sat, 12 Aug 2023 21:12:49 +0000
+Subject: [PATCH 07/13] PDFAnalyzer: code style fixes and cleanups
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25573 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 9be7a29f08a00bb3c10024cd9a31a82742d42e22)
+---
+ scribus/pdf_analyzer.cpp | 56 +++++++++++++++++++++-------------------
+ 1 file changed, 30 insertions(+), 26 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -78,7 +78,8 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 	m_pdfdoc = nullptr;
+ 
+ 	PdfError::EnableDebug( false );
+-	try {
++	try
++	{
+ 		m_pdfdoc = new PdfMemDocument(filename.toLocal8Bit().data());
+ 	}
+ 	catch (PdfError & e)
+@@ -99,12 +100,13 @@ bool PDFAnalyzer::inspectPDF(int pageNum
+ 	if (!m_pdfdoc)
+ 		return false;
+ 	PdfPage* page = m_pdfdoc->GetPage(pageNum);
+-	return page?inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs):false;
++	return page ? inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs) : false;
+ }
+ 
+ PDFColorSpace PDFAnalyzer::getCSType(PdfObject* cs)
+ {
+-	try {
++	try
++	{
+ 		// colorspace is either a name or an array
+ 		if (cs && cs->IsName())
+ 		{
+@@ -165,20 +167,21 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ bool PDFAnalyzer::inspectCanvas(PdfCanvas* canvas, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
+ 	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
+-	PdfObject* colorSpaceRes;
+-	PdfObject* xObjects;
+-	PdfObject* transGroup;
+-	PdfObject* extGState;
+-	PdfObject* fontRes;
++	PdfObject* colorSpaceRes { nullptr };
++	PdfObject* xObjects { nullptr };
++	PdfObject* transGroup { nullptr };
++	PdfObject* extGState { nullptr };
++	PdfObject* fontRes { nullptr };
+ 	QMap<PdfName, PDFColorSpace> processedNamedCS;
+ 	QMap<PdfName, PDFFont> processedNamedFont;
+ 	QList<PdfName> processedNamedXObj;
+ 	QList<PdfName> processedNamedGS;
+-	try {
++	try
++	{
+ 		// get hold of a PdfObject pointer of this canvas
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
+-		PdfObject* canvasObject = page?(page->GetObject()):((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
+ 
+ 		// find a resource with ColorSpace entry
+ 		PdfObject* resources = canvas->GetResources();
+@@ -186,13 +189,13 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		{
+ 			resources = par->GetIndirectKey("Resources");
+ 		}
+-		colorSpaceRes = resources?resources->GetIndirectKey("ColorSpace"):nullptr;
+-		xObjects = resources?resources->GetIndirectKey("XObject"):nullptr;
+-		extGState = resources?resources->GetIndirectKey("ExtGState"):nullptr;
+-		fontRes = resources?resources->GetIndirectKey("Font"):nullptr;
++		colorSpaceRes = resources ? resources->GetIndirectKey("ColorSpace") : nullptr;
++		xObjects = resources ? resources->GetIndirectKey("XObject") : nullptr;
++		extGState = resources ? resources->GetIndirectKey("ExtGState") : nullptr;
++		fontRes = resources ? resources->GetIndirectKey("Font") : nullptr;
+ 
+ 		// getting the transparency group of this content stream (if available)
+-		transGroup = canvasObject?canvasObject->GetIndirectKey("Group"):nullptr;
++		transGroup = canvasObject ? canvasObject->GetIndirectKey("Group") : nullptr;
+ 		if (transGroup)
+ 		{
+ 			PdfObject* subtype = transGroup->GetIndirectKey("S");
+@@ -219,7 +222,8 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		return false;
+ 	}
+ 
+-	try {
++	try
++	{
+ 		// start parsing the content stream
+ 		PdfContentsTokenizer tokenizer(canvas);
+ 		EPdfContentsType t;
+@@ -502,7 +506,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						if (args.size() == 1 && args[0].IsName() && xObjects)
+ 						{
+ 							PdfObject* xObject = xObjects->GetIndirectKey(args[0].GetName());
+-							PdfObject* subtypeObject = xObject?xObject->GetIndirectKey("Subtype"):nullptr;
++							PdfObject* subtypeObject = xObject ? xObject->GetIndirectKey("Subtype") : nullptr;
+ 							if (subtypeObject && subtypeObject->IsName())
+ 							{
+ 								if (subtypeObject->GetName() == "Image")
+@@ -557,10 +561,10 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						PdfName cs("CS");
+ 						if (args.contains(colorspace) || args.contains(cs))
+ 						{
+-							int csIdx = args.contains(colorspace)?args.indexOf(colorspace):args.indexOf(cs);
+-							if (args[csIdx+1].IsName())
++							int csIdx = args.contains(colorspace) ? args.indexOf(colorspace) : args.indexOf(cs);
++							if (args[csIdx + 1].IsName())
+ 							{
+-								PdfName csName = args[csIdx+1].GetName();
++								PdfName csName = args[csIdx + 1].GetName();
+ 								if ((csName == "G" || csName == "DeviceGray") && !usedColorSpaces.contains(CS_DeviceGray))
+ 									usedColorSpaces.append(CS_DeviceGray);
+ 								else if ((csName == "RGB" || csName == "DeviceRGB") && !usedColorSpaces.contains(CS_DeviceRGB))
+@@ -594,14 +598,14 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						PdfName w("W");
+ 						if ((args.contains(height) || args.contains(h)) && (args.contains(width) || args.contains(w)))
+ 						{
+-							int heightIdx = args.contains(height)?args.indexOf(height):args.indexOf(h);
+-							int widthIdx = args.contains(width)?args.indexOf(width):args.indexOf(w);
+-							double height = args[heightIdx+1].GetReal();
+-							double width = args[widthIdx+1].GetReal();
++							int heightIdx = args.contains(height) ? args.indexOf(height) : args.indexOf(h);
++							int widthIdx = args.contains(width) ? args.indexOf(width) : args.indexOf(w);
++							double height = args[heightIdx + 1].GetReal();
++							double width = args[widthIdx + 1].GetReal();
+ 							PDFImage img;
+ 							img.imgName = "Inline Image";
+-							img.dpiX = qRound(width/(currGS.ctm.m11()/72));
+-							img.dpiY = qRound(height/(currGS.ctm.m22()/72));
++							img.dpiX = qRound(width / (currGS.ctm.m11() / 72));
++							img.dpiY = qRound(height / (currGS.ctm.m22() / 72));
+ 							imgs.append(img);
+ 						}
+ 						inlineImgDict = false;
diff --git a/srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch b/srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch
new file mode 100644
index 0000000000000..654d870140683
--- /dev/null
+++ b/srcpkgs/scribus/patches/0012-podofo-0.10-preparation.patch
@@ -0,0 +1,514 @@
+From bb6c0716035bcdc9fd4bd536d1ed6f01a1c6e9fa Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Sat, 12 Aug 2023 23:28:11 +0000
+Subject: [PATCH 08/13] Preparation work for PoDoFo 0.10.0x support: get rid of
+ GetIndirectKey() calls
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25579 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit fbd5eb474e0e6f522c6089756424592ecf0dc0a4)
+---
+ scribus/pdf_analyzer.cpp               | 204 ++++++++++++++-----------
+ scribus/pdflib_core.cpp                |  28 ++--
+ scribus/plugins/import/ai/importai.cpp |  21 ++-
+ 3 files changed, 148 insertions(+), 105 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -167,11 +167,10 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ bool PDFAnalyzer::inspectCanvas(PdfCanvas* canvas, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
+ 	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
+-	PdfObject* colorSpaceRes { nullptr };
+-	PdfObject* xObjects { nullptr };
+-	PdfObject* transGroup { nullptr };
+-	PdfObject* extGState { nullptr };
+-	PdfObject* fontRes { nullptr };
++	PdfDictionary* colorSpacesDict { nullptr };
++	PdfDictionary* xObjectsDict { nullptr };
++	PdfDictionary* extGStatesDict { nullptr };
++	PdfDictionary* fontsDict { nullptr };
+ 	QMap<PdfName, PDFColorSpace> processedNamedCS;
+ 	QMap<PdfName, PDFFont> processedNamedFont;
+ 	QList<PdfName> processedNamedXObj;
+@@ -182,30 +181,41 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
+ 		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++		PdfDictionary* canvasDict = (canvasObject && canvasObject->IsDictionary()) ? &(canvasObject->GetDictionary()) : nullptr;
+ 
+ 		// find a resource with ColorSpace entry
+ 		PdfObject* resources = canvas->GetResources();
+-		for (PdfObject* par = canvasObject; par && !resources; par = par->GetIndirectKey("Parent"))
++		for (PdfDictionary* par = canvasDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+-			resources = par->GetIndirectKey("Resources");
++			resources = par->FindKey("Resources");
++			PdfObject* parentObj = par->FindKey("Parent");
++			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
+ 		}
+-		colorSpaceRes = resources ? resources->GetIndirectKey("ColorSpace") : nullptr;
+-		xObjects = resources ? resources->GetIndirectKey("XObject") : nullptr;
+-		extGState = resources ? resources->GetIndirectKey("ExtGState") : nullptr;
+-		fontRes = resources ? resources->GetIndirectKey("Font") : nullptr;
++
++		PdfDictionary* resourcesDict = (resources && resources->IsDictionary()) ? &(resources->GetDictionary()) : nullptr;
++		PdfObject* colorSpaceRes = resourcesDict ? resourcesDict->FindKey("ColorSpace") : nullptr;
++		PdfObject* xObjects = resourcesDict ? resourcesDict->FindKey("XObject") : nullptr;
++		PdfObject* extGState = resourcesDict ? resourcesDict->FindKey("ExtGState") : nullptr;
++		PdfObject* fontRes = resourcesDict ? resourcesDict->FindKey("Font") : nullptr;
++
++		colorSpacesDict = (colorSpaceRes && colorSpaceRes->IsDictionary()) ? &(colorSpaceRes->GetDictionary()) : nullptr;
++		xObjectsDict = (xObjects && xObjects->IsDictionary()) ? &(xObjects->GetDictionary()) : nullptr;
++		extGStatesDict = (extGState && extGState->IsDictionary()) ? &(extGState->GetDictionary()) : nullptr;
++		fontsDict = (fontRes && fontRes->IsDictionary()) ? &(fontRes->GetDictionary()) : nullptr;
+ 
+ 		// getting the transparency group of this content stream (if available)
+-		transGroup = canvasObject ? canvasObject->GetIndirectKey("Group") : nullptr;
+-		if (transGroup)
++		PdfObject* transGroup = canvasDict ? canvasDict->FindKey("Group") : nullptr;
++		PdfDictionary* transGroupDict = (transGroup && transGroup->IsDictionary()) ? &(transGroup->GetDictionary()) : nullptr;
++		if (transGroupDict)
+ 		{
+-			PdfObject* subtype = transGroup->GetIndirectKey("S");
++			const PdfObject* subtype = transGroupDict->FindKey("S");
+ 			if (subtype && subtype->GetName() == "Transparency")
+ 			{
+ 				// having transparency group means there's transparency in the PDF
+ 				hasTransparency = true;
+ 
+ 				// reporting the color space used in transparency group (Section 7.5.5, PDF 1.6 Spec)
+-				PdfObject* cs = transGroup->GetIndirectKey("CS");
++				PdfObject* cs = transGroupDict->FindKey("CS");
+ 				if (cs)
+ 				{
+ 					PDFColorSpace retval = getCSType(cs);
+@@ -380,9 +390,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -449,9 +459,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -503,28 +513,29 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedXObj.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && xObjects)
++						if (args.size() == 1 && args[0].IsName() && xObjectsDict)
+ 						{
+-							PdfObject* xObject = xObjects->GetIndirectKey(args[0].GetName());
+-							PdfObject* subtypeObject = xObject ? xObject->GetIndirectKey("Subtype") : nullptr;
++							PdfObject* xObject = xObjectsDict->FindKey(args[0].GetName());
++							PdfDictionary* xObjectDict = (xObject && xObject->IsDictionary()) ? &(xObject->GetDictionary()) : nullptr;
++							PdfObject* subtypeObject = xObjectDict ? xObjectDict->FindKey("Subtype") : nullptr;
+ 							if (subtypeObject && subtypeObject->IsName())
+ 							{
+ 								if (subtypeObject->GetName() == "Image")
+ 								{
+-									PdfObject* imgColorSpace = xObject->GetIndirectKey("ColorSpace");
++									PdfObject* imgColorSpace = xObjectDict->FindKey("ColorSpace");
+ 									if (imgColorSpace)
+ 									{
+ 										PDFColorSpace retval = getCSType(imgColorSpace);
+ 										if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 											usedColorSpaces.append(retval);
+ 									}
+-									PdfObject* sMaskObj = xObject->GetIndirectKey("SMask");
++									PdfObject* sMaskObj = xObjectDict->FindKey("SMask");
+ 									if (sMaskObj)
+ 										hasTransparency = true;
+ 									PDFImage img;
+ 									img.imgName = args[0].GetName().GetEscapedName().c_str();
+-									double width = xObject->GetIndirectKey("Width")->GetReal();
+-									double height = xObject->GetIndirectKey("Height")->GetReal();
++									double width = xObjectDict->FindKey("Width")->GetReal();
++									double height = xObjectDict->FindKey("Height")->GetReal();
+ 									img.dpiX = qRound(width/(currGS.ctm.m11()/72));
+ 									img.dpiY = qRound(height/(currGS.ctm.m22()/72));
+ 									imgs.append(img);
+@@ -573,9 +584,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 									usedColorSpaces.append(CS_DeviceCMYK);
+ 								else if (!processedNamedCS.contains(csName))
+ 								{
+-									if (colorSpaceRes && colorSpaceRes->GetIndirectKey(csName))
++									if (colorSpacesDict && colorSpacesDict->FindKey(csName))
+ 									{
+-										PdfObject* csEntry = colorSpaceRes->GetIndirectKey(csName);
++										PdfObject* csEntry = colorSpacesDict->FindKey(csName);
+ 										if (csEntry)
+ 										{
+ 											PDFColorSpace retval = getCSType(csEntry);
+@@ -615,9 +626,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedGS.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && extGState)
++						if (args.size() == 1 && args[0].IsName() && extGStatesDict)
+ 						{
+-							PdfObject* extGStateObj = extGState->GetIndirectKey(args[0].GetName());
++							PdfObject* extGStateObj = extGStatesDict->FindKey(args[0].GetName());
+ 							if (extGStateObj)
+ 							{
+ 								inspectExtGStateObj(extGStateObj, usedColorSpaces, hasTransparency, usedFonts, currGS);
+@@ -646,9 +657,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					}
+ 					else
+ 					{
+-						if (args.size() == 2 && args[0].IsName() && fontRes)
++						if (args.size() == 2 && args[0].IsName() && fontsDict)
+ 						{
+-							PdfObject* fontObj = fontRes->GetIndirectKey(args[0].GetName());
++							PdfObject* fontObj = fontsDict->FindKey(args[0].GetName());
+ 							if (fontObj)
+ 							{
+ 								PDFFont retval = getFontInfo(fontObj);
+@@ -687,9 +698,11 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 	}
+ 	return true;
+ }
++
+ void PDFAnalyzer::inspectExtGStateObj(PdfObject* extGStateObj, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, PDFGraphicState & currGS)
+ {
+-	PdfObject* bmObj = extGStateObj->GetIndirectKey("BM");
++	PdfDictionary* extGStateDict = extGStateObj->IsDictionary() ? &(extGStateObj->GetDictionary()) : nullptr;
++	PdfObject* bmObj = extGStateDict ? extGStateDict->FindKey("BM") : nullptr;
+ 	if (bmObj && bmObj->IsName())
+ 	{
+ 		currGS.blendModes.clear();
+@@ -706,23 +719,27 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		if (arr[0].IsName() && !(arr[0].GetName() == "Normal" || arr[0].GetName() == "Compatible"))
+ 			hasTransparency = true;
+ 	}
+-	PdfObject* caObj = extGStateObj->GetIndirectKey("ca");
++
++	PdfObject* caObj = extGStateDict ? extGStateDict->FindKey("ca") : nullptr;
+ 	if (caObj && (caObj->IsReal() || caObj->IsNumber()))
+ 	{
+ 		currGS.fillAlphaConstant = caObj->GetReal();
+ 		if (caObj->GetReal() < 1)
+ 			hasTransparency = true;
+ 	}
+-	PdfObject* cAObj = extGStateObj->GetIndirectKey("CA");
++
++	PdfObject* cAObj = extGStateDict ? extGStateDict->FindKey("CA") : nullptr;
+ 	if (cAObj && (cAObj->IsReal() || cAObj->IsNumber()))
+ 	{
+ 		if (cAObj->GetReal() < 1)
+-		hasTransparency = true;
++			hasTransparency = true;
+ 	}
+-	PdfObject* sMaskObj = extGStateObj->GetIndirectKey("SMask");
++
++	PdfObject* sMaskObj = extGStateDict ? extGStateDict->FindKey("SMask") : nullptr;
+ 	if (sMaskObj && !(sMaskObj->IsName() && sMaskObj->GetName() == "None"))
+ 		hasTransparency = true;
+-	PdfObject* fontObj = extGStateObj->GetIndirectKey("Font");
++
++	PdfObject* fontObj = extGStateDict ? extGStateDict->FindKey("Font") : nullptr;
+ 	if (fontObj && fontObj->IsArray())
+ 	{
+ 		PdfArray arr = fontObj->GetArray();
+@@ -740,19 +757,24 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 
+ 		}
+ 	}
+-	PdfObject* lwObj = extGStateObj->GetIndirectKey("LW");
++
++	PdfObject* lwObj = extGStateDict ? extGStateDict->FindKey("LW") : nullptr;
+ 	if (lwObj)
+ 		currGS.lineWidth = lwObj->GetReal();
+-	PdfObject* lcObj = extGStateObj->GetIndirectKey("LC");
++
++	PdfObject* lcObj = extGStateDict ? extGStateDict->FindKey("LC") : nullptr;
+ 	if (lcObj)
+ 		currGS.lineCap = lcObj->GetNumber();
+-	PdfObject* ljObj = extGStateObj->GetIndirectKey("LJ");
++
++	PdfObject* ljObj = extGStateDict ? extGStateDict->FindKey("LJ") : nullptr;
+ 	if (ljObj)
+ 		currGS.lineJoin = ljObj->GetNumber();
+-	PdfObject* mlObj = extGStateObj->GetIndirectKey("ML");
++
++	PdfObject* mlObj = extGStateDict ? extGStateDict->FindKey("ML") : nullptr;
+ 	if (mlObj)
+ 		currGS.miterLimit = mlObj->GetReal();
+-	PdfObject* dObj = extGStateObj->GetIndirectKey("D");
++
++	PdfObject* dObj = extGStateDict ? extGStateDict->FindKey("D") : nullptr;
+ 	if (dObj)
+ 	{
+ 		PdfObject dObjA = dObj->GetArray()[0];
+@@ -767,56 +789,64 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ PDFFont PDFAnalyzer::getFontInfo(PdfObject* fontObj)
+ {
+ 	PDFFont currFont;
+-	PdfObject* subtype = fontObj->GetIndirectKey("Subtype");
+-	if (subtype && subtype->IsName())
++	const PdfDictionary* fontDict = fontObj->IsDictionary() ? &(fontObj->GetDictionary()) : nullptr;
++	if (!fontDict)
++		return currFont;
++
++	const PdfObject* subtype = fontDict->FindKey("Subtype");
++	if (!subtype || !subtype->IsName())
++		return currFont;
++
++	const PdfObject* fontDesc = fontDict->FindKey("FontDescriptor");
++	if (subtype->GetName() == "Type1")
++		currFont.fontType = F_Type1;
++	else if (subtype->GetName() == "MMType1")
++		currFont.fontType = F_MMType1;
++	else if (subtype->GetName() == "TrueType")
++		currFont.fontType = F_TrueType;
++	else if (subtype->GetName() == "Type3")
++	{
++		currFont.fontType = F_Type3;
++		currFont.isEmbedded = true;
++		fontDesc = nullptr;
++	}
++	else if (subtype->GetName() == "Type0")
+ 	{
+-		PdfObject* fontDesc = fontObj->GetIndirectKey("FontDescriptor");
+-		if (subtype->GetName() == "Type1")
+-			currFont.fontType = F_Type1;
+-		else if (subtype->GetName() == "MMType1")
+-			currFont.fontType = F_MMType1;
+-		else if (subtype->GetName() == "TrueType")
+-			currFont.fontType = F_TrueType;
+-		else if (subtype->GetName() == "Type3")
+-		{
+-			currFont.fontType = F_Type3;
+-			currFont.isEmbedded = true;
+-			fontDesc = nullptr;
+-		}
+-		else if (subtype->GetName() == "Type0")
++		const PdfObject* descendantFonts = fontDict->FindKey("DescendantFonts");
++		if (descendantFonts && descendantFonts->IsArray())
+ 		{
+-			PdfObject* descendantFonts = fontObj->GetIndirectKey("DescendantFonts");
+-			if (descendantFonts && descendantFonts->IsArray())
++			const PdfReference& refDescFont = descendantFonts->GetArray()[0].GetReference();
++			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
++			PdfDictionary* descendantFontDict = (descendantFont && descendantFont->IsDictionary()) ? &(descendantFont->GetDictionary()) : nullptr;
++			const PdfObject* subtypeDescFont = descendantFontDict->FindKey("Subtype");
++			fontDesc = &(descendantFontDict->MustGetKey("FontDescriptor"));
++			if (subtypeDescFont && subtypeDescFont->IsName())
+ 			{
+-				PdfReference refDescFont = descendantFonts->GetArray()[0].GetReference();
+-				PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
+-				PdfObject* subtypeDescFont = descendantFont->GetIndirectKey("Subtype");
+-				fontDesc = descendantFont->MustGetIndirectKey("FontDescriptor");
+-				if (subtypeDescFont && subtypeDescFont->IsName())
+-				{
+-					if (subtypeDescFont->GetName() == "CIDFontType0")
+-						currFont.fontType = F_CIDFontType0;
+-					else if (subtypeDescFont->GetName() == "CIDFontType2")
+-						currFont.fontType = F_CIDFontType2;
+-				}
++				if (subtypeDescFont->GetName() == "CIDFontType0")
++					currFont.fontType = F_CIDFontType0;
++				else if (subtypeDescFont->GetName() == "CIDFontType2")
++					currFont.fontType = F_CIDFontType2;
+ 			}
+ 		}
+-		if (fontDesc)
++	}
++
++	const PdfDictionary* fontDescDict = (fontDesc && fontDesc->IsDictionary()) ? &(fontDesc->GetDictionary()) : nullptr;
++	if (fontDescDict)
++	{
++		const PdfObject* fontFile = fontDescDict->FindKey("FontFile");
++		const PdfObject* fontFile2 = fontDescDict->FindKey("FontFile2");
++		const PdfObject* fontFile3 = fontDescDict->FindKey("FontFile3");
++		if (fontFile && fontFile->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile2 && fontFile2->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile3 && fontFile3->HasStream())
+ 		{
+-			PdfObject* fontFile = fontDesc->GetIndirectKey("FontFile");
+-			PdfObject* fontFile2 = fontDesc->GetIndirectKey("FontFile2");
+-			PdfObject* fontFile3 = fontDesc->GetIndirectKey("FontFile3");
+-			if (fontFile && fontFile->HasStream())
+-				currFont.isEmbedded = true;
+-			if (fontFile2 && fontFile2->HasStream())
+-				currFont.isEmbedded = true;
+-			if (fontFile3 && fontFile3->HasStream())
+-			{
+-				currFont.isEmbedded = true;
+-				PdfObject* ff3Subtype = fontFile3->GetIndirectKey("Subtype");
+-				if (ff3Subtype && ff3Subtype->IsName() && ff3Subtype->GetName() == "OpenType")
+-					currFont.isOpenType = true;
+-			}
++			currFont.isEmbedded = true;
++			const PdfDictionary* fontFile3Dict = fontFile3->IsDictionary() ? &(fontFile3->GetDictionary()) : nullptr;
++			const PdfObject* ff3Subtype = fontFile3Dict ? fontFile3Dict->FindKey("Subtype") : nullptr;
++			if (ff3Subtype && ff3Subtype->IsName() && ff3Subtype->GetName() == "OpenType")
++				currFont.isOpenType = true;
+ 		}
+ 	}
+ 	return currFont;
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9800,16 +9800,20 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 		PoDoFo::PdfObject* pageObj   = page ? page->GetObject() : nullptr;
+ 		PoDoFo::PdfObject* contents  = page ? page->GetContents() : nullptr;
+ 		PoDoFo::PdfObject* resources = page ? page->GetResources() : nullptr;
+-		for (PoDoFo::PdfObject* par = pageObj; par && !resources; par = par->GetIndirectKey("Parent"))
++		PoDoFo::PdfDictionary* pageObjDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
++		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+-			resources = par->GetIndirectKey("Resources");
++			resources = par->FindKey("Resources");
++			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
++			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
+ 		}
+ 		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Dictionary)
+ 		{
++			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
+ 			PoDoFo::PdfStream* stream = contents->GetStream();
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+-			PoDoFo::PdfObject* nextObj;
++			PoDoFo::PdfObject* nextObj { nullptr };
+ 			PdfId xObj = writer.newObject();
+ 			PdfId xResources = writer.newObject();
+ 			PdfId xParents = 0;
+@@ -9844,14 +9848,16 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			nextObj = page->GetObject()->GetIndirectKey("Group");
++			PoDoFo::PdfObject* pageObj = page->GetObject();
++			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+ 			/*
+-			PoDoFo::PdfObject parents = page->GetObject()->GetIndirectKey("StructParents");
++			PoDoFo::PdfObject parents = pageDict->FindKey("StructParents");
+ 			if (parents)
+ 			{
+ 				xParents = writer.newObject();
+@@ -9870,13 +9876,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			if (mbuffer[mlen-1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+-			nextObj = contents->GetIndirectKey("Filter");
++			nextObj = contentsDict.FindKey("Filter");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Filter ");
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+-			nextObj = contents->GetIndirectKey("DecodeParms");
++			nextObj = contentsDict.FindKey("DecodeParms");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/DecodeParms ");
+@@ -9967,7 +9973,9 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			nextObj = page->GetObject()->GetIndirectKey("Group");
++			PoDoFo::PdfObject* pageObj = page->GetObject();
++			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+@@ -10012,13 +10020,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ //				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+ /*
+- nextObj = contents->GetIndirectKey("Filter");
++			nextObj = contentsDict.FindKey("Filter");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Filter ");
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+-			nextObj = contents->GetIndirectKey("DecodeParms");
++			nextObj = contentsDict.FindKey("DecodeParms");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/DecodeParms ");
+--- a/scribus/plugins/import/ai/importai.cpp
++++ b/scribus/plugins/import/ai/importai.cpp
+@@ -587,36 +587,41 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		PoDoFo::PdfPage *curPage = doc.GetPage(0);
+ 		if (curPage != nullptr)
+ 		{
+-			PoDoFo::PdfObject *piece = curPage->GetObject()->GetIndirectKey("PieceInfo");
++			PoDoFo::PdfObject* pageObj = curPage->GetObject();
++			PoDoFo::PdfDictionary* pageDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
++			PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
+ 			if (piece != nullptr)
+ 			{
+-				PoDoFo::PdfObject *illy = piece->GetIndirectKey("Illustrator");
++				PoDoFo::PdfDictionary* pieceDict = piece->IsDictionary() ? &(piece->GetDictionary()) : nullptr;
++				PoDoFo::PdfObject *illy = pieceDict ? pieceDict->FindKey("Illustrator") : nullptr;
+ 				if (illy != nullptr)
+ 				{
+-					PoDoFo::PdfObject *priv = illy->GetIndirectKey("Private");
++					PoDoFo::PdfDictionary* illyDict = illy->IsDictionary() ? &(illy->GetDictionary()) : nullptr;
++					PoDoFo::PdfObject *priv = illyDict ? illyDict->FindKey("Private") : nullptr;
+ 					if (priv == nullptr)
+ 						priv = illy;
+ 					int num = 0;
+-					PoDoFo::PdfObject *numBl = priv->GetIndirectKey("NumBlock");
++					PoDoFo::PdfDictionary* privDict = priv->IsDictionary() ? &(priv->GetDictionary()) : nullptr;
++					PoDoFo::PdfObject *numBl = privDict ? privDict->FindKey("NumBlock") : nullptr;
+ 					if (numBl != nullptr)
+ 						num = numBl->GetNumber() + 1;
+ 					if (num == 0)
+ 						num = 99999;
+ 					QString name = "AIPrivateData%1";
+ 					QString Key = name.arg(1);
+-					PoDoFo::PdfObject *data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++					PoDoFo::PdfObject *data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
+ 					if (data == nullptr)
+ 					{
+ 						name = "AIPDFPrivateData%1";
+ 						Key = name.arg(1);
+-						data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++						data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
+ 					}
+ 					if (data != nullptr)
+ 					{
+ 						if (num == 2)
+ 						{
+ 							Key = name.arg(1);
+-							data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 							PoDoFo::PdfStream const *stream = data->GetStream();
+ 							PoDoFo::PdfMemoryOutputStream oStream(1);
+ 							stream->GetFilteredCopy(&oStream);
+@@ -631,7 +636,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 							for (int a = 2; a < num; a++)
+ 							{
+ 								Key = name.arg(a);
+-								data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
++								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 								if (data == nullptr)
+ 									break;
+ 								PoDoFo::PdfStream const *stream = data->GetStream();
diff --git a/srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch b/srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch
new file mode 100644
index 0000000000000..5810becb56446
--- /dev/null
+++ b/srcpkgs/scribus/patches/0013-podofo-0.10-compat-podofo-0.10.x.patch
@@ -0,0 +1,1602 @@
+From bbaa1944d83a2c68e49927d5bcc462cd870beb2d Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Tue, 15 Aug 2023 02:43:52 +0000
+Subject: [PATCH 09/13] #16948: Fix build with podofo 0.10.x
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25601 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 33580ae8371e993b6e199e710950702c78d7dde1)
+---
+ scribus/documentchecker.cpp                   |  18 +-
+ .../imagedataloaders/scimgdataloader_pdf.cpp  |  12 +-
+ scribus/pdf_analyzer.cpp                      | 533 +++++++++++++++++-
+ scribus/pdflib_core.cpp                       | 480 +++++++++++++---
+ scribus/pdflib_core.h                         |   4 +-
+ scribus/plugins/import/ai/importai.cpp        |  41 +-
+ 6 files changed, 985 insertions(+), 103 deletions(-)
+
+--- a/scribus/documentchecker.cpp
++++ b/scribus/documentchecker.cpp
+@@ -109,7 +109,7 @@ bool DocumentChecker::checkDocument(Scri
+ void DocumentChecker::checkPages(ScribusDoc *currDoc, const CheckerPrefs& checkerSettings)
+ {
+ 	errorCodes pageError;
+-	for (int i=0; i < currDoc->DocPages.count(); ++i )
++	for (int i = 0; i < currDoc->DocPages.count(); ++i)
+ 	{
+ 		pageError.clear();
+ 		if (checkerSettings.checkAppliedMasterDifferentSide)
+@@ -127,11 +127,11 @@ void DocumentChecker::checkPages(Scribus
+ 			}
+ 			else
+ 			{
+-				if (pageLoc==LeftPage && masterPageLocation==1)
++				if (pageLoc == LeftPage && masterPageLocation == 1)
+ 					error = false;
+-				else if (pageLoc==RightPage && masterPageLocation==0)
++				else if (pageLoc == RightPage && masterPageLocation == 0)
+ 					error = false;
+-				else if (pageLoc==MiddlePage && masterPageLocation==2)
++				else if (pageLoc == MiddlePage && masterPageLocation == 2)
+ 					error = false;
+ 				else
+ 					error = true;
+@@ -596,7 +596,7 @@ void DocumentChecker::checkItems(Scribus
+ 								}
+ 								if (checkerSettings.checkNotCMYKOrSpot)
+ 								{
+-									for (int i=0; i<usedColorSpaces.size(); ++i)
++									for (int i = 0; i < usedColorSpaces.size(); ++i)
+ 									{
+ 										if (usedColorSpaces[i] == CS_DeviceRGB || usedColorSpaces[i] == CS_ICCBased || usedColorSpaces[i] == CS_CalGray
+ 											|| usedColorSpaces[i] == CS_CalRGB || usedColorSpaces[i] == CS_Lab)
+@@ -608,7 +608,7 @@ void DocumentChecker::checkItems(Scribus
+ 								}
+ 								if (checkerSettings.checkDeviceColorsAndOutputIntent && currDoc->HasCMS)
+ 								{
+-									for (int i=0; i<usedColorSpaces.size(); ++i)
++									for (int i = 0; i < usedColorSpaces.size(); ++i)
+ 									{
+ 										if (currPrintProfCS == ColorSpace_Cmyk && (usedColorSpaces[i] == CS_DeviceRGB || usedColorSpaces[i] == CS_DeviceGray))
+ 										{
+@@ -627,7 +627,7 @@ void DocumentChecker::checkItems(Scribus
+ 								itemError.insert(Transparency, 0);
+ 							if (checkerSettings.checkFontNotEmbedded || checkerSettings.checkFontIsOpenType)
+ 							{
+-								for (int i=0; i<usedFonts.size(); ++i)
++								for (int i = 0; i < usedFonts.size(); ++i)
+ 								{
+ 									PDFFont currentFont = usedFonts[i];
+ 									if (!currentFont.isEmbedded && checkerSettings.checkFontNotEmbedded)
+@@ -638,7 +638,7 @@ void DocumentChecker::checkItems(Scribus
+ 							}
+ 							if (checkerSettings.checkResolution)
+ 							{
+-								for (int i=0; i<imgs.size(); ++i)
++								for (int i = 0; i < imgs.size(); ++i)
+ 								{
+ 									if ((imgs[i].dpiX < checkerSettings.minResolution) || (imgs[i].dpiY < checkerSettings.minResolution))
+ 										itemError.insert(ImageDPITooLow, 0);
+@@ -655,7 +655,7 @@ void DocumentChecker::checkItems(Scribus
+ 				if ( currItem->frameOverflows() && (checkerSettings.checkOverflow) && (!((currItem->isAnnotation()) && ((currItem->annotation().Type() == Annotation::Combobox) || (currItem->annotation().Type() == Annotation::Listbox)))))
+ 					itemError.insert(TextOverflow, 0);
+ 
+-				if (checkerSettings.checkEmptyTextFrames && (currItem->itemText.length()==0 || currItem->frameUnderflows()))
++				if (checkerSettings.checkEmptyTextFrames && (currItem->itemText.length() == 0 || currItem->frameUnderflows()))
+ 				{
+ 					bool isEmptyAnnotation = (currItem->isAnnotation() && 
+ 					                         ((currItem->annotation().Type() == Annotation::Link) ||
+--- a/scribus/imagedataloaders/scimgdataloader_pdf.cpp
++++ b/scribus/imagedataloaders/scimgdataloader_pdf.cpp
+@@ -55,10 +55,16 @@ bool ScImgDataLoader_PDF::loadPicture(co
+ #ifdef HAVE_PODOFO
+ 	try
+ 	{
+-		PoDoFo::PdfError::EnableDebug( false );
+-		PoDoFo::PdfError::EnableLogging( false );
+-		PoDoFo::PdfMemDocument doc( fn.toLocal8Bit().data() );
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PoDoFo::PdfMemDocument doc;
++		doc.Load(fn.toLocal8Bit().data());
++		m_imageInfoRecord.numberOfPages = doc.GetPages().GetCount();
++#else
++		PoDoFo::PdfError::EnableDebug(false);
++		PoDoFo::PdfError::EnableLogging(false);
++		PoDoFo::PdfMemDocument doc(fn.toLocal8Bit().data());
+ 		m_imageInfoRecord.numberOfPages = doc.GetPageCount();
++#endif
+ 		if (page > m_imageInfoRecord.numberOfPages)
+ 		{
+ 			qDebug() << "Incorrect page number specified!";
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -30,6 +30,10 @@ for which a new license (GPL+exception)
+ #ifdef HAVE_PODOFO
+ using namespace PoDoFo;
+ 
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
++#define IsRealStrict IsReal
++#endif
++
+ static QHash<QString, PDFContentStreamKeyword> kwNameMap;
+ 
+ // we gonna need a map from string values to the defined enum of pdf keywords
+@@ -77,10 +81,13 @@ PDFAnalyzer::PDFAnalyzer(QString & filen
+ 
+ 	m_pdfdoc = nullptr;
+ 
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+ 	PdfError::EnableDebug( false );
++#endif
+ 	try
+ 	{
+-		m_pdfdoc = new PdfMemDocument(filename.toLocal8Bit().data());
++		m_pdfdoc = new PdfMemDocument();
++		m_pdfdoc->Load(filename.toLocal8Bit().data());
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -99,7 +106,12 @@ bool PDFAnalyzer::inspectPDF(int pageNum
+ {
+ 	if (!m_pdfdoc)
+ 		return false;
++
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++	PdfPage* page = &(m_pdfdoc->GetPages().GetPageAt(pageNum));
++#else
+ 	PdfPage* page = m_pdfdoc->GetPage(pageNum);
++#endif
+ 	return page ? inspectCanvas(page, usedColorSpaces, hasTransparency, usedFonts, imgs) : false;
+ }
+ 
+@@ -139,7 +151,13 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ 					PdfObject* pBase = &base;
+ 					if (base.IsReference())
+ 					{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++						PdfDocument* pdfdoc = cs->GetDocument();
++						PdfIndirectObjectList& pdf_iol = pdfdoc->GetObjects();
++						pBase = pdf_iol.GetObject(base.GetReference());
++#else
+ 						pBase = cs->GetOwner()->GetObject(base.GetReference());
++#endif
+ 					}
+ #if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 9, 7))
+ 					pBase->SetOwner(cs->GetOwner());
+@@ -180,11 +198,21 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		// get hold of a PdfObject pointer of this canvas
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PdfObject* canvasObject = page ? &(page->GetObject()) : &(dynamic_cast<PdfXObject*>(canvas)->GetObject());
++
++#else
+ 		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++#endif
+ 		PdfDictionary* canvasDict = (canvasObject && canvasObject->IsDictionary()) ? &(canvasObject->GetDictionary()) : nullptr;
+ 
+ 		// find a resource with ColorSpace entry
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PdfResources* canvasRsrc = canvas->GetResources();
++		PdfObject* resources = &(canvasRsrc->GetObject());
++#else
+ 		PdfObject* resources = canvas->GetResources();
++#endif
+ 		for (PdfDictionary* par = canvasDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+ 			resources = par->FindKey("Resources");
+@@ -234,6 +262,468 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 
+ 	try
+ 	{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		// start parsing the content stream
++		PdfContentReaderArgs tokenizerArgs = { PdfContentReaderFlags::DontFollowXObjectForms };
++		PdfContentStreamReader tokenizer(*canvas, tokenizerArgs);
++		PdfContent pdfContent;
++		PdfVariant var;
++		bool readToken;
++
++		int tokenNumber = 0;
++		bool inlineImgDict = false;
++		QList<PdfVariant> args;
++		QStack<PDFGraphicState> gsStack;
++		PDFGraphicState currGS;
++		while ((readToken = tokenizer.TryReadNext(pdfContent)))
++		{
++			++tokenNumber;
++			if (pdfContent.Type == PdfContentType::Operator)
++			{
++				args.clear();
++				int stackSize = pdfContent.Stack.size();
++				for (size_t i = 0; i < stackSize; ++i)
++					args.append(pdfContent.Stack[stackSize - 1 - i]);
++				switch (pdfContent.Operator)
++				{
++				case PdfOperator::q:
++					gsStack.push(currGS);
++					break;
++				case PdfOperator::Q:
++					currGS = gsStack.pop();
++					break;
++				case PdfOperator::cm:
++				{
++					if (args.size() == 6)
++					{
++						double mt[6];
++						for (int i = 0; i < 6; ++i)
++						{
++							mt[i] = args[i].GetReal();
++						}
++						QTransform transMatrix(mt[0], mt[1], mt[2], mt[3], mt[4], mt[5]);
++						currGS.ctm = transMatrix * currGS.ctm;
++					}
++				}
++				break;
++				case PdfOperator::w:
++					currGS.lineWidth = args[0].GetReal();
++					break;
++				case PdfOperator::J:
++					currGS.lineCap = args[0].GetNumber();
++					break;
++				case PdfOperator::j:
++					currGS.lineJoin = args[0].GetNumber();
++					break;
++				case PdfOperator::M:
++					currGS.lineJoin = args[0].GetReal();
++					break;
++				case PdfOperator::d:
++				{
++					currGS.dashPattern.first.clear();
++					PdfArray dashArr = args[0].GetArray();
++					for (uint i = 0; i < dashArr.size(); ++i)
++						currGS.dashPattern.first.append(dashArr[i].GetNumber());
++					currGS.dashPattern.second = args[1].GetNumber();
++				}
++				break;
++				case PdfOperator::g:
++					if (!usedColorSpaces.contains(CS_DeviceGray))
++						usedColorSpaces.append(CS_DeviceGray);
++					currGS.fillCS = CS_DeviceGray;
++					currGS.fillColor.clear();
++					currGS.fillColor.append(args[0].GetReal());
++					break;
++				case PdfOperator::G:
++					if (!usedColorSpaces.contains(CS_DeviceGray))
++						usedColorSpaces.append(CS_DeviceGray);
++					currGS.strokeCS = CS_DeviceGray;
++					currGS.strokeColor.clear();
++					currGS.strokeColor.append(args[0].GetReal());
++					break;
++				case PdfOperator::rg:
++					if (!usedColorSpaces.contains(CS_DeviceRGB))
++						usedColorSpaces.append(CS_DeviceRGB);
++					currGS.fillCS = CS_DeviceRGB;
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.fillColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::RG:
++					if (!usedColorSpaces.contains(CS_DeviceRGB))
++						usedColorSpaces.append(CS_DeviceRGB);
++					currGS.strokeCS = CS_DeviceRGB;
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.strokeColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::k:
++					if (!usedColorSpaces.contains(CS_DeviceCMYK))
++						usedColorSpaces.append(CS_DeviceCMYK);
++					currGS.fillCS = CS_DeviceCMYK;
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.fillColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::K:
++					if (!usedColorSpaces.contains(CS_DeviceCMYK))
++						usedColorSpaces.append(CS_DeviceCMYK);
++					currGS.strokeCS = CS_DeviceCMYK;
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.strokeColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::cs:
++				{
++					if (args.size() == 1 && args[0].IsName())
++					{
++						if (args[0].GetName() == "DeviceGray")
++						{
++							currGS.fillCS = CS_DeviceGray;
++							currGS.fillColor.clear();
++							currGS.fillColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceGray))
++								usedColorSpaces.append(CS_DeviceGray);
++						}
++						else if (args[0].GetName() == "DeviceRGB")
++						{
++							currGS.fillCS = CS_DeviceRGB;
++							currGS.fillColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.fillColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceRGB))
++								usedColorSpaces.append(CS_DeviceRGB);
++						}
++						else if (args[0].GetName() == "DeviceCMYK")
++						{
++							currGS.fillCS = CS_DeviceCMYK;
++							currGS.fillColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.fillColor.append(0);
++							currGS.fillColor.append(1);
++							if (!usedColorSpaces.contains(CS_DeviceCMYK))
++								usedColorSpaces.append(CS_DeviceCMYK);
++						}
++						else if (args[0].GetName() == "Pattern")
++						{
++							currGS.fillCS = CS_Pattern;
++							if (!usedColorSpaces.contains(CS_Pattern))
++								usedColorSpaces.append(CS_Pattern);
++						}
++						else
++						{
++							if (processedNamedCS.contains(args[0].GetName()))
++							{
++								currGS.fillCS = processedNamedCS.value(args[0].GetName());
++							}
++							else
++							{
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								{
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PDFColorSpace retval = getCSType(csEntry);
++									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++										usedColorSpaces.append(retval);
++									currGS.fillCS = retval;
++									processedNamedCS.insert(args[0].GetName(), retval);
++								}
++								else
++								{
++									qDebug() << "Supplied colorspace is undefined! File:" << m_filename;
++									return false;
++								}
++							}
++						}
++					}
++					else
++					{
++						qDebug() << "Wrong syntax in specifying color space! File:" << m_filename;
++						return false;
++					}
++				}
++				break;
++				case PdfOperator::CS:
++				{
++					if (args.size() == 1 && args[0].IsName())
++					{
++						if (args[0].GetName() == "DeviceGray")
++						{
++							currGS.strokeCS = CS_DeviceGray;
++							currGS.strokeColor.clear();
++							currGS.strokeColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceGray))
++								usedColorSpaces.append(CS_DeviceGray);
++						}
++						else if (args[0].GetName() == "DeviceRGB")
++						{
++							currGS.fillCS = CS_DeviceRGB;
++							currGS.strokeColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.strokeColor.append(0);
++							if (!usedColorSpaces.contains(CS_DeviceRGB))
++								usedColorSpaces.append(CS_DeviceRGB);
++						}
++						else if (args[0].GetName() == "DeviceCMYK")
++						{
++							currGS.fillCS = CS_DeviceCMYK;
++							currGS.strokeColor.clear();
++							for (int i = 0; i < 3; ++i)
++								currGS.strokeColor.append(0);
++							currGS.strokeColor.append(1);
++							if (!usedColorSpaces.contains(CS_DeviceCMYK))
++								usedColorSpaces.append(CS_DeviceCMYK);
++						}
++						else if (args[0].GetName() == "Pattern")
++						{
++							currGS.fillCS = CS_Pattern;
++							if (!usedColorSpaces.contains(CS_Pattern))
++								usedColorSpaces.append(CS_Pattern);
++						}
++						else
++						{
++							if (processedNamedCS.contains(args[0].GetName()))
++							{
++								currGS.strokeCS = processedNamedCS.value(args[0].GetName());
++							}
++							else
++							{
++								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								{
++									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PDFColorSpace retval = getCSType(csEntry);
++									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++										usedColorSpaces.append(retval);
++									currGS.strokeCS = retval;
++									processedNamedCS.insert(args[0].GetName(), retval);
++								}
++								else
++								{
++									qDebug() << "Supplied colorspace is undefined! File:" << m_filename;
++									return false;
++								}
++							}
++						}
++					}
++					else
++					{
++						qDebug() << "Wrong syntax in specifying color space! File:" << m_filename;
++						return false;
++					}
++				}
++				break;
++				case PdfOperator::sc:
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.fillColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::SC:
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++						currGS.strokeColor.append(args[i].GetReal());
++					break;
++				case PdfOperator::scn:
++					currGS.fillColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++					{
++						if (args[i].IsRealStrict() || args[i].IsNumber())
++							currGS.fillColor.append(args[i].GetReal());
++					}
++					break;
++				case PdfOperator::SCN:
++					currGS.strokeColor.clear();
++					for (int i = 0; i < args.size(); ++i)
++					{
++						if (args[i].IsRealStrict() || args[i].IsNumber())
++							currGS.strokeColor.append(args[i].GetReal());
++					}
++					break;
++				case PdfOperator::Do: // image or form XObject
++					// Handled in PdfContentType::DoXObject
++					break;
++				case PdfOperator::BI:
++					inlineImgDict = true;
++					break;
++				case PdfOperator::ID:
++					if (inlineImgDict)
++					{
++						PdfName colorspace("ColorSpace");
++						PdfName cs("CS");
++						if (args.contains(colorspace) || args.contains(cs))
++						{
++							int csIdx = args.contains(colorspace) ? args.indexOf(colorspace) : args.indexOf(cs);
++							if (args[csIdx + 1].IsName())
++							{
++								PdfName csName = args[csIdx + 1].GetName();
++								if ((csName == "G" || csName == "DeviceGray") && !usedColorSpaces.contains(CS_DeviceGray))
++									usedColorSpaces.append(CS_DeviceGray);
++								else if ((csName == "RGB" || csName == "DeviceRGB") && !usedColorSpaces.contains(CS_DeviceRGB))
++									usedColorSpaces.append(CS_DeviceRGB);
++								else if ((csName == "CMYK" || csName == "DeviceCMYK") && !usedColorSpaces.contains(CS_DeviceCMYK))
++									usedColorSpaces.append(CS_DeviceCMYK);
++								else if (!processedNamedCS.contains(csName))
++								{
++									if (colorSpacesDict && colorSpacesDict->FindKey(csName))
++									{
++										PdfObject* csEntry = colorSpacesDict->FindKey(csName);
++										if (csEntry)
++										{
++											PDFColorSpace retval = getCSType(csEntry);
++											if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++												usedColorSpaces.append(retval);
++											processedNamedCS.insert(csName, retval);
++										}
++									}
++									else
++									{
++										qDebug() << "Supplied colorspace for inline image is undefined!";
++										return false;
++									}
++								}
++							}
++						}
++						PdfName height("Height");
++						PdfName h("H");
++						PdfName width("Width");
++						PdfName w("W");
++						if ((args.contains(height) || args.contains(h)) && (args.contains(width) || args.contains(w)))
++						{
++							int heightIdx = args.contains(height) ? args.indexOf(height) : args.indexOf(h);
++							int widthIdx = args.contains(width) ? args.indexOf(width) : args.indexOf(w);
++							double height = args[heightIdx + 1].GetReal();
++							double width = args[widthIdx + 1].GetReal();
++							PDFImage img;
++							img.imgName = "Inline Image";
++							img.dpiX = qRound(width / (currGS.ctm.m11() / 72));
++							img.dpiY = qRound(height / (currGS.ctm.m22() / 72));
++							imgs.append(img);
++						}
++						inlineImgDict = false;
++					}
++					break;
++				case PdfOperator::gs:
++				{
++					if (!processedNamedGS.contains(args[0].GetName()))
++					{
++						if (args.size() == 1 && args[0].IsName() && extGStatesDict)
++						{
++							PdfObject* extGStateObj = extGStatesDict->FindKey(args[0].GetName());
++							if (extGStateObj)
++							{
++								inspectExtGStateObj(extGStateObj, usedColorSpaces, hasTransparency, usedFonts, currGS);
++							}
++							else
++							{
++								qDebug() << "Named graphic state used with gs operator is undefined in current ExtGState. File:" << m_filename;
++								return false;
++							}
++							processedNamedGS.append(args[0].GetName());
++						}
++						else
++						{
++							qDebug() << "Wrong syntax in applying extended graphic state (gs operator) or there's no ExtGState defined! File:" << m_filename;
++							return false;
++						}
++					}
++				}
++				break;
++				case PdfOperator::Tf:
++				{
++					if (processedNamedFont.contains(args[0].GetName()))
++					{
++						currGS.font.first = processedNamedFont.value(args[0].GetName());
++						currGS.font.second = args[1].GetReal();
++					}
++					else
++					{
++						if (args.size() == 2 && args[0].IsName() && fontsDict)
++						{
++							PdfObject* fontObj = fontsDict->FindKey(args[0].GetName());
++							if (fontObj)
++							{
++								PDFFont retval = getFontInfo(fontObj);
++								usedFonts.append(retval);
++								processedNamedFont.insert(args[0].GetName(), retval);
++								currGS.font.first = retval;
++								currGS.font.second = args[1].GetReal();
++							}
++							else
++							{
++								qDebug() << "The specified font cannot be found in current Resources! File:" << m_filename;
++								return false;
++							}
++						}
++						else
++						{
++							qDebug() << "Wrong syntax in use of Tf operator or there's no Font defined in current Resources dictionary! File:" << m_filename;
++							return false;
++						}
++					}
++				}
++				break;
++				case PdfOperator::Unknown:
++				default:
++					break;
++				}
++				args.clear();
++			}
++			if (pdfContent.Type == PdfContentType::DoXObject)
++			{
++				args.clear();
++				int stackSize = pdfContent.Stack.size();
++				for (size_t i = 0; i < stackSize; ++i)
++					args.append(pdfContent.Stack[stackSize - 1 - i]);
++				if (!processedNamedXObj.contains(args[0].GetName()))
++				{
++					if (args.size() == 1 && args[0].IsName() && xObjectsDict)
++					{
++						PdfObject* xObject = xObjectsDict->FindKey(args[0].GetName());
++						PdfDictionary* xObjectDict = (xObject && xObject->IsDictionary()) ? &(xObject->GetDictionary()) : nullptr;
++						PdfObject* subtypeObject = xObjectDict ? xObjectDict->FindKey("Subtype") : nullptr;
++						if (subtypeObject && subtypeObject->IsName())
++						{
++							if (subtypeObject->GetName() == "Image")
++							{
++								PdfObject* imgColorSpace = xObjectDict->FindKey("ColorSpace");
++								if (imgColorSpace)
++								{
++									PDFColorSpace retval = getCSType(imgColorSpace);
++									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++										usedColorSpaces.append(retval);
++								}
++								PdfObject* sMaskObj = xObjectDict->FindKey("SMask");
++								if (sMaskObj)
++									hasTransparency = true;
++								PDFImage img;
++								img.imgName = args[0].GetName().GetEscapedName().c_str();
++								double width = xObjectDict->FindKey("Width")->GetReal();
++								double height = xObjectDict->FindKey("Height")->GetReal();
++								img.dpiX = qRound(width / (currGS.ctm.m11() / 72));
++								img.dpiY = qRound(height / (currGS.ctm.m22() / 72));
++								imgs.append(img);
++							}
++							else if (subtypeObject->GetName() == "Form")
++							{
++								std::unique_ptr<PdfXObjectForm> xObj;
++								PdfXObject::TryCreateFromObject(*xObject, xObj);
++								inspectCanvas(xObj.get(), usedColorSpaces, hasTransparency, usedFonts, imgs); // recursive call
++							}
++						}
++						else
++						{
++							qDebug() << "Supplied external object is undefined! File:" << m_filename;
++							return false;
++						}
++						processedNamedXObj.append(args[0].GetName());
++					}
++					else
++					{
++						qDebug() << "Wrong syntax for Do operator or there's no XObject defined! File:" << m_filename;
++						return false;
++					}
++				}
++			}
++		}
++#else
+ 		// start parsing the content stream
+ 		PdfContentsTokenizer tokenizer(canvas);
+ 		EPdfContentsType t;
+@@ -269,7 +759,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					if (args.size() == 6)
+ 					{
+ 						double mt[6];
+-						for (int i=0; i<6; ++i)
++						for (int i = 0; i < 6; ++i)
+ 						{
+ 							mt[i] = args[i].GetReal();
+ 						}
+@@ -294,7 +784,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					currGS.dashPattern.first.clear();
+ 					PdfArray dashArr = args[0].GetArray();
+-					for (uint i=0; i<dashArr.size(); ++i)
++					for (uint i = 0; i < dashArr.size(); ++i)
+ 						currGS.dashPattern.first.append(dashArr[i].GetNumber());
+ 					currGS.dashPattern.second = args[1].GetNumber();
+ 					}
+@@ -318,7 +808,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceRGB);
+ 					currGS.fillCS = CS_DeviceRGB;
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.fillColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_RG:
+@@ -326,7 +816,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceRGB);
+ 					currGS.strokeCS = CS_DeviceRGB;
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.strokeColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_k:
+@@ -334,7 +824,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceCMYK);
+ 					currGS.fillCS = CS_DeviceCMYK;
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.fillColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_K:
+@@ -342,7 +832,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						usedColorSpaces.append(CS_DeviceCMYK);
+ 					currGS.strokeCS = CS_DeviceCMYK;
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.strokeColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_cs:
+@@ -361,7 +851,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceRGB;
+ 							currGS.fillColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.fillColor.append(0);
+ 							if (!usedColorSpaces.contains(CS_DeviceRGB))
+ 								usedColorSpaces.append(CS_DeviceRGB);
+@@ -370,7 +860,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceCMYK;
+ 							currGS.fillColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.fillColor.append(0);
+ 							currGS.fillColor.append(1);
+ 							if (!usedColorSpaces.contains(CS_DeviceCMYK))
+@@ -430,7 +920,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceRGB;
+ 							currGS.strokeColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.strokeColor.append(0);
+ 							if (!usedColorSpaces.contains(CS_DeviceRGB))
+ 								usedColorSpaces.append(CS_DeviceRGB);
+@@ -439,7 +929,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 						{
+ 							currGS.fillCS = CS_DeviceCMYK;
+ 							currGS.strokeColor.clear();
+-							for (int i=0; i<3; ++i)
++							for (int i = 0; i < 3; ++i)
+ 								currGS.strokeColor.append(0);
+ 							currGS.strokeColor.append(1);
+ 							if (!usedColorSpaces.contains(CS_DeviceCMYK))
+@@ -485,17 +975,17 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					break;
+ 				case KW_sc:
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.fillColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_SC:
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 						currGS.strokeColor.append(args[i].GetReal());
+ 					break;
+ 				case KW_scn:
+ 					currGS.fillColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 					{
+ 						if (args[i].IsReal() || args[i].IsNumber())
+ 							currGS.fillColor.append(args[i].GetReal());
+@@ -503,7 +993,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					break;
+ 				case KW_SCN:
+ 					currGS.strokeColor.clear();
+-					for (int i=0; i<args.size(); ++i)
++					for (int i = 0; i < args.size(); ++i)
+ 					{
+ 						if (args[i].IsReal() || args[i].IsNumber())
+ 							currGS.strokeColor.append(args[i].GetReal());
+@@ -689,6 +1179,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 				args.clear();
+ 			}
+ 		}
++#endif
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -714,14 +1205,14 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 	{
+ 		PdfArray arr = bmObj->GetArray();
+ 		currGS.blendModes.clear();
+-		for(uint i=0; i<arr.GetSize(); ++i)
++		for (uint i = 0; i < arr.GetSize(); ++i)
+ 			currGS.blendModes.append(arr[i].GetName().GetEscapedName().c_str());
+ 		if (arr[0].IsName() && !(arr[0].GetName() == "Normal" || arr[0].GetName() == "Compatible"))
+ 			hasTransparency = true;
+ 	}
+ 
+ 	PdfObject* caObj = extGStateDict ? extGStateDict->FindKey("ca") : nullptr;
+-	if (caObj && (caObj->IsReal() || caObj->IsNumber()))
++	if (caObj && (caObj->IsRealStrict() || caObj->IsNumber()))
+ 	{
+ 		currGS.fillAlphaConstant = caObj->GetReal();
+ 		if (caObj->GetReal() < 1)
+@@ -729,7 +1220,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 	}
+ 
+ 	PdfObject* cAObj = extGStateDict ? extGStateDict->FindKey("CA") : nullptr;
+-	if (cAObj && (cAObj->IsReal() || cAObj->IsNumber()))
++	if (cAObj && (cAObj->IsRealStrict() || cAObj->IsNumber()))
+ 	{
+ 		if (cAObj->GetReal() < 1)
+ 			hasTransparency = true;
+@@ -780,7 +1271,7 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		PdfObject dObjA = dObj->GetArray()[0];
+ 		PdfArray dashArr = dObjA.GetArray();
+ 		currGS.dashPattern.first.clear();
+-		for (uint i=0; i<dashArr.GetSize(); ++i)
++		for (uint i = 0; i < dashArr.GetSize(); ++i)
+ 			currGS.dashPattern.first.append(dashArr[i].GetNumber());
+ 		PdfObject dObjB = dObj->GetArray()[1];
+ 		currGS.dashPattern.second = dObjB.GetNumber();
+@@ -816,7 +1307,11 @@ PDFFont PDFAnalyzer::getFontInfo(PdfObje
+ 		if (descendantFonts && descendantFonts->IsArray())
+ 		{
+ 			const PdfReference& refDescFont = descendantFonts->GetArray()[0].GetReference();
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++			PdfObject* descendantFont = descendantFonts->GetDocument()->GetObjects().GetObject(refDescFont);
++#else
+ 			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
++#endif
+ 			PdfDictionary* descendantFontDict = (descendantFont && descendantFont->IsDictionary()) ? &(descendantFont->GetDictionary()) : nullptr;
+ 			const PdfObject* subtypeDescFont = descendantFontDict->FindKey("Subtype");
+ 			fontDesc = &(descendantFontDict->MustGetKey("FontDescriptor"));
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9783,22 +9783,298 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 	QScopedPointer<PoDoFo::PdfMemDocument> doc;
+ 	try
+ 	{
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PoDoFo::PdfError::EnableDebug(false);
+ 		PoDoFo::PdfError::EnableLogging(false);
+-		doc.reset(new PoDoFo::PdfMemDocument(fn.toLocal8Bit().data()));
++#endif
++		doc.reset(new PoDoFo::PdfMemDocument());
++		doc->Load(fn.toLocal8Bit().data());
+ 	}
+-	catch(PoDoFo::PdfError& e)
++	catch (PoDoFo::PdfError& e)
+ 	{
+ 		qDebug() << "PoDoFo error, falling back to raster!";
+ 		e.PrintErrorMsg();
+ 		return false;
+ 	}
+ 
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	try
+ 	{
+-		PoDoFo::PdfPage*   page      = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
+-		PoDoFo::PdfObject* pageObj   = page ? page->GetObject() : nullptr;
+-		PoDoFo::PdfObject* contents  = page ? page->GetContents() : nullptr;
++		PoDoFo::PdfPage& page = doc->GetPages().GetPageAt(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
++		PoDoFo::PdfObject& pageObj = page.GetObject();
++		PoDoFo::PdfObject* contents = page.GetContents() ? &(page.GetContents()->GetObject()) : nullptr;
++		PoDoFo::PdfObject* resources = page.GetResources() ? &(page.GetResources()->GetObject()) : nullptr;
++		PoDoFo::PdfDictionary* pageObjDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
++		{
++			resources = par->FindKey("Resources");
++			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
++			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
++		}
++		if (contents && contents->GetDataType() == PoDoFo::PdfDataType::Dictionary)
++		{
++			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
++			PoDoFo::PdfObjectStream* stream = contents->GetStream();
++			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
++			QList<PoDoFo::PdfReference> referencedObjects;
++			PoDoFo::PdfObject* nextObj { nullptr };
++			PdfId xObj = writer.newObject();
++			PdfId xResources = writer.newObject();
++			PdfId xParents = 0;
++			importedObjects[page.GetObject().GetIndirectReference()] = xObj;
++			writer.startObj(xObj);
++			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
++			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
++			int rotation = page.GetRotationRaw();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
++			QTransform pageM;
++			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
++			pageM.rotate(rotation);
++			if (rotation == 90)
++				pageM.translate(0.0, -imgHeight);
++			else if (rotation == 180)
++				pageM.translate(-imgWidth, -imgHeight);
++			else if (rotation == 270)
++				pageM.translate(-imgWidth, 0.0);
++			pageM.scale(imgWidth, imgHeight);
++			pageM = pageM.inverted();
++			PutDoc("\n/BBox [" + Pdf::toPdf(pageRect.GetLeft()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetLeft() + pageRect.Width));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
++			PutDoc("]");
++			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
++			PutDoc("]");
++			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
++			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			if (nextObj)
++			{
++				PutDoc("\n/Group "); // PDF 1.4
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++			/*
++			PoDoFo::PdfObject parents = pageDict->FindKey("StructParents");
++			if (parents)
++			{
++				xParents = writer.newObject();
++				PutDoc("\n/StructParents " + Pdf::toPdf(xParents)); // required if page uses structured content
++			}
++			*/
++
++			const char* mbuffer = nullptr;
++			long mlen = 0;
++			PoDoFo::charbuff strBuff = stream->GetCopy(true);
++			mlen = strBuff.size();
++			mbuffer = strBuff.c_str();
++			if (mbuffer[mlen - 1] == '\n')
++				--mlen;
++			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
++			nextObj = contentsDict.FindKey("Filter");
++			if (nextObj)
++			{
++				PutDoc("\n/Filter ");
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++			nextObj = contentsDict.FindKey("DecodeParms");
++			if (nextObj)
++			{
++				PutDoc("\n/DecodeParms ");
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++			PutDoc("\n>>\nstream\n");
++			{
++				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
++				EncodeArrayToStream(buffer, xObj);
++			}  // disconnect QByteArray from raw data
++			PutDoc("\nendstream");
++			writer.endObj(xObj);
++			// write resources
++			if (resources)
++			{
++				copyPoDoFoObject(resources, xResources, importedObjects);
++			}
++			else
++			{
++				writer.startObj(xResources);
++				PutDoc("<< >>");
++				writer.endObj(xResources);
++			}
++			if (xParents)
++			{
++				// create structured parents
++			}
++			// write referenced objects
++			PoDoFo::PdfIndirectObjectList& allObjects = contents->GetDocument()->GetObjects();
++			for (int i = 0; i < referencedObjects.size(); ++i)
++			{
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects.GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
++			}
++
++			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
++			imgInfo.ResNum = ResCount;
++			ResCount++;
++			// Avoid a divide-by-zero if width/height are less than 1 point:
++			imgInfo.Width = qMax(1, (int) imgWidth);
++			imgInfo.Height = qMax(1, (int) imgHeight);
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
++			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
++			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
++			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
++			imgInfo.sya = sy * imgHeight / imgInfo.Height;
++
++			return true;
++		}
++		if (contents && contents->GetDataType() == PoDoFo::PdfDataType::Array)//Page contents might be an array
++		{
++			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
++			QList<PoDoFo::PdfReference> referencedObjects;
++			PoDoFo::PdfObject* nextObj;
++			PdfId xObj = writer.newObject();
++			PdfId xResources = writer.newObject();
++			PdfId xParents = 0;
++			importedObjects[page.GetObject().GetIndirectReference()] = xObj;
++			writer.startObj(xObj);
++			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
++			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
++			int rotation = page.GetRotationRaw();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
++			QTransform pageM;
++			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
++			pageM.rotate(rotation);
++			if (rotation == 90)
++				pageM.translate(0.0, -imgHeight);
++			else if (rotation == 180)
++				pageM.translate(-imgWidth, -imgHeight);
++			else if (rotation == 270)
++				pageM.translate(-imgWidth, 0.0);
++			pageM.scale(imgWidth, imgHeight);
++			pageM = pageM.inverted();
++			PutDoc("\n/BBox [" + Pdf::toPdf(pageRect.GetLeft()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom()));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetLeft() + pageRect.Width));
++			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
++			PutDoc("]");
++			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
++			PutDoc("]");
++			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
++			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			if (nextObj)
++			{
++				PutDoc("\n/Group "); // PDF 1.4
++				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
++			}
++
++			const char* mbuffer = nullptr;
++			long mlen = 0;
++			PoDoFo::charbuff strBuffer;
++			PoDoFo::StringStreamDevice strStreamDev(strBuffer);
++			PoDoFo::PdfArray carray(page.GetContents()->GetObject().GetArray());
++			for (unsigned int ci = 0; ci < carray.size(); ++ci)
++			{
++				if (carray[ci].HasStream())
++				{
++					carray[ci].GetStream()->CopyTo(strStreamDev, false);
++				}
++				else if (carray[ci].IsReference())
++				{
++					nextObj = doc->GetObjects().GetObject(carray[ci].GetReference());
++
++					while (nextObj != nullptr)
++					{
++						if (nextObj->IsReference())
++						{
++							nextObj = doc->GetObjects().GetObject(nextObj->GetReference());
++						}
++						else if (nextObj->HasStream())
++						{
++							nextObj->GetStream()->CopyTo(strStreamDev, false);
++							break;
++						}
++					}
++				}
++			}
++			// end of copy
++			mlen = strBuffer.size();
++			mbuffer = strBuffer.c_str();
++
++			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
++			PutDoc("\n>>\nstream\n");
++			{
++				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
++				EncodeArrayToStream(buffer, xObj);
++			}  // disconnect QByteArray from raw data
++			PutDoc("\nendstream");
++			writer.endObj(xObj);
++			// write resources
++			if (resources)
++			{
++				copyPoDoFoObject(resources, xResources, importedObjects);
++			}
++			else
++			{
++				writer.startObj(xResources);
++				PutDoc("<< >>");
++				writer.endObj(xResources);
++			}
++			if (xParents)
++			{
++				// create structured parents
++			}
++			// write referenced objects
++			PoDoFo::PdfIndirectObjectList& allObjects = contents->GetDocument()->GetObjects();
++			for (int i = 0; i < referencedObjects.size(); ++i)
++			{
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects.GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
++			}
++
++			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
++			imgInfo.ResNum = ResCount;
++			ResCount++;
++			// Avoid a divide-by-zero if width/height are less than 1 point:
++			imgInfo.Width = qMax(1, (int) imgWidth);
++			imgInfo.Height = qMax(1, (int) imgHeight);
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
++			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
++			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
++			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
++			imgInfo.sya = sy * imgHeight / imgInfo.Height;
++
++			return true;
++		}
++	}
++	catch (PoDoFo::PdfError& e)
++	{
++		fatalError = true;
++		qDebug() << "PoDoFo error!";
++		e.PrintErrorMsg();
++		return false;
++	}
++#else
++	try
++	{
++		PoDoFo::PdfPage* page = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
++		PoDoFo::PdfObject* pageObj = page ? page->GetObject() : nullptr;
++		PoDoFo::PdfObject* contents = page ? page->GetContents() : nullptr;
+ 		PoDoFo::PdfObject* resources = page ? page->GetResources() : nullptr;
+ 		PoDoFo::PdfDictionary* pageObjDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+ 		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
+@@ -9807,13 +10083,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
+ 			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
+ 		}
+-		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Dictionary)
++		if (contents && contents->GetDataType() == PoDoFo::ePdfDataType_Dictionary)
+ 		{
+ 			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
+ 			PoDoFo::PdfStream* stream = contents->GetStream();
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+-			PoDoFo::PdfObject* nextObj { nullptr };
++			const PoDoFo::PdfObject* nextObj { nullptr };
+ 			PdfId xObj = writer.newObject();
+ 			PdfId xResources = writer.newObject();
+ 			PdfId xParents = 0;
+@@ -9822,7 +10098,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9841,14 +10117,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-								 + Pdf::toPdf(pageM.m12()) + " "
+-								 + Pdf::toPdf(pageM.m21()) + " "
+-								 + Pdf::toPdf(pageM.m22()) + " "
+-								 + Pdf::toPdf(pageM.dx())  + " "
+-								 + Pdf::toPdf(pageM.dy())  + " ");
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfObject* pageObj = page->GetObject();
+ 			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+ 			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+@@ -9864,16 +10139,16 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				PutDoc("\n/StructParents " + Pdf::toPdf(xParents)); // required if page uses structured content
+ 			}
+ 			*/
+-			char * mbuffer = nullptr;
+-			long mlen = 0;
+ 
+ 			// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
++			char* mbuffer = nullptr;
++			long mlen = 0;
+ 			PoDoFo::PdfMemoryOutputStream oStream(1);
+ 			stream->GetCopy(&oStream);
+ 			oStream.Close();
+ 			mlen = oStream.GetLength();
+ 			mbuffer = oStream.TakeBuffer();
+-			if (mbuffer[mlen-1] == '\n')
++			if (mbuffer[mlen - 1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+ 			nextObj = contentsDict.FindKey("Filter");
+@@ -9893,7 +10168,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 				EncodeArrayToStream(buffer, xObj);
+ 			}  // disconnect QByteArray from raw data
+-			free (mbuffer);
++			free(mbuffer);
+ 			PutDoc("\nendstream");
+ 			writer.endObj(xObj);
+ 			// write resources
+@@ -9915,18 +10190,19 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PoDoFo::PdfVecObjects* allObjects = contents->GetOwner();
+ 			for (int i=0; i < referencedObjects.size(); ++i)
+ 			{
+-				nextObj = allObjects->GetObject(referencedObjects[i]);
+-				copyPoDoFoObject(nextObj, importedObjects[nextObj->Reference()], importedObjects);
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects->GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
+ 			}
+ 
+ 			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
+ 			imgInfo.ResNum = ResCount;
+ 			ResCount++;
+ 			// Avoid a divide-by-zero if width/height are less than 1 point:
+-			imgInfo.Width  = qMax(1, (int) imgWidth);
++			imgInfo.Width = qMax(1, (int) imgWidth);
+ 			imgInfo.Height = qMax(1, (int) imgHeight);
+-			imgInfo.xa  = sx * imgWidth / imgInfo.Width;
+-			imgInfo.ya  = sy * imgHeight / imgInfo.Height;
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
+ 			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
+ 			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
+ 			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
+@@ -9934,7 +10210,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 
+ 			return true;
+ 		}
+-		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Array)//Page contents might be an array
++		if (contents && contents->GetDataType() == PoDoFo::ePdfDataType_Array)//Page contents might be an array
+ 		{
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+@@ -9947,7 +10223,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9966,14 +10242,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-								 + Pdf::toPdf(pageM.m12()) + " "
+-								 + Pdf::toPdf(pageM.m21()) + " "
+-								 + Pdf::toPdf(pageM.m22()) + " "
+-								 + Pdf::toPdf(pageM.dx())  + " "
+-								 + Pdf::toPdf(pageM.dy())  + " ");
++				+ Pdf::toPdf(pageM.m12()) + " "
++				+ Pdf::toPdf(pageM.m21()) + " "
++				+ Pdf::toPdf(pageM.m22()) + " "
++				+ Pdf::toPdf(pageM.dx()) + " "
++				+ Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfObject* pageObj = page->GetObject();
+ 			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+ 			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
+ 			if (nextObj)
+@@ -9982,11 +10257,10 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+ 
+-			char * mbuffer = nullptr;
+-			long mlen = 0;
+ 			// copied from podofoimpose
+-			PoDoFo::PdfMemoryOutputStream outMemStream (1);
+-//			PoDoFo::PdfFilteredEncodeStream outMemStream (outMemStreamRaw, ePdfFilter_FlateDecode, false);
++			char* mbuffer = nullptr;
++			long mlen = 0;
++			PoDoFo::PdfMemoryOutputStream outMemStream(1);
+ 			PoDoFo::PdfArray carray(page->GetContents()->GetArray());
+ 			for (unsigned int ci = 0; ci < carray.size(); ++ci)
+ 			{
+@@ -10000,7 +10274,6 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 
+ 					while (nextObj != nullptr)
+ 					{
+-
+ 						if (nextObj->IsReference())
+ 						{
+ 							nextObj = doc->GetObjects().GetObject(nextObj->GetReference());
+@@ -10016,29 +10289,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			// end of copy
+ 			mlen = outMemStream.GetLength();
+ 			mbuffer = outMemStream.TakeBuffer();
+-//			if (mbuffer[mlen-1] == '\n')
+-//				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+-/*
+-			nextObj = contentsDict.FindKey("Filter");
+-			if (nextObj)
+-			{
+-				PutDoc("\n/Filter ");
+-				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+-			}
+-			nextObj = contentsDict.FindKey("DecodeParms");
+-			if (nextObj)
+-			{
+-				PutDoc("\n/DecodeParms ");
+-				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+-			}
+-*/
+ 			PutDoc("\n>>\nstream\n");
+ 			{
+ 				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 				EncodeArrayToStream(buffer, xObj);
+ 			}  // disconnect QByteArray from raw data
+-			free (mbuffer);
++			free(mbuffer);
+ 			PutDoc("\nendstream");
+ 			writer.endObj(xObj);
+ 			// write resources
+@@ -10058,20 +10315,21 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			}
+ 			// write referenced objects
+ 			PoDoFo::PdfVecObjects* allObjects = contents->GetOwner();
+-			for (int i=0; i < referencedObjects.size(); ++i)
++			for (int i = 0; i < referencedObjects.size(); ++i)
+ 			{
+-				nextObj = allObjects->GetObject(referencedObjects[i]);
+-				copyPoDoFoObject(nextObj, importedObjects[nextObj->Reference()], importedObjects);
++				const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++				nextObj = allObjects->GetObject(pdfRef);
++				copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
+ 			}
+ 
+ 			pageData.ImgObjects[ResNam + "I" + Pdf::toPdf(ResCount)] = xObj;
+ 			imgInfo.ResNum = ResCount;
+ 			ResCount++;
+ 			// Avoid a divide-by-zero if width/height are less than 1 point:
+-			imgInfo.Width  = qMax(1, (int) imgWidth);
++			imgInfo.Width = qMax(1, (int) imgWidth);
+ 			imgInfo.Height = qMax(1, (int) imgHeight);
+-			imgInfo.xa  = sx * imgWidth / imgInfo.Width;
+-			imgInfo.ya  = sy * imgHeight / imgInfo.Height;
++			imgInfo.xa = sx * imgWidth / imgInfo.Width;
++			imgInfo.ya = sy * imgHeight / imgInfo.Height;
+ 			// Width/Height are integers and may not exactly equal pageRect.GetWidth()/
+ 			// pageRect.GetHeight(). Adjust scale factor to compensate for the difference.
+ 			imgInfo.sxa = sx * imgWidth / imgInfo.Width;
+@@ -10079,24 +10337,76 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 
+ 			return true;
+ 		}
+-
+ 	}
+-	catch(PoDoFo::PdfError& e)
++	catch (PoDoFo::PdfError& e)
+ 	{
+ 		fatalError = true;
+ 		qDebug() << "PoDoFo error!";
+ 		e.PrintErrorMsg();
+ 		return false;
+ 	}
+-#endif
++#endif // PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0)
++
++#endif // HAVE_PODOFO
+ 	return false;
+ }
+ 
+ 
+ #if HAVE_PODOFO
+ 
+-void PDFLibCore::copyPoDoFoDirect(const PoDoFo::PdfVariant* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, PdfId>& importedObjects)
++void PDFLibCore::copyPoDoFoDirect(const PoDoFo::PdfObject* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, PdfId>& importedObjects)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++	switch (obj->GetDataType())
++	{
++	case PoDoFo::PdfDataType::Reference:
++	{
++		const PoDoFo::PdfReference& reference(obj->GetReference());
++		PdfId objNr;
++		if (!importedObjects.contains(reference))
++		{
++			objNr = writer.newObject();
++			importedObjects[reference] = objNr;
++			referencedObjects.append(reference);
++		}
++		else
++		{
++			objNr = importedObjects[reference];
++		}
++		PutDoc(" " + Pdf::toPdf(objNr) + " 0 R");
++		break;
++	}
++	case PoDoFo::PdfDataType::Array:
++	{
++		const PoDoFo::PdfArray& array(obj->GetArray());
++		PutDoc("[");
++		for (uint i = 0; i < array.size(); ++i)
++			copyPoDoFoDirect(&(array[i]), referencedObjects, importedObjects);
++		PutDoc("]");
++		break;
++	}
++	case PoDoFo::PdfDataType::Dictionary:
++	{
++		const PoDoFo::PdfDictionary& dict(obj->GetDictionary());
++		PutDoc("<<");
++		for (auto k = dict.begin(); k != dict.end(); ++k)
++		{
++			std::string str("\n/" + k->first.GetEscapedName());
++			PutDoc(QByteArray::fromRawData(str.data(), str.size()));
++			copyPoDoFoDirect(&k->second, referencedObjects, importedObjects);
++		}
++		PutDoc(" >>");
++		break;
++	}
++	default:
++	{
++		std::string str;
++		obj->GetVariant().ToString(str);
++		str = " " + str;
++		PutDoc(QByteArray::fromRawData(str.data(), str.size()));
++	}
++	}
++#else
+ 	switch (obj->GetDataType())
+ 	{
+ 		case PoDoFo::ePdfDataType_Reference:
+@@ -10147,11 +10457,41 @@ void PDFLibCore::copyPoDoFoDirect(const
+ 			PutDoc(QByteArray::fromRawData(str.data(), str.size()));
+ 		}
+ 	}
+-
++#endif
+ }
+ 
+ void PDFLibCore::copyPoDoFoObject(const PoDoFo::PdfObject* obj, PdfId scObjID, QMap<PoDoFo::PdfReference, PdfId>& importedObjects)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++	const PoDoFo::PdfIndirectObjectList& allObjects = obj->GetDocument()->GetObjects();
++	QList<PoDoFo::PdfReference> referencedObjects;
++	writer.startObj(scObjID);
++	copyPoDoFoDirect(obj, referencedObjects, importedObjects);
++	if (obj->HasStream())
++	{
++		const PoDoFo::PdfObjectStream* stream = obj->GetStream();
++		PoDoFo::charbuff strBuff = stream->GetCopy(true);
++		const char* mbuffer = strBuff.c_str();
++		size_t mlen = strBuff.size();
++		if (mbuffer[mlen - 1] == '\n')
++			--mlen;
++		PutDoc("\nstream\n");
++		{
++			QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
++			EncodeArrayToStream(buffer, scObjID);
++		}
++		PutDoc("\nendstream");
++	}
++	PutDoc("");
++	writer.endObj(scObjID);
++	// recurse:
++	for (int i = 0; i < referencedObjects.size(); ++i)
++	{
++		const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++		const PoDoFo::PdfObject* nextObj = allObjects.GetObject(pdfRef);
++		copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
++	}
++#else
+ 	PoDoFo::PdfVecObjects* allObjects = obj->GetOwner();
+ 	QList<PoDoFo::PdfReference> referencedObjects;
+ 	writer.startObj(scObjID);
+@@ -10159,7 +10499,7 @@ void PDFLibCore::copyPoDoFoObject(const
+ 	if (obj->HasStream())
+ 	{
+ 		const PoDoFo::PdfStream* stream = obj->GetStream();
+-		char * mbuffer = nullptr;
++		char* mbuffer = nullptr;
+ 		long mlen = 0;
+ 
+ 		// seems more complicated at first, but in fact it makes the code more stable wrt podofo changes
+@@ -10168,14 +10508,14 @@ void PDFLibCore::copyPoDoFoObject(const
+ 		oStream.Close();
+ 		mlen = oStream.GetLength();
+ 		mbuffer = oStream.TakeBuffer();
+-		if (mbuffer[mlen-1] == '\n')
++		if (mbuffer[mlen - 1] == '\n')
+ 			--mlen;
+ 		PutDoc("\nstream\n");
+ 		{
+ 			QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 			EncodeArrayToStream(buffer, scObjID);
+ 		}  // disconnect QByteArray from raw data
+-		free (mbuffer);
++		free(mbuffer);
+ 		PutDoc("\nendstream");
+ 	}
+ 	PutDoc("");
+@@ -10183,9 +10523,11 @@ void PDFLibCore::copyPoDoFoObject(const
+ 	// recurse:
+ 	for (int i=0; i < referencedObjects.size(); ++i)
+ 	{
+-		PoDoFo::PdfObject* nextObj = allObjects->GetObject(referencedObjects[i]);
+-		copyPoDoFoObject(nextObj, importedObjects[nextObj->Reference()], importedObjects);
++		const PoDoFo::PdfReference& pdfRef = referencedObjects[i];
++		const PoDoFo::PdfObject* nextObj = allObjects->GetObject(pdfRef);
++		copyPoDoFoObject(nextObj, importedObjects[pdfRef], importedObjects);
+ 	}
++#endif
+ }
+ #endif
+ 
+--- a/scribus/pdflib_core.h
++++ b/scribus/pdflib_core.h
+@@ -225,8 +225,8 @@ private:
+ 	bool    PDF_Image(PageItem* c, const QString& fn, double sx, double sy, double x, double y, bool fromAN = false, const QString& Profil = "", bool Embedded = false, eRenderIntent Intent = Intent_Relative_Colorimetric, QByteArray* output = nullptr);
+ 	bool    PDF_EmbeddedPDF(PageItem* c, const QString& fn, double sx, double sy, double x, double y, ShIm& imgInfo, bool &fatalError);
+ #if HAVE_PODOFO
+-	void copyPoDoFoObject(const PoDoFo::PdfObject* obj, uint scObjID, QMap<PoDoFo::PdfReference, uint>& importedObjects);
+-	void copyPoDoFoDirect(const PoDoFo::PdfVariant* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, uint>& importedObjects);
++	void copyPoDoFoObject(const PoDoFo::PdfObject* obj, PdfId scObjID, QMap<PoDoFo::PdfReference, uint>& importedObjects);
++	void copyPoDoFoDirect(const PoDoFo::PdfObject* obj, QList<PoDoFo::PdfReference>& referencedObjects, QMap<PoDoFo::PdfReference, uint>& importedObjects);
+ #endif
+ 
+ 	quint32 encode32dVal(double val) const;
+--- a/scribus/plugins/import/ai/importai.cpp
++++ b/scribus/plugins/import/ai/importai.cpp
+@@ -581,13 +581,24 @@ bool AIPlug::extractFromPDF(const QStrin
+ 	}
+ 	try
+ 	{
++#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PoDoFo::PdfError::EnableDebug( false );
+ 		PoDoFo::PdfError::EnableLogging( false );
+-		PoDoFo::PdfMemDocument doc( infile.toLocal8Bit().data() );
++#endif
++		PoDoFo::PdfMemDocument doc;
++		doc.Load(infile.toLocal8Bit().data());
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++		PoDoFo::PdfPage* curPage = &(doc.GetPages().GetPageAt(0));
++#else
+ 		PoDoFo::PdfPage *curPage = doc.GetPage(0);
++#endif
+ 		if (curPage != nullptr)
+ 		{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++			PoDoFo::PdfObject* pageObj = &(curPage->GetObject());
++#else
+ 			PoDoFo::PdfObject* pageObj = curPage->GetObject();
++#endif
+ 			PoDoFo::PdfDictionary* pageDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+ 			PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
+ 			if (piece != nullptr)
+@@ -618,6 +629,33 @@ bool AIPlug::extractFromPDF(const QStrin
+ 					}
+ 					if (data != nullptr)
+ 					{
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
++						if (num == 2)
++						{
++							Key = name.arg(1);
++							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							PoDoFo::PdfObjectStream const* stream = data->GetStream();
++							PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++							qint64 bLen = strBuffer.size();
++							const char* Buffer = strBuffer.c_str();
++							outf.write(Buffer, bLen);
++						}
++						else
++						{
++							for (int a = 2; a < num; a++)
++							{
++								Key = name.arg(a);
++								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++								if (data == nullptr)
++									break;
++								PoDoFo::PdfObjectStream const* stream = data->GetStream();
++								PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++								qint64 bLen = strBuffer.size();
++								const char* Buffer = strBuffer.c_str();
++								outf.write(Buffer, bLen);
++							}
++						}
++#else
+ 						if (num == 2)
+ 						{
+ 							Key = name.arg(1);
+@@ -649,6 +687,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 								free( Buffer );
+ 							}
+ 						}
++#endif
+ 					}
+ 					ret = true;
+ 				}
diff --git a/srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch b/srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch
new file mode 100644
index 0000000000000..750d8fa0a9440
--- /dev/null
+++ b/srcpkgs/scribus/patches/0014-podofo-0.10-compat-podofo-0.9.6.patch
@@ -0,0 +1,853 @@
+From 000d73d22b362a010bd4c80e6076343bc62119f3 Mon Sep 17 00:00:00 2001
+From: Jean Ghali <jghali@libertysurf.fr>
+Date: Wed, 16 Aug 2023 20:54:40 +0000
+Subject: [PATCH 10/13] #17005: Restore compatibility with podofo <= 0.9.6
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25604 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 6ca4984f122b46a6ab03300efab6b858b5c77a2d)
+---
+ scribus/pdf_analyzer.cpp               | 274 +++++++++++++++++++++----
+ scribus/pdflib_core.cpp                |  80 ++++----
+ scribus/plugins/import/ai/importai.cpp | 134 +++++++-----
+ 3 files changed, 350 insertions(+), 138 deletions(-)
+
+--- a/scribus/pdf_analyzer.cpp
++++ b/scribus/pdf_analyzer.cpp
+@@ -30,10 +30,6 @@ for which a new license (GPL+exception)
+ #ifdef HAVE_PODOFO
+ using namespace PoDoFo;
+ 
+-#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+-#define IsRealStrict IsReal
+-#endif
+-
+ static QHash<QString, PDFContentStreamKeyword> kwNameMap;
+ 
+ // we gonna need a map from string values to the defined enum of pdf keywords
+@@ -184,6 +180,7 @@ PDFColorSpace PDFAnalyzer::getCSType(Pdf
+ 
+ bool PDFAnalyzer::inspectCanvas(PdfCanvas* canvas, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, QList<PDFImage> & imgs)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
+ 	PdfDictionary* colorSpacesDict { nullptr };
+ 	PdfDictionary* xObjectsDict { nullptr };
+@@ -198,21 +195,12 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		// get hold of a PdfObject pointer of this canvas
+ 		// needed for the finding resources code below to work
+ 		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PdfObject* canvasObject = page ? &(page->GetObject()) : &(dynamic_cast<PdfXObject*>(canvas)->GetObject());
+-
+-#else
+-		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
+-#endif
+ 		PdfDictionary* canvasDict = (canvasObject && canvasObject->IsDictionary()) ? &(canvasObject->GetDictionary()) : nullptr;
+ 
+ 		// find a resource with ColorSpace entry
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 		PdfResources* canvasRsrc = canvas->GetResources();
+ 		PdfObject* resources = &(canvasRsrc->GetObject());
+-#else
+-		PdfObject* resources = canvas->GetResources();
+-#endif
+ 		for (PdfDictionary* par = canvasDict, *parentDict = nullptr; par && !resources; par = parentDict)
+ 		{
+ 			resources = par->FindKey("Resources");
+@@ -262,26 +250,24 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 
+ 	try
+ 	{
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 		// start parsing the content stream
+ 		PdfContentReaderArgs tokenizerArgs = { PdfContentReaderFlags::DontFollowXObjectForms };
+ 		PdfContentStreamReader tokenizer(*canvas, tokenizerArgs);
+ 		PdfContent pdfContent;
+ 		PdfVariant var;
+-		bool readToken;
+ 
+ 		int tokenNumber = 0;
+ 		bool inlineImgDict = false;
+ 		QList<PdfVariant> args;
+ 		QStack<PDFGraphicState> gsStack;
+ 		PDFGraphicState currGS;
+-		while ((readToken = tokenizer.TryReadNext(pdfContent)))
++		while (tokenizer.TryReadNext(pdfContent))
+ 		{
+ 			++tokenNumber;
+ 			if (pdfContent.Type == PdfContentType::Operator)
+ 			{
+ 				args.clear();
+-				int stackSize = pdfContent.Stack.size();
++				size_t stackSize = pdfContent.Stack.size();
+ 				for (size_t i = 0; i < stackSize; ++i)
+ 					args.append(pdfContent.Stack[stackSize - 1 - i]);
+ 				switch (pdfContent.Operator)
+@@ -669,7 +655,7 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 			if (pdfContent.Type == PdfContentType::DoXObject)
+ 			{
+ 				args.clear();
+-				int stackSize = pdfContent.Stack.size();
++				size_t stackSize = pdfContent.Stack.size();
+ 				for (size_t i = 0; i < stackSize; ++i)
+ 					args.append(pdfContent.Stack[stackSize - 1 - i]);
+ 				if (!processedNamedXObj.contains(args[0].GetName()))
+@@ -723,7 +709,73 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 				}
+ 			}
+ 		}
++	}
++	catch (PdfError & e)
++	{
++		qDebug() << "Error in parsing content stream File:" << m_filename;
++		e.PrintErrorMsg();
++		return false;
++	}
++	return true;
+ #else
++	// this method can be used to get used color spaces, detect transparency, and get used fonts in either PdfPage or PdfXObject
++	PdfObject* colorSpaceRes { nullptr };
++	PdfObject* xObjects { nullptr };
++	PdfObject* transGroup { nullptr };
++	PdfObject* extGState { nullptr };
++	PdfObject* fontRes { nullptr };
++	QMap<PdfName, PDFColorSpace> processedNamedCS;
++	QMap<PdfName, PDFFont> processedNamedFont;
++	QList<PdfName> processedNamedXObj;
++	QList<PdfName> processedNamedGS;
++	try
++	{
++		// get hold of a PdfObject pointer of this canvas
++		// needed for the finding resources code below to work
++		PdfPage* page = dynamic_cast<PdfPage*>(canvas);
++		PdfObject* canvasObject = page ? (page->GetObject()) : ((dynamic_cast<PdfXObject*>(canvas))->GetObject());
++
++		// find a resource with ColorSpace entry
++		PdfObject* resources = canvas->GetResources();
++		for (PdfObject* par = canvasObject; par && !resources; par = par->GetIndirectKey("Parent"))
++		{
++			resources = par->GetIndirectKey("Resources");
++		}
++		colorSpaceRes = resources ? resources->GetIndirectKey("ColorSpace") : nullptr;
++		xObjects = resources ? resources->GetIndirectKey("XObject") : nullptr;
++		extGState = resources ? resources->GetIndirectKey("ExtGState") : nullptr;
++		fontRes = resources ? resources->GetIndirectKey("Font") : nullptr;
++
++		// getting the transparency group of this content stream (if available)
++		transGroup = canvasObject ? canvasObject->GetIndirectKey("Group") : nullptr;
++		if (transGroup)
++		{
++			PdfObject* subtype = transGroup->GetIndirectKey("S");
++			if (subtype && subtype->GetName() == "Transparency")
++			{
++				// having transparency group means there's transparency in the PDF
++				hasTransparency = true;
++
++				// reporting the color space used in transparency group (Section 7.5.5, PDF 1.6 Spec)
++				PdfObject* cs = transGroup->GetIndirectKey("CS");
++				if (cs)
++				{
++					PDFColorSpace retval = getCSType(cs);
++					if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
++						usedColorSpaces.append(retval);
++				}
++			}
++		}
++	}
++	catch (PdfError & e)
++	{
++		qDebug() << "Error in analyzing stream's resources. File:" << m_filename;
++		e.PrintErrorMsg();
++		return false;
++	}
++
++	try
++	{
+ 		// start parsing the content stream
+ 		PdfContentsTokenizer tokenizer(canvas);
+ 		EPdfContentsType t;
+@@ -880,9 +932,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -949,9 +1001,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 							}
+ 							else
+ 							{
+-								if (colorSpacesDict && colorSpacesDict->FindKey(args[0].GetName()))
++								if (colorSpaceRes && colorSpaceRes->GetIndirectKey(args[0].GetName()))
+ 								{
+-									PdfObject* csEntry = colorSpacesDict->FindKey(args[0].GetName());
++									PdfObject* csEntry = colorSpaceRes->GetIndirectKey(args[0].GetName());
+ 									PDFColorSpace retval = getCSType(csEntry);
+ 									if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 										usedColorSpaces.append(retval);
+@@ -1003,29 +1055,28 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedXObj.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && xObjectsDict)
++						if (args.size() == 1 && args[0].IsName() && xObjects)
+ 						{
+-							PdfObject* xObject = xObjectsDict->FindKey(args[0].GetName());
+-							PdfDictionary* xObjectDict = (xObject && xObject->IsDictionary()) ? &(xObject->GetDictionary()) : nullptr;
+-							PdfObject* subtypeObject = xObjectDict ? xObjectDict->FindKey("Subtype") : nullptr;
++							PdfObject* xObject = xObjects->GetIndirectKey(args[0].GetName());
++							PdfObject* subtypeObject = xObject ? xObject->GetIndirectKey("Subtype") : nullptr;
+ 							if (subtypeObject && subtypeObject->IsName())
+ 							{
+ 								if (subtypeObject->GetName() == "Image")
+ 								{
+-									PdfObject* imgColorSpace = xObjectDict->FindKey("ColorSpace");
++									PdfObject* imgColorSpace = xObject->GetIndirectKey("ColorSpace");
+ 									if (imgColorSpace)
+ 									{
+ 										PDFColorSpace retval = getCSType(imgColorSpace);
+ 										if (retval != CS_Unknown && !usedColorSpaces.contains(retval))
+ 											usedColorSpaces.append(retval);
+ 									}
+-									PdfObject* sMaskObj = xObjectDict->FindKey("SMask");
++									PdfObject* sMaskObj = xObject->GetIndirectKey("SMask");
+ 									if (sMaskObj)
+ 										hasTransparency = true;
+ 									PDFImage img;
+ 									img.imgName = args[0].GetName().GetEscapedName().c_str();
+-									double width = xObjectDict->FindKey("Width")->GetReal();
+-									double height = xObjectDict->FindKey("Height")->GetReal();
++									double width = xObject->GetIndirectKey("Width")->GetReal();
++									double height = xObject->GetIndirectKey("Height")->GetReal();
+ 									img.dpiX = qRound(width/(currGS.ctm.m11()/72));
+ 									img.dpiY = qRound(height/(currGS.ctm.m22()/72));
+ 									imgs.append(img);
+@@ -1074,9 +1125,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 									usedColorSpaces.append(CS_DeviceCMYK);
+ 								else if (!processedNamedCS.contains(csName))
+ 								{
+-									if (colorSpacesDict && colorSpacesDict->FindKey(csName))
++									if (colorSpaceRes && colorSpaceRes->GetIndirectKey(csName))
+ 									{
+-										PdfObject* csEntry = colorSpacesDict->FindKey(csName);
++										PdfObject* csEntry = colorSpaceRes->GetIndirectKey(csName);
+ 										if (csEntry)
+ 										{
+ 											PDFColorSpace retval = getCSType(csEntry);
+@@ -1116,9 +1167,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					{
+ 					if (!processedNamedGS.contains(args[0].GetName()))
+ 					{
+-						if (args.size() == 1 && args[0].IsName() && extGStatesDict)
++						if (args.size() == 1 && args[0].IsName() && extGState)
+ 						{
+-							PdfObject* extGStateObj = extGStatesDict->FindKey(args[0].GetName());
++							PdfObject* extGStateObj = extGState->GetIndirectKey(args[0].GetName());
+ 							if (extGStateObj)
+ 							{
+ 								inspectExtGStateObj(extGStateObj, usedColorSpaces, hasTransparency, usedFonts, currGS);
+@@ -1147,9 +1198,9 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 					}
+ 					else
+ 					{
+-						if (args.size() == 2 && args[0].IsName() && fontsDict)
++						if (args.size() == 2 && args[0].IsName() && fontRes)
+ 						{
+-							PdfObject* fontObj = fontsDict->FindKey(args[0].GetName());
++							PdfObject* fontObj = fontRes->GetIndirectKey(args[0].GetName());
+ 							if (fontObj)
+ 							{
+ 								PDFFont retval = getFontInfo(fontObj);
+@@ -1179,7 +1230,6 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 				args.clear();
+ 			}
+ 		}
+-#endif
+ 	}
+ 	catch (PdfError & e)
+ 	{
+@@ -1188,10 +1238,12 @@ bool PDFAnalyzer::inspectCanvas(PdfCanva
+ 		return false;
+ 	}
+ 	return true;
++#endif
+ }
+ 
+ void PDFAnalyzer::inspectExtGStateObj(PdfObject* extGStateObj, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, PDFGraphicState & currGS)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	PdfDictionary* extGStateDict = extGStateObj->IsDictionary() ? &(extGStateObj->GetDictionary()) : nullptr;
+ 	PdfObject* bmObj = extGStateDict ? extGStateDict->FindKey("BM") : nullptr;
+ 	if (bmObj && bmObj->IsName())
+@@ -1245,7 +1297,6 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 				currGS.font.first = font;
+ 				currGS.font.second = arr[1].GetReal();
+ 			}
+-
+ 		}
+ 	}
+ 
+@@ -1276,9 +1327,96 @@ void PDFAnalyzer::inspectExtGStateObj(Pd
+ 		PdfObject dObjB = dObj->GetArray()[1];
+ 		currGS.dashPattern.second = dObjB.GetNumber();
+ 	}
++#else
++	PdfObject* bmObj = extGStateObj->GetIndirectKey("BM");
++	if (bmObj && bmObj->IsName())
++	{
++		currGS.blendModes.clear();
++		currGS.blendModes.append(bmObj->GetName().GetEscapedName().c_str());
++		if (!(bmObj->GetName() == "Normal" || bmObj->GetName() == "Compatible"))
++			hasTransparency = true;
++	}
++	else if (bmObj && bmObj->IsArray())
++	{
++		PdfArray arr = bmObj->GetArray();
++		currGS.blendModes.clear();
++		for (uint i = 0; i < arr.GetSize(); ++i)
++			currGS.blendModes.append(arr[i].GetName().GetEscapedName().c_str());
++		if (arr[0].IsName() && !(arr[0].GetName() == "Normal" || arr[0].GetName() == "Compatible"))
++			hasTransparency = true;
++	}
++
++	PdfObject* caObj = extGStateObj->GetIndirectKey("ca");
++	if (caObj && (caObj->IsReal() || caObj->IsNumber()))
++	{
++		currGS.fillAlphaConstant = caObj->GetReal();
++		if (caObj->GetReal() < 1)
++			hasTransparency = true;
++	}
++
++	PdfObject* cAObj = extGStateObj->GetIndirectKey("CA");
++	if (cAObj && (cAObj->IsReal() || cAObj->IsNumber()))
++	{
++		if (cAObj->GetReal() < 1)
++			hasTransparency = true;
++	}
++
++	PdfObject* sMaskObj = extGStateObj->GetIndirectKey("SMask");
++	if (sMaskObj && !(sMaskObj->IsName() && sMaskObj->GetName() == "None"))
++		hasTransparency = true;
++
++	PdfObject* fontObj = extGStateObj->GetIndirectKey("Font");
++	if (fontObj && fontObj->IsArray())
++	{
++		PdfArray arr = fontObj->GetArray();
++		if (arr[0].IsReference())
++		{
++			PdfReference ref = arr[0].GetReference();
++			PdfObject* fontObject = m_pdfdoc->GetObjects().GetObject(ref);
++			if (fontObject)
++			{
++				PDFFont font = getFontInfo(fontObject);
++				usedFonts.append(font);
++				currGS.font.first = font;
++				currGS.font.second = arr[1].GetReal();
++			}
++
++		}
++	}
++
++	PdfObject* lwObj = extGStateObj->GetIndirectKey("LW");
++	if (lwObj)
++		currGS.lineWidth = lwObj->GetReal();
++
++	PdfObject* lcObj = extGStateObj->GetIndirectKey("LC");
++	if (lcObj)
++		currGS.lineCap = lcObj->GetNumber();
++
++	PdfObject* ljObj = extGStateObj->GetIndirectKey("LJ");
++	if (ljObj)
++		currGS.lineJoin = ljObj->GetNumber();
++
++	PdfObject* mlObj = extGStateObj->GetIndirectKey("ML");
++	if (mlObj)
++		currGS.miterLimit = mlObj->GetReal();
++
++	PdfObject* dObj = extGStateObj->GetIndirectKey("D");
++	if (dObj)
++	{
++		PdfObject dObjA = dObj->GetArray()[0];
++		PdfArray dashArr = dObjA.GetArray();
++		currGS.dashPattern.first.clear();
++		for (uint i = 0; i < dashArr.GetSize(); ++i)
++			currGS.dashPattern.first.append(dashArr[i].GetNumber());
++		PdfObject dObjB = dObj->GetArray()[1];
++		currGS.dashPattern.second = dObjB.GetNumber();
++	}
++#endif
+ }
++
+ PDFFont PDFAnalyzer::getFontInfo(PdfObject* fontObj)
+ {
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	PDFFont currFont;
+ 	const PdfDictionary* fontDict = fontObj->IsDictionary() ? &(fontObj->GetDictionary()) : nullptr;
+ 	if (!fontDict)
+@@ -1307,11 +1445,7 @@ PDFFont PDFAnalyzer::getFontInfo(PdfObje
+ 		if (descendantFonts && descendantFonts->IsArray())
+ 		{
+ 			const PdfReference& refDescFont = descendantFonts->GetArray()[0].GetReference();
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 			PdfObject* descendantFont = descendantFonts->GetDocument()->GetObjects().GetObject(refDescFont);
+-#else
+-			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
+-#endif
+ 			PdfDictionary* descendantFontDict = (descendantFont && descendantFont->IsDictionary()) ? &(descendantFont->GetDictionary()) : nullptr;
+ 			const PdfObject* subtypeDescFont = descendantFontDict->FindKey("Subtype");
+ 			fontDesc = &(descendantFontDict->MustGetKey("FontDescriptor"));
+@@ -1345,6 +1479,62 @@ PDFFont PDFAnalyzer::getFontInfo(PdfObje
+ 		}
+ 	}
+ 	return currFont;
++#else
++	PDFFont currFont;
++	PdfObject* subtype = fontObj->GetIndirectKey("Subtype");
++	if (!subtype || !subtype->IsName())
++		return currFont;
++
++	PdfObject* fontDesc = fontObj->GetIndirectKey("FontDescriptor");
++	if (subtype->GetName() == "Type1")
++		currFont.fontType = F_Type1;
++	else if (subtype->GetName() == "MMType1")
++		currFont.fontType = F_MMType1;
++	else if (subtype->GetName() == "TrueType")
++		currFont.fontType = F_TrueType;
++	else if (subtype->GetName() == "Type3")
++	{
++		currFont.fontType = F_Type3;
++		currFont.isEmbedded = true;
++		fontDesc = nullptr;
++	}
++	else if (subtype->GetName() == "Type0")
++	{
++		PdfObject* descendantFonts = fontObj->GetIndirectKey("DescendantFonts");
++		if (descendantFonts && descendantFonts->IsArray())
++		{
++			PdfReference refDescFont = descendantFonts->GetArray()[0].GetReference();
++			PdfObject* descendantFont = descendantFonts->GetOwner()->GetObject(refDescFont);
++			PdfObject* subtypeDescFont = descendantFont->GetIndirectKey("Subtype");
++			fontDesc = descendantFont->MustGetIndirectKey("FontDescriptor");
++			if (subtypeDescFont && subtypeDescFont->IsName())
++			{
++				if (subtypeDescFont->GetName() == "CIDFontType0")
++					currFont.fontType = F_CIDFontType0;
++				else if (subtypeDescFont->GetName() == "CIDFontType2")
++					currFont.fontType = F_CIDFontType2;
++			}
++		}
++	}
++	if (fontDesc)
++	{
++		PdfObject* fontFile = fontDesc->GetIndirectKey("FontFile");
++		PdfObject* fontFile2 = fontDesc->GetIndirectKey("FontFile2");
++		PdfObject* fontFile3 = fontDesc->GetIndirectKey("FontFile3");
++		if (fontFile && fontFile->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile2 && fontFile2->HasStream())
++			currFont.isEmbedded = true;
++		if (fontFile3 && fontFile3->HasStream())
++		{
++			currFont.isEmbedded = true;
++			PdfObject* ff3Subtype = fontFile3->GetIndirectKey("Subtype");
++			if (ff3Subtype && ff3Subtype->IsName() && ff3Subtype->GetName() == "OpenType")
++				currFont.isOpenType = true;
++		}
++	}
++	return currFont;
++#endif
+ }
+ #else
+ PDFAnalyzer::PDFAnalyzer(QString & filename) : QObject()
+--- a/scribus/pdflib_core.cpp
++++ b/scribus/pdflib_core.cpp
+@@ -9826,7 +9826,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page.GetRotationRaw();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9845,11 +9845,11 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx()) + " "
++								 + Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+ 			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
+@@ -9947,7 +9947,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::Rect pageRect = page.GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page.GetRotationRaw();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.Height : pageRect.Width;
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.Width : pageRect.Height;
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -9966,11 +9966,11 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.Height));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx()) + " "
++								 + Pdf::toPdf(pageM.dy()) + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+ 			PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
+@@ -10072,20 +10072,16 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ #else
+ 	try
+ 	{
+-		PoDoFo::PdfPage* page = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
+-		PoDoFo::PdfObject* pageObj = page ? page->GetObject() : nullptr;
+-		PoDoFo::PdfObject* contents = page ? page->GetContents() : nullptr;
++		PoDoFo::PdfPage*   page      = doc->GetPage(qMin(qMax(1, c->pixm.imgInfo.actualPageNumber), c->pixm.imgInfo.numberOfPages) - 1);
++		PoDoFo::PdfObject* pageObj   = page ? page->GetObject() : nullptr;
++		PoDoFo::PdfObject* contents  = page ? page->GetContents() : nullptr;
+ 		PoDoFo::PdfObject* resources = page ? page->GetResources() : nullptr;
+-		PoDoFo::PdfDictionary* pageObjDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+-		for (PoDoFo::PdfDictionary* par = pageObjDict, *parentDict = nullptr; par && !resources; par = parentDict)
++		for (PoDoFo::PdfObject* par = pageObj; par && !resources; par = par->GetIndirectKey("Parent"))
+ 		{
+-			resources = par->FindKey("Resources");
+-			PoDoFo::PdfObject* parentObj = par->FindKey("Parent");
+-			parentDict = (parentObj && parentObj->IsDictionary()) ? &(parentObj->GetDictionary()) : nullptr;
++			resources = par->GetIndirectKey("Resources");
+ 		}
+-		if (contents && contents->GetDataType() == PoDoFo::ePdfDataType_Dictionary)
++		if (contents && contents->GetDataType() ==  PoDoFo::ePdfDataType_Dictionary)
+ 		{
+-			PoDoFo::PdfDictionary& contentsDict = contents->GetDictionary();
+ 			PoDoFo::PdfStream* stream = contents->GetStream();
+ 			QMap<PoDoFo::PdfReference, PdfId> importedObjects;
+ 			QList<PoDoFo::PdfReference> referencedObjects;
+@@ -10098,7 +10094,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -10117,22 +10113,21 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx())  + " "
++								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+-			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			nextObj = page->GetObject()->GetIndirectKey("Group");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+ 			/*
+-			PoDoFo::PdfObject parents = pageDict->FindKey("StructParents");
++			PoDoFo::PdfObject parents = page->GetObject()->GetIndirectKey("StructParents");
+ 			if (parents)
+ 			{
+ 				xParents = writer.newObject();
+@@ -10151,13 +10146,13 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			if (mbuffer[mlen - 1] == '\n')
+ 				--mlen;
+ 			PutDoc("\n/Length " + Pdf::toPdf(static_cast<qlonglong>(mlen)));
+-			nextObj = contentsDict.FindKey("Filter");
++			nextObj = contents->GetIndirectKey("Filter");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Filter ");
+ 				copyPoDoFoDirect(nextObj, referencedObjects, importedObjects);
+ 			}
+-			nextObj = contentsDict.FindKey("DecodeParms");
++			nextObj = contents->GetIndirectKey("DecodeParms");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/DecodeParms ");
+@@ -10168,7 +10163,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 				QByteArray buffer = QByteArray::fromRawData(mbuffer, mlen);
+ 				EncodeArrayToStream(buffer, xObj);
+ 			}  // disconnect QByteArray from raw data
+-			free(mbuffer);
++			free (mbuffer);
+ 			PutDoc("\nendstream");
+ 			writer.endObj(xObj);
+ 			// write resources
+@@ -10223,7 +10218,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc("<<\n/Type /XObject\n/Subtype /Form\n/FormType 1");
+ 			PoDoFo::PdfRect pageRect = page->GetArtBox(); // Because scimagedataloader_pdf use ArtBox
+ 			int rotation = page->GetRotation();
+-			double imgWidth = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
++			double imgWidth  = (rotation == 90 || rotation == 270) ? pageRect.GetHeight() : pageRect.GetWidth();
+ 			double imgHeight = (rotation == 90 || rotation == 270) ? pageRect.GetWidth() : pageRect.GetHeight();
+ 			QTransform pageM;
+ 			pageM.translate(pageRect.GetLeft(), pageRect.GetBottom());
+@@ -10242,15 +10237,14 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			PutDoc(" " + Pdf::toPdf(pageRect.GetBottom() + pageRect.GetHeight()));
+ 			PutDoc("]");
+ 			PutDoc("\n/Matrix [" + Pdf::toPdf(pageM.m11()) + " "
+-				+ Pdf::toPdf(pageM.m12()) + " "
+-				+ Pdf::toPdf(pageM.m21()) + " "
+-				+ Pdf::toPdf(pageM.m22()) + " "
+-				+ Pdf::toPdf(pageM.dx()) + " "
+-				+ Pdf::toPdf(pageM.dy()) + " ");
++								 + Pdf::toPdf(pageM.m12()) + " "
++								 + Pdf::toPdf(pageM.m21()) + " "
++								 + Pdf::toPdf(pageM.m22()) + " "
++								 + Pdf::toPdf(pageM.dx())  + " "
++								 + Pdf::toPdf(pageM.dy())  + " ");
+ 			PutDoc("]");
+ 			PutDoc("\n/Resources " + Pdf::toPdf(xResources) + " 0 R");
+-			PoDoFo::PdfDictionary* pageDict = pageObj->IsDictionary() ? &(pageObj->GetDictionary()) : nullptr;
+-			nextObj = pageDict ? pageDict->FindKey("Group") : nullptr;
++			nextObj = page->GetObject()->GetIndirectKey("Group");
+ 			if (nextObj)
+ 			{
+ 				PutDoc("\n/Group "); // PDF 1.4
+@@ -10326,7 +10320,7 @@ bool PDFLibCore::PDF_EmbeddedPDF(PageIte
+ 			imgInfo.ResNum = ResCount;
+ 			ResCount++;
+ 			// Avoid a divide-by-zero if width/height are less than 1 point:
+-			imgInfo.Width = qMax(1, (int) imgWidth);
++			imgInfo.Width  = qMax(1, (int) imgWidth);
+ 			imgInfo.Height = qMax(1, (int) imgHeight);
+ 			imgInfo.xa = sx * imgWidth / imgInfo.Width;
+ 			imgInfo.ya = sy * imgHeight / imgInfo.Height;
+--- a/scribus/plugins/import/ai/importai.cpp
++++ b/scribus/plugins/import/ai/importai.cpp
+@@ -579,87 +579,115 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		qDebug() << "Failed to open QFile outf in AIPlug::extractFromPDF";
+ 		return false;
+ 	}
++
++#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	try
+ 	{
+-#if (PODOFO_VERSION < PODOFO_MAKE_VERSION(0, 10, 0))
+-		PoDoFo::PdfError::EnableDebug( false );
+-		PoDoFo::PdfError::EnableLogging( false );
+-#endif
+ 		PoDoFo::PdfMemDocument doc;
+ 		doc.Load(infile.toLocal8Bit().data());
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+-		PoDoFo::PdfPage* curPage = &(doc.GetPages().GetPageAt(0));
++
++		PoDoFo::PdfPage& curPage = doc.GetPages().GetPageAt(0);
++		PoDoFo::PdfObject& pageObj = curPage.GetObject();
++		PoDoFo::PdfDictionary* pageDict = pageObj.IsDictionary() ? &(pageObj.GetDictionary()) : nullptr;
++		PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
++		if (piece != nullptr)
++		{
++			PoDoFo::PdfDictionary* pieceDict = piece->IsDictionary() ? &(piece->GetDictionary()) : nullptr;
++			PoDoFo::PdfObject *illy = pieceDict ? pieceDict->FindKey("Illustrator") : nullptr;
++			if (illy != nullptr)
++			{
++				PoDoFo::PdfDictionary* illyDict = illy->IsDictionary() ? &(illy->GetDictionary()) : nullptr;
++				PoDoFo::PdfObject *priv = illyDict ? illyDict->FindKey("Private") : nullptr;
++				if (priv == nullptr)
++					priv = illy;
++				int num = 0;
++				PoDoFo::PdfDictionary* privDict = priv->IsDictionary() ? &(priv->GetDictionary()) : nullptr;
++				PoDoFo::PdfObject *numBl = privDict ? privDict->FindKey("NumBlock") : nullptr;
++				if (numBl != nullptr)
++					num = numBl->GetNumber() + 1;
++				if (num == 0)
++					num = 99999;
++				QString name = "AIPrivateData%1";
++				QString Key = name.arg(1);
++				PoDoFo::PdfObject *data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++				if (data == nullptr)
++				{
++					name = "AIPDFPrivateData%1";
++					Key = name.arg(1);
++					data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++				}
++				if (data != nullptr)
++				{
++					if (num == 2)
++					{
++						Key = name.arg(1);
++						data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++						PoDoFo::PdfObjectStream const* stream = data->GetStream();
++						PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++						qint64 bLen = strBuffer.size();
++						const char* Buffer = strBuffer.c_str();
++						outf.write(Buffer, bLen);
++					}
++					else
++					{
++						for (int a = 2; a < num; a++)
++						{
++							Key = name.arg(a);
++							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							if (data == nullptr)
++								break;
++							PoDoFo::PdfObjectStream const* stream = data->GetStream();
++							PoDoFo::charbuff strBuffer = stream->GetCopy(false);
++							qint64 bLen = strBuffer.size();
++							const char* Buffer = strBuffer.c_str();
++							outf.write(Buffer, bLen);
++						}
++					}
++				}
++				ret = true;
++			}
++		}
++		outf.close();
++	}
+ #else
++	try
++	{
++		PoDoFo::PdfError::EnableDebug( false );
++		PoDoFo::PdfError::EnableLogging( false );
++		PoDoFo::PdfMemDocument doc( infile.toLocal8Bit().data() );
+ 		PoDoFo::PdfPage *curPage = doc.GetPage(0);
+-#endif
+ 		if (curPage != nullptr)
+ 		{
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+-			PoDoFo::PdfObject* pageObj = &(curPage->GetObject());
+-#else
+-			PoDoFo::PdfObject* pageObj = curPage->GetObject();
+-#endif
+-			PoDoFo::PdfDictionary* pageDict = (pageObj && pageObj->IsDictionary()) ? &(pageObj->GetDictionary()) : nullptr;
+-			PoDoFo::PdfObject *piece = pageDict ? pageDict->FindKey("PieceInfo") : nullptr;
++			PoDoFo::PdfObject *piece = curPage->GetObject()->GetIndirectKey("PieceInfo");
+ 			if (piece != nullptr)
+ 			{
+-				PoDoFo::PdfDictionary* pieceDict = piece->IsDictionary() ? &(piece->GetDictionary()) : nullptr;
+-				PoDoFo::PdfObject *illy = pieceDict ? pieceDict->FindKey("Illustrator") : nullptr;
++				PoDoFo::PdfObject *illy = piece->GetIndirectKey("Illustrator");
+ 				if (illy != nullptr)
+ 				{
+-					PoDoFo::PdfDictionary* illyDict = illy->IsDictionary() ? &(illy->GetDictionary()) : nullptr;
+-					PoDoFo::PdfObject *priv = illyDict ? illyDict->FindKey("Private") : nullptr;
++					PoDoFo::PdfObject *priv = illy->GetIndirectKey("Private");
+ 					if (priv == nullptr)
+ 						priv = illy;
+ 					int num = 0;
+-					PoDoFo::PdfDictionary* privDict = priv->IsDictionary() ? &(priv->GetDictionary()) : nullptr;
+-					PoDoFo::PdfObject *numBl = privDict ? privDict->FindKey("NumBlock") : nullptr;
++					PoDoFo::PdfObject *numBl = priv->GetIndirectKey("NumBlock");
+ 					if (numBl != nullptr)
+ 						num = numBl->GetNumber() + 1;
+ 					if (num == 0)
+ 						num = 99999;
+ 					QString name = "AIPrivateData%1";
+ 					QString Key = name.arg(1);
+-					PoDoFo::PdfObject *data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++					PoDoFo::PdfObject *data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 					if (data == nullptr)
+ 					{
+ 						name = "AIPDFPrivateData%1";
+ 						Key = name.arg(1);
+-						data = privDict ? privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data())) : nullptr;
++						data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 					}
+ 					if (data != nullptr)
+ 					{
+-#if (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 						if (num == 2)
+ 						{
+ 							Key = name.arg(1);
+-							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+-							PoDoFo::PdfObjectStream const* stream = data->GetStream();
+-							PoDoFo::charbuff strBuffer = stream->GetCopy(false);
+-							qint64 bLen = strBuffer.size();
+-							const char* Buffer = strBuffer.c_str();
+-							outf.write(Buffer, bLen);
+-						}
+-						else
+-						{
+-							for (int a = 2; a < num; a++)
+-							{
+-								Key = name.arg(a);
+-								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
+-								if (data == nullptr)
+-									break;
+-								PoDoFo::PdfObjectStream const* stream = data->GetStream();
+-								PoDoFo::charbuff strBuffer = stream->GetCopy(false);
+-								qint64 bLen = strBuffer.size();
+-								const char* Buffer = strBuffer.c_str();
+-								outf.write(Buffer, bLen);
+-							}
+-						}
+-#else
+-						if (num == 2)
+-						{
+-							Key = name.arg(1);
+-							data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++							data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 							PoDoFo::PdfStream const *stream = data->GetStream();
+ 							PoDoFo::PdfMemoryOutputStream oStream(1);
+ 							stream->GetFilteredCopy(&oStream);
+@@ -674,7 +702,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 							for (int a = 2; a < num; a++)
+ 							{
+ 								Key = name.arg(a);
+-								data = privDict->FindKey(PoDoFo::PdfName(Key.toUtf8().data()));
++								data = priv->GetIndirectKey(PoDoFo::PdfName(Key.toUtf8().data()));
+ 								if (data == nullptr)
+ 									break;
+ 								PoDoFo::PdfStream const *stream = data->GetStream();
+@@ -687,7 +715,6 @@ bool AIPlug::extractFromPDF(const QStrin
+ 								free( Buffer );
+ 							}
+ 						}
+-#endif
+ 					}
+ 					ret = true;
+ 				}
+@@ -695,6 +722,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		}
+ 		outf.close();
+ 	}
++#endif // (PODOFO_VERSION >= PODOFO_MAKE_VERSION(0, 10, 0))
+ 	catch (PoDoFo::PdfError& e)
+ 	{
+ 		outf.close();
+@@ -704,7 +732,7 @@ bool AIPlug::extractFromPDF(const QStrin
+ 		QFile::remove(outfile);
+ 		return false;
+ 	}
+-#endif
++#endif // HAVE_PODOFO
+ 	return ret;
+ }
+ 
diff --git a/srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch b/srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch
new file mode 100644
index 0000000000000..c01558c04f98d
--- /dev/null
+++ b/srcpkgs/scribus/patches/0015-podofo-0.10-cmake-fix.patch
@@ -0,0 +1,22 @@
+From 148fc05557975267b05ebe670822793999ea3e0a Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 5 Jun 2023 21:15:35 +0000
+Subject: [PATCH 11/13] Fix typo
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25504 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit bd2ba29c16218bc715cde93109e6c0b9be48e4be)
+---
+ CMakeLists_Dependencies.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/CMakeLists_Dependencies.cmake
++++ b/CMakeLists_Dependencies.cmake
+@@ -8,7 +8,7 @@ if (WITH_PODOFO)
+ 	if (LIBPODOFO_FOUND)
+ 		message("PoDoFo found OK")
+ 		set(HAVE_PODOFO ON)
+-		if(LIBPODOFO_VERSION VERSION_GREATER "0.10.0")
++		if(LIBPODOFO_VERSION VERSION_GREATER_EQUAL "0.10.0")
+ 			message(STATUS "PoDoFo Version:" ${LIBPODOFO_VERSION})
+ 			if (CMAKE_CXX_STANDARD LESS 17)
+ 				message(STATUS "C++17 is the minimum C++ standard since podofo 0.10.0")
diff --git a/srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch b/srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch
new file mode 100644
index 0000000000000..2d51a8ef9b793
--- /dev/null
+++ b/srcpkgs/scribus/patches/0016-podofo-0.10-use-pkgconfig.patch
@@ -0,0 +1,107 @@
+From 6ae729e1b45f92428168475c316f3b45a8e99d74 Mon Sep 17 00:00:00 2001
+From: Craig Bradney <mrb@scribus.info>
+Date: Mon, 4 Sep 2023 21:58:38 +0000
+Subject: [PATCH 12/13] Adapt CMake FindLIBPODOFO.cmake to use pkgconfig, and
+ allow custom find path. Still testing.
+
+git-svn-id: svn://scribus.net/trunk/Scribus@25625 11d20701-8431-0410-a711-e3c959e3b870
+(cherry picked from commit 628a630d7c45d942605ac227c530f9c889395832)
+---
+ cmake/modules/FindLIBPODOFO.cmake        | 48 +++++++++++++++++-------
+ scribus/plugins/import/ai/CMakeLists.txt | 13 +++----
+ 2 files changed, 41 insertions(+), 20 deletions(-)
+
+--- a/cmake/modules/FindLIBPODOFO.cmake
++++ b/cmake/modules/FindLIBPODOFO.cmake
+@@ -12,23 +12,45 @@ if(WIN32)
+ 	endif(NOT DEFINED LIBPODOFO_SHARED)
+ endif(WIN32)
+ 
+-find_path(LIBPODOFO_INCLUDE_DIR
+-	NAMES podofo/podofo.h
+-	PATHS
+-	"${LIBPODOFO_DIR}/include"
+-	"${LIBPODOFO_DIR}/src"
+-	"${LIBPODOFO_DIR}"
++set(LIBPODOFO_FIND_QUIETLY OFF)
++
++find_package(PkgConfig QUIET)
++if(DEFINED LIBPODOFO_DIR_CUSTOM)
++	set(ENV{PKG_CONFIG_PATH} "${LIBPODOFO_DIR_CUSTOM}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")
++endif()
++pkg_search_module(libpodofo REQUIRED libpodofo podofo)
++
++if (DEFINED LIBPODOFO_DIR_CUSTOM)
++	find_path(LIBPODOFO_INCLUDE_DIR
++		NAMES podofo/podofo.h
++		PATHS
++		"${LIBPODOFO_DIR_CUSTOM}/include"
++		"${LIBPODOFO_DIR_CUSTOM}"
++		PATH_SUFFIXES podofo
++		NO_DEFAULT_PATH
+ 	)
+ 
+-set(LIBPODOFO_FIND_QUIETLY ON)
++	find_library(LIBPODOFO_LIBRARY
++		NAMES libpodofo podofo
++		PATHS
++		"${LIBPODOFO_DIR_CUSTOM}/lib"
++		"${LIBPODOFO_DIR_CUSTOM}"
++		NO_DEFAULT_PATH
++	)
++else()
++	find_path(LIBPODOFO_INCLUDE_DIR
++		NAMES podofo/podofo.h
++		PATHS
++		${libpodofo_INCLUDE_DIRS}
++	)
+ 
+-find_library(LIBPODOFO_LIBRARY
+-	NAMES libpodofo podofo
+-	PATHS
+-	"${LIBPODOFO_DIR}/lib"
+-	"${LIBPODOFO_DIR}/src"
+-	"${LIBPODOFO_DIR}"
++	find_library(LIBPODOFO_LIBRARY
++		NAMES libpodofo podofo
++		PATHS
++		${libpodofo_LIBRARY_DIRS}
+ 	)
++endif()
++
+ 
+ if(LIBPODOFO_INCLUDE_DIR AND LIBPODOFO_LIBRARY)
+ 	if(NOT LIBPODOFO_CONFIG_H)
+--- a/scribus/plugins/import/ai/CMakeLists.txt
++++ b/scribus/plugins/import/ai/CMakeLists.txt
+@@ -1,14 +1,15 @@
+ include_directories(
+ 	${CMAKE_SOURCE_DIR}
+ 	${CMAKE_SOURCE_DIR}/scribus
+-	${PODOFO_INCLUDES}
++	${LIBPODOFO_INCLUDE_DIR}
+ 	${SCRIBUS_AUTOGEN_INCLUDE_PATH}
+ )
+ 
+ if(HAVE_PODOFO)
+-	include_directories(
+-		${LIBPODOFO_INCLUDE_DIR}
+-	)
++	if(OPENSSL_FOUND)
++		include_directories(${OPENSSL_INCLUDE_DIR})
++	endif()
++	include_directories(BEFORE ${LIBPODOFO_INCLUDE_DIR})
+ endif()
+ 
+ set(IMPORTAI_PLUGIN_SOURCES
+@@ -32,9 +33,7 @@ else()
+ endif()
+ 
+ if(HAVE_PODOFO)
+-	target_link_libraries(${SCRIBUS_IMPORTAI_PLUGIN}
+-		${LIBPODOFO_LIBRARY}
+-	)
++	target_link_libraries(${SCRIBUS_IMPORTAI_PLUGIN} ${LIBPODOFO_LIBRARY})
+ endif()
+ 
+ if(WANT_PCH)
diff --git a/srcpkgs/scribus/patches/cmake-buildtype-none.patch b/srcpkgs/scribus/patches/cmake-buildtype-none.patch
index ea1df49410ed6..95a3da339b29b 100644
--- a/srcpkgs/scribus/patches/cmake-buildtype-none.patch
+++ b/srcpkgs/scribus/patches/cmake-buildtype-none.patch
@@ -1,5 +1,3 @@
-Index: CMakeLists.txt
-===================================================================
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
 @@ -75,11 +75,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -14,7 +12,7 @@ Index: CMakeLists.txt
  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
  set(CMAKE_SKIP_RULE_DEPENDENCY TRUE)
  set(CMAKE_SKIP_BUILD_RPATH TRUE)
-@@ -330,15 +325,6 @@ include (CMakeLists_Directories.cmake)
+@@ -344,15 +339,6 @@ include (CMakeLists_Directories.cmake)
  
  #Convert our simpler command line option to the CMake style
  #None, Debug, Release, .. or custom ones
@@ -27,3 +25,6 @@ Index: CMakeLists.txt
 -if(NOT WANT_DEBUG AND NOT WANT_RELEASEWITHDEBUG)
 -	set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Set Release Build Type" FORCE)
 -endif()
+ 
+ set(CMAKE_ENABLE_EXPORTS ON)
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
diff --git a/srcpkgs/scribus/template b/srcpkgs/scribus/template
index 3138a842546af..a43acf7ccd761 100644
--- a/srcpkgs/scribus/template
+++ b/srcpkgs/scribus/template
@@ -1,7 +1,7 @@
 # Template file for 'scribus'
 pkgname=scribus
 version=1.5.8
-revision=12
+revision=13
 build_style=cmake
 configure_args="-DCMAKE_SKIP_RPATH=TRUE -DQT_PREFIX=${XBPS_CROSS_BASE}/usr
  -DWANT_GRAPHICSMAGICK=1 -DWANT_CPP17=ON"
@@ -9,7 +9,7 @@ hostmakedepends="pkg-config qt5-qmake qt5-host-tools python3"
 makedepends="qt5-devel qt5-tools-devel zlib-devel cairo-devel lcms2-devel
  cups-devel libxml2-devel hyphen-devel ghostscript-devel boost-devel
  hunspell-devel poppler-cpp-devel python3-devel harfbuzz-devel
- libgraphicsmagick-devel libpodofo0.9.7-devel libpagemaker-devel libqxp-devel
+ libgraphicsmagick-devel libpodofo-devel libpagemaker-devel libqxp-devel
  libmspub-devel libcdr-devel libfreehand-devel libvisio-devel"
 depends="ghostscript"
 short_desc="Open Source DTP (Desktop Publishing) application"

From e844cac11c6cf159ce9df728ee709d35d8fc13d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Thu, 14 Dec 2023 19:33:30 +0700
Subject: [PATCH 8/8] libreoffice: update to 7.6.4.1.

---
 srcpkgs/libreoffice/template | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/srcpkgs/libreoffice/template b/srcpkgs/libreoffice/template
index e4cc15b3b9919..5e82c7c9ae63b 100644
--- a/srcpkgs/libreoffice/template
+++ b/srcpkgs/libreoffice/template
@@ -1,11 +1,11 @@
 # Template file for 'libreoffice'
 pkgname=libreoffice
-version=7.6.0.3
-revision=3
+version=7.6.4.1
+revision=1
 build_style=meta
 make_build_target="build"
 hostmakedepends="automake flex gperf hyphen icu libtool openldap which gettext xz
- perl-Archive-Zip pkg-config qt5-qmake sane unzip zip python3-setuptools
+ tar perl-Archive-Zip pkg-config qt5-qmake sane unzip zip python3-setuptools
  fontforge python3-lxml qt6-base gtk4-devel gobject-introspection gnupg"
 makedepends="CoinMP-devel apr-devel avahi-libs-devel clucene-devel
  frameworkintegration-devel glyphy-devel gpgmepp-devel gst-plugins-base1-devel
@@ -72,7 +72,7 @@ distfiles="
  ${_addurl}/d8bd5eed178db6e2b18eeed243f85aa8-flute-1.1.6.zip
  ${_addurl}/ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip
  ${_addurl}/box2d-2.4.1.tar.gz
- ${_addurl}/libcmis-0.5.2.tar.xz
+ ${_addurl}/libcmis-0.6.1.tar.xz
  ${_addurl}/libstaroffice-0.0.7.tar.xz
  ${_addurl}/libzmf-0.0.2.tar.xz
  ${_addurl}/pdfium-5778.tar.bz2
@@ -94,10 +94,10 @@ distfiles="
  ${_addurl}/frozen-1.1.1.tar.gz
  ${_addurl}/dragonbox-1.1.3.tar.gz
 "
-checksum="07f33f11a75b72a3044749d4f2f7d02a0fd79eaed4fb73e618ec5fe3576d0c25
- b932cdd6bd2ee717f3a09766c88fe90100b0c2c0509313c3ee297f95c084ee2e
- 210f18ff60e93d366856d84e714d3fd6f184f399b5163afc92b7e11155cbe768
- 667e4ffeacc01bd0f830c2edcc56e2328f924eeac224639babeb3841a44ec5f4
+checksum="13fea7b8f24c776313b9e08628aa590390bea45064be73bc70ee7b1b70aa6a1e
+ 36c0526e4c12ab38dd1e1766cd878118dd5692578b80411b9b443e389e3712fa
+ ed784c014096e0e7ff86294eba624bd92ecbe5be881b01950eecd69aed7d8678
+ 3a5a0dbe40abdc55cdd9994895f6577d7e547d26a36b20641f32f3640a3b7679
  1fb458d6aab06932693cc8a9b6e4e70944ee1ff052fa63606e3131df34e21753
  75823776fb51a9c526af904f1503a7afaaab900fba83eda64f8a41073724c870
  7d2797fe9f79a77009721e3f14fa4a1dec17a6d706bdc93f85f1f01d124fab66
@@ -106,7 +106,7 @@ checksum="07f33f11a75b72a3044749d4f2f7d02a0fd79eaed4fb73e618ec5fe3576d0c25
  1b5b24f7bc543c0362b667692f78db8bab4ed6dafc6172f104d0bd3757d8a133
  233f66e8d25c5dd971716d4200203a612a407649686ef3b52075d04b4c9df0dd
  d6b4650ff897ee1ead27cf77a5933ea197cbeef6705638dd181adc2e816b23c2
- d7b18d9602190e10d437f8a964a32e983afd57e2db316a07d87477a79f5000a2
+ d54d19d86153dbc88e2d468f7136269a2cfe71b73227e12fded01d29ac268074
  f94fb0ad8216f97127bedef163a45886b43c62deac5e5b0f5e628e234220c8db
  27051a30cb057fdb5d5de65a1f165c7153dc76e27fe62251cbb86639eb2caf22
  b1052ff24e9ffb11af017c444bb0f6ad508d64c9a0fb88cacb0e8210245dde06
@@ -136,7 +136,7 @@ skip_extraction="
  d8bd5eed178db6e2b18eeed243f85aa8-flute-1.1.6.zip
  ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip
  box2d-2.4.1.tar.gz
- libcmis-0.5.2.tar.xz
+ libcmis-0.6.1.tar.xz
  libstaroffice-0.0.7.tar.xz
  libzmf-0.0.2.tar.xz
  pdfium-5778.tar.bz2

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PR PATCH] [Merged]: Poppler 23.12.0
  2023-09-17 21:02 [PR PATCH] Poppler 23.09.0 mhmdanas
                   ` (8 preceding siblings ...)
  2023-12-15 23:40 ` sgn
@ 2023-12-16  3:12 ` sgn
  2023-12-16 12:48 ` sgn
  10 siblings, 0 replies; 12+ messages in thread
From: sgn @ 2023-12-16  3:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]

There's a merged pull request on the void-packages repository

Poppler 23.12.0
https://github.com/void-linux/void-packages/pull/46107

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES** (and built all revdeps successfully)

[ci skip]
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Poppler 23.12.0
  2023-09-17 21:02 [PR PATCH] Poppler 23.09.0 mhmdanas
                   ` (9 preceding siblings ...)
  2023-12-16  3:12 ` [PR PATCH] [Merged]: " sgn
@ 2023-12-16 12:48 ` sgn
  10 siblings, 0 replies; 12+ messages in thread
From: sgn @ 2023-12-16 12:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 175 bytes --]

New comment by sgn on void-packages repository

https://github.com/void-linux/void-packages/pull/46107#issuecomment-1858810734

Comment:
Halo, might you bump calligra-filters

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-12-16 12:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-17 21:02 [PR PATCH] Poppler 23.09.0 mhmdanas
2023-09-17 21:04 ` [PR PATCH] [Updated] " mhmdanas
2023-09-18 10:50 ` [PR REVIEW] " sgn
2023-09-20 12:26 ` [PR PATCH] [Updated] " mhmdanas
2023-12-12 18:02 ` mhmdanas
2023-12-14 15:16 ` [PR PATCH] [Updated] Poppler 23.12.0 sgn
2023-12-14 15:18 ` sgn
2023-12-14 15:20 ` sgn
2023-12-15 23:39 ` [PR PATCH] [Updated] " sgn
2023-12-15 23:40 ` sgn
2023-12-16  3:12 ` [PR PATCH] [Merged]: " sgn
2023-12-16 12:48 ` sgn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).