Comments (5)
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)
-
Using the PDF above, I was not able to view any differences between forcing
landscape
orportrait
-
However, when I tried doing the same thing with an image, we can see that the image is rotated
3. Then, when I changed the page dimensions, I got:
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.
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
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.
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.
@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 aPageable
interface is to let the source document determine its own layout. If you want to do something custom, then skip thePageable
and use aPrintable
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.
This bug report has been re-titled and migrated to qzind/tray#12.
from qz-print.
Related Issues (20)
- USB scale not working on Mac HOT 15
- Access denied when attempting to claim usb device in Ubuntu HOT 6
- Setting margins does not work in HTML and image printing HOT 1
- Automated Testing HOT 1
- PDF Rasterize Option HOT 1
- Silent install fails on Mac HOT 1
- qz.getNetworkUtilities does not exist HOT 1
- Print HTML: Not render content under @media print setting HOT 2
- Backport synchronous sends patch HOT 2
- qz tray 1.9.4 HOT 1
- qz-print 1.9.7 setRotation HOT 2
- How to differentiate between Label printer and other normal printers HOT 2
- QZ not working over WSS using IP machine HOT 1
- deleted
- Java environment missing error is not shown in new version - QZ Tray 2.0 HOT 1
- Qz Notification Allow HOT 1
- Error JSONObject["data"] is not a JSONArray (Microsoft Edge only) HOT 2
- certificate signing not working for qz.printers calls HOT 6
- deleted
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qz-print.