Am 01.12.2015 22:37, schrieb wi...@develop.earthshipeurope.org:
> On 2015-12-01 15:40, Rolf-Werner Eilert wrote:
>> Without waiting for an answer, I found a workaround for this:
>>
>> pdftk will rotate any landscape documents "1-endwest", so they are
>> printed as usual.
>>
>> If anyone here is interested in the code, you're welcome of course :)
>>
>> Regards
>> Rolf
> Hi Rolf,
>
> I'm curious in the code. I forsee I will be needing it as well in some
> near future situations.
>
> Regards,
>
> gbWilly
>

Okay, here you go ;)

My program produces PDFs which are stored under the client's name to be 
able to see who I have printed something for. When it is a landscape 
document, a flag is set which can be asked for in the end. This is the 
original piece of code:

       If Querdruck = True Then
         Exec ["pdftk", Replace$(feld[1], "~", User.Home), "cat", 
"1-endW", "output", User.Home &/ "karteitmp/quer.pdf"] Wait
         Exec ["kprinter", "--nodialog", "-d", drucker.Name, "-#", 
AnzahlKopien, User.Home &/ "karteitmp/quer.pdf"] Wait
       Else
         Exec ["kprinter", "--nodialog", "-d", drucker.Name, "-#", 
AnzahlKopien, Replace$(feld[1], "~", User.Home)] Wait
       End If

To make things easier, this is a more readable version:

If Landscape = True Then
   Exec ["pdftk", <input.pdf>, "cat", "1-endW", "output", <output.pdf>] Wait

Then I use kprinter to print, but lp would do the same.

Strange enough, my landscape PDFs are recognized as landscape by any PDF 
viewer, and printed as landscapes from there. But when you send them to 
the printing system, landscape is lost (or they are not turned round, 
respectively).

1-endW means page 1 thru last page westward. There may be later versions 
of pdftk which use "east" and "west" etc. instead of a single letter.

Hope this helps you on...

Regards
Rolf


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to