Giter Site home page Giter Site logo

1.1in x 3.3in Dymo Label Support about qz-print HOT 5 CLOSED

tresf avatar tresf commented on September 28, 2024
1.1in x 3.3in Dymo Label Support

from qz-print.

Comments (5)

klabarge avatar klabarge commented on September 28, 2024

It appears that changing the orientation setting for PDF's currently does not work.

I had to use an image to test how the orientation setting currently functions.

Config
var size = { width: 3.3, height: 1.1};
var config = qz.configs.create('Microsoft XPS Document', { orientation: 'landscape', units: 'in', size: size });
Original PDF (3.3in x 1.1in)

image

  1. Using the PDF above, I was not able to view any differences between forcing landscape or portrait

    image

  2. However, when I tried doing the same thing with an image, we can see that the image is rotated

image
3. Then, when I changed the page dimensions, I got:

image

Note: Even after adding a printer with the above dimensions to my operating system, and using the original image that was designed for that size, I was unable to get rid of the gap at the bottom of the image.

from qz-print.

tresf avatar tresf commented on September 28, 2024

I was unable to get rid of the gap at the bottom of the image.

Right, because the dimensions were off by a considerable margin when compared to the label mentioned.

Here's an illustration showing it fixed to a 3:1 ratio...

GREEN: stretch width to be proportional
BLUE: shrink height to be proportional

image

changing the orientation setting for PDF's currently does not work.

Confirmed, except mine does portrait orientation every time (using PDFCreator, not XPS).

Upstream convo: https://issues.apache.org/jira/browse/PDFBOX-2922

@bberenz I've spent some time reading up on this and I'm not sure how best to approach the force-orientation in code.

from qz-print.

akberenz avatar akberenz commented on September 28, 2024

It looks like PDFBox is internally forcing a swap of dimensions when width > height to avoid the exception thrown by the MediaSize class when this condition is met.
We manage to skirt around this issue with image printing by using the MediaPrintableArea class, but as we have no control over the pdf printing logic I'm not sure there is anything we can do here.
The XPS printer is a bit .. loose anyways. Have you seen any of the results when using an actual label printer with PDFs?

from qz-print.

tresf avatar tresf commented on September 28, 2024

@bberenz using PDFCreator, this auto-rotates as documented. We have some options...

  • Echo a warning and ignore this
  • Try to tackle this via PDFBOX-recommended method

To quote the relevant portions from the developer...

If you want to customise the orientation, then you don't want to use PDFPageable. The purpose of a Pageable interface is to let the source document determine its own layout. If you want to do something custom, then skip the Pageable and use a Printable directly.

I do much prefer the standard behavior, but how much work is the Printable portions he speaks of? Can we use Printable if orientation is provided and fallback onto Pageable if not?

from qz-print.

tresf avatar tresf commented on September 28, 2024

This bug report has been re-titled and migrated to qzind/tray#12.

from qz-print.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.