#1 2014-10-25 23:02:01

leus
Member
Registered: 2012-09-05
Posts: 79

Orientation bug

Hello,

I've been using this marvelous library for a while but just today found the need to export a document that is wider than tall. This has proven a nuisance, because of what I think is a bug.

Landscape, in printing, means that your picture will be printed sideways. In SynPDF, it just means that the paper width is larger than its height (and SynPDF will actively try to "correct" it for you, making your page tall anyways.)

I think (from a distance, since I'm not expert in SynPDF nor PDF) that this landscape property should be removed entirely and replaced by a true Orientation property, which dictates if the contents will be rendered sideways (I think I've seen PDF docs with intermixed landscape and portrait pages: when displayed on the screen, you'll see wider pages being rotated so they can be read, but when printed they print correctly, sideways).

I've removed all the landscape code from my own copy of SynPDF and now I can export wide pages without problems.

Cheers,

Offline

#2 2014-10-25 23:05:17

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,183
Website

Re: Orientation bug

Do you have some code to share?

Offline

#3 2014-10-27 13:35:17

leus
Member
Registered: 2012-09-05
Posts: 79

Re: Orientation bug

I would love to help. I think this is needed:

- Remove the current properties completely (this is a breaking change but I think it is necessary to avoid unexpected behavior from the engine)
- Add a new "Orientation" property (the Printers unit already contains a TPrinterOrientation = (poPortrait, poLandscape) - we can use it or define our own type)
- Add the logic to print sideways (rotate the image 90º counter clockwise) when Orientation = poLandscape.

Of these, the first and second bullets are trivial, minor changes. However, I'm not in the same ballpark when comes to the third change - sure, it is really easy to get some blit algorithm and make an image rotate, but on the PDF side I got nothing (I stared at the PDF reference for a while but it looks Polish to me.) If you can provide me some leads to start digging in the code I can give it a try.

Regards,
Leonardo Herrera

Offline

Board footer

Powered by FluxBB