Commit af236d33 authored by Hartmut Goebel's avatar Hartmut Goebel
Browse files

Release 0.9.post2.

parents b81c468e 1189ad98
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ test:
  script: tox -e "py${PYTHON_VERSION/./}"
  parallel:
    matrix:
      - PYTHON_VERSION: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
      - PYTHON_VERSION: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

linters:
  image: python:3.13-slim
+18 −0
Original line number Diff line number Diff line

0.9.post2 (2025-07-28)
----------------------

* Fix scaling the page. This was totally broken in version 0.9, leading to
  empty pages.

* Drop support for Python 3.7. The required version of the library pdfposter
  is based on doesn't support that version any longer.

* Translate more strings. Update translations.


0.9.post1 (2025-07-22)
----------------------

* Fix packaging and upload to PyPI.


0.9 (2025-07-22)
----------------

+3 −3
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ Scale and tile PDF images/pages to print on multiple pages.
-------------------------------------------------------------

:Author:    Hartmut Goebel <h.goebel@crazy-compilers.com>
:Version:   Version 0.9.post1
:Version:   Version 0.9.post2
:Copyright: 2008-2025 by Hartmut Goebel
:License:   GNU Public License v3 or later (GPL-3.0-or-later)
:Homepage:  https://pdfposter.readthedocs.io/
@@ -32,9 +32,9 @@ Requirements and Installation

``Pdfposter`` requires

* `Python`__  (3.7—3.13, but newer versions should work, too),
* `Python`__  (3.8—3.13, but newer versions should work, too),
* `setuptools`__ or `pip`__ for installation, and
* `pypdf`__ (3.0 or newer, tested with 5.8.0)
* `pypdf`__ (5.5 or newer, tested with 5.8.0)

__ https://www.python.org/download/
__ https://pypi.org/project/setuptools
+3 −23
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ pdfposter - scale and tile PDF images/pages to print on multiple pages.
__author__ = "Hartmut Goebel <h.goebel@crazy-compilers.com>"
__copyright__ = "Copyright 2008-2025 by Hartmut Goebel <h.goebel@crazy-compilers.com>"
__license__ = "SPDX-License-Identifier: GPL-3.0-or-later"
__version__ = "0.9.post1"
__version__ = "0.9.post2"

from pypdf import PdfWriter, PdfReader, PageObject
from pypdf.types import NameObject
@@ -244,27 +244,6 @@ def _clip_pdf_page(page, x, y, width, height):
    page[NameObject('/Contents')] = content


def _scale_pdf_page(outpdf, page, factor):
    for boxname in PAGE_BOXES:
        box = page.get(boxname)
        # skip if real box does not exits (avoid fallback to other boxes)
        if not box:
            continue
        if isinstance(box, IndirectObject):
            box = page.pdf.get_object(box)
        for i, v in enumerate(box):
            box[i] = float(v) * factor
        #print boxname, type(box), box
    # put transformation matrix in front of page content
    content = ContentStream(page["/Contents"].get_object(), None)
    content.operations.insert(0, [[], b'%f 0 0 %f 0 0 cm' %(factor,factor)] )
    content = content.flate_encode()
    # Add changed content as an indirect object. So the content will
    # be referenced by the other pages and not copied. The content
    # will be in the output file only once.
    page[NameObject('/Contents')] = outpdf._add_object(content)


def posterize(outpdf, page, mediabox, posterbox, scale, use_ArtBox=False):
    """
    page: input page
@@ -281,7 +260,7 @@ def posterize(outpdf, page, mediabox, posterbox, scale, use_ArtBox=False):
    ncols, nrows, scale, rotate = decide_num_pages(inbox, mediabox,
                                                   posterbox, scale)
    mediabox = mediabox.copy()
    _scale_pdf_page(outpdf, page, scale)
    page.scale_by(scale)
    if rotate:
        page.rotate(90)
        rotate_box(inbox)
@@ -353,4 +332,5 @@ def main(opts, infilename, outfilename, password_hook=password_hook):
                  opts.use_ArtBox)

    if not opts.dry_run:
        outpdf.compress_identical_objects()
        outpdf.write(open(outfilename, 'wb'))
+3 −2
Original line number Diff line number Diff line
@@ -146,6 +146,7 @@ def run(args=None):
                        help=_("Show help about specifying BOX for "
                               "`--media-size` and `--poster-size` and exit"))
    parser.add_argument('--version', action='version',
                        help=_("show program's version number and exit"),
                        version="%(prog)s " + __version__)
    parser.add_argument('-v', '--verbose', action='count', default=0,
                        help=_("Be verbose. Tell about scaling, rotation "
@@ -155,7 +156,7 @@ def run(args=None):
                        help=_("Show what would have been done, "
                               "but do not generate files"))

    group = parser.add_argument_group('Define Input')
    group = parser.add_argument_group(_("Define Input"))
    group.add_argument('-f', '--first', type=int, dest='first_page',
                       metavar=_("INTEGER"),
                       help=_("First page to convert (default: first page)"))
@@ -167,7 +168,7 @@ def run(args=None):
                       help=_("Use the content area defined by the ArtBox "
                              "(default: use the area defined by the TrimBox)"))

    group = parser.add_argument_group('Define Target')
    group = parser.add_argument_group(_("Define Output"))
    group.add_argument('-m', '--media-size',
                       default=__parse_box(DEFAULT_MEDIASIZE),
                       type=__parse_box, metavar=_("BOX"),
Loading