Re: PrintPaperRectangle

2017-07-04 Thread Paul Hibbert via use-livecode
i came to the same conclusion, thank you for reporting it.

Paul

> On Jul 4, 2017, at 9:08 AM, Ben Rubinstein via use-livecode 
> <use-livecode@lists.runrev.com> wrote:
> 
> By synchronicity, I start writing a very similar message a few days ago.
> 
> I stopped writing the email when I'd typed the words "is there another print 
> property I should be using?" and as is often the case when I draft a 
> despairing message to the use- list, this prompted me to look a bit harder 
> and find the answer.
> 
> My problem, at least, was solved by finding the printPaperSize, which 
> correctly returns (for A4 at 100%) "595,842" - a reasonable approximation for 
> A4 paper converted to inches at 72dpi.
> 
>> Can anyone shed some light on this please.
> 
> Simple answer: it's a bug. At some point the printPaperRectangle has been 
> nobbled to be exactly the same as the printRectangle. I've reported this as
> http://quality.livecode.com/show_bug.cgi?id=19997
> 
> In the meantime, the printPaperSize is your friend, provided the page setup 
> is at default scale and orientation: in this case, the printPaperRectangle 
> should be the same as printPaperSize with two zeros.
> 
> However if you're not at default scale/orientation, you're a bit out of luck. 
> You can reasonably infer orientation from the printRectangle, but there's not 
> a reliable way to figure out the true scaled paper size from the combination 
> of printRectangle and printPaperSize (which is why we need 
> printPaperRectangle).
> 
> Ben
> 
> 
> On 30/06/2017 19:17, Terence Heaford via use-livecode wrote:
>> LC 8.1.4, MacOS 10.12.5
>> Print Paper Rectangle returns 8,8,834,587 for A4 Landscape.
>> This does not seem to match the description in the dictionary?
>> "The printPaperRectangle property contains four comma-separated integers and 
>> is in points.
>> The default value reflects the default values of the printPaperSize and 
>> printPaperOrientation.
>> The four numbers represent the left, top, right and bottom of the rectangle 
>> being printed to.
>> The rectangle is relative to the top-left of the page, and the left and top 
>> will currently always be 0.”
>> Can anyone shed some light on this please.
>> Thanks
>> Terry
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



Paul
p...@livecode.org

Mac OS Sierra 10.12.1



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: PrintPaperRectangle

2017-07-04 Thread Ben Rubinstein via use-livecode

By synchronicity, I start writing a very similar message a few days ago.

I stopped writing the email when I'd typed the words "is there another print 
property I should be using?" and as is often the case when I draft a 
despairing message to the use- list, this prompted me to look a bit harder and 
find the answer.


My problem, at least, was solved by finding the printPaperSize, which 
correctly returns (for A4 at 100%) "595,842" - a reasonable approximation for 
A4 paper converted to inches at 72dpi.


> Can anyone shed some light on this please.

Simple answer: it's a bug. At some point the printPaperRectangle has been 
nobbled to be exactly the same as the printRectangle. I've reported this as

http://quality.livecode.com/show_bug.cgi?id=19997

In the meantime, the printPaperSize is your friend, provided the page setup is 
at default scale and orientation: in this case, the printPaperRectangle should 
be the same as printPaperSize with two zeros.


However if you're not at default scale/orientation, you're a bit out of luck. 
You can reasonably infer orientation from the printRectangle, but there's not 
a reliable way to figure out the true scaled paper size from the combination 
of printRectangle and printPaperSize (which is why we need printPaperRectangle).


Ben


On 30/06/2017 19:17, Terence Heaford via use-livecode wrote:

LC 8.1.4, MacOS 10.12.5

Print Paper Rectangle returns 8,8,834,587 for A4 Landscape.

This does not seem to match the description in the dictionary?

"The printPaperRectangle property contains four comma-separated integers and is 
in points.
The default value reflects the default values of the printPaperSize and 
printPaperOrientation.
The four numbers represent the left, top, right and bottom of the rectangle 
being printed to.
The rectangle is relative to the top-left of the page, and the left and top 
will currently always be 0.”

Can anyone shed some light on this please.

Thanks


Terry
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: PrintPaperRectangle

2017-07-01 Thread Paul Dupuis via use-livecode
On 7/1/2017 10:05 AM, Terence Heaford via use-livecode wrote:
> Sorry about that, I should have realised (must be slow on the uptake today) 
> but….
>
>
> I still get the grey area when I print the card.
> Do you have any insight into why this should happen?
> (see thread “Capturing screen into image”)?
>

Sorry Terry, I have not been following the screen image thread.

I responded to the paper size post because I was just doing some work on
my own printing stack and so the material was "fresh" on my mind and was
trying to be helpful on something I knew off the top of my head.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: PrintPaperRectangle

2017-07-01 Thread Terence Heaford via use-livecode
Sorry about that, I should have realised (must be slow on the uptake today) 
but….


I still get the grey area when I print the card.
Do you have any insight into why this should happen?
(see thread “Capturing screen into image”)?


Thanks

Terry


> On 1 Jul 2017, at 14:02, Paul Dupuis via use-livecode 
>  wrote:
> 
> This is correctly reporting A4 with an 8px non-printable area around the
> edge:
> 
> 8.27 × 11.69 inches   8.2772  595.44
> 210 × 297 mm  11.69   72  841.68
> 
>   
>   
>   
>   
> 8,8,834,587   834 8   842
> l,t,r,b   
>   587 8   595
> 
> 
> A4 is 210 x 297mm which is 8.27 x 11.69 inches at 72px per inch is ~842
> x 595 (rounding off)
> Take the Right coordinate of 834 ad add 8 and you get 842 and the Bottom
> of 587 and add 8 and you get 595
> 
> 
> On 7/1/2017 2:58 AM, Terence Heaford via use-livecode wrote:
>> Thanks for your explanation. It does seem logical.
>> 
>> But where does 587 come from in 8,8,834,587 ?
>> 
>> A4 is 553.
>> 
>> Thanks
>> 
>> Terry
>> 
>> 
>> 
>>> On 30 Jun 2017, at 20:56, Bob Sneidar via use-livecode 
>>>  wrote:
>>> 
>>> Almost no toner based printer can do this. It's called Full Bleed, and 
>>> think about what happens to the excess toner that has to go off the edge of 
>>> the paper to do that. Ink based printers are designed to do this because 
>>> they can just catch the ink that gets oversprayed, and you can clean/empty 
>>> the waste ink container periodically. Toner is different because the paper 
>>> with the toner has to travel through the fuser, and then what doesn't get 
>>> fused gets picked up in the waste toner bin AFTER the fusing process. The 
>>> toner that gets left behind on a toner based printer has to have some means 
>>> of being collected. 
>>> 
>>> There are a few production based copiers that can do this, but they are 
>>> made to do it. Most other printers are not. 
>>> 
>>> Bob S
>>> 
>>> 
 On Jun 30, 2017, at 12:48 , Paul Dupuis via use-livecode 
  wrote:
 
 Some printer can not print right to the edge of the paper. I believe
 that the numbers you are seeing reflect the physical limitation on the
 edges of this particular printer.
>>> 
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your 
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: PrintPaperRectangle

2017-07-01 Thread Paul Dupuis via use-livecode
This is correctly reporting A4 with an 8px non-printable area around the
edge:

8.27 × 11.69 inches 8.2772  595.44
210 × 297 mm11.69   72  841.68





8,8,834,587 834 8   842
l,t,r,b 
587 8   595


A4 is 210 x 297mm which is 8.27 x 11.69 inches at 72px per inch is ~842
x 595 (rounding off)
Take the Right coordinate of 834 ad add 8 and you get 842 and the Bottom
of 587 and add 8 and you get 595


On 7/1/2017 2:58 AM, Terence Heaford via use-livecode wrote:
> Thanks for your explanation. It does seem logical.
>
> But where does 587 come from in 8,8,834,587 ?
>
> A4 is 553.
>
> Thanks
>
> Terry
>
>
>
>> On 30 Jun 2017, at 20:56, Bob Sneidar via use-livecode 
>>  wrote:
>>
>> Almost no toner based printer can do this. It's called Full Bleed, and think 
>> about what happens to the excess toner that has to go off the edge of the 
>> paper to do that. Ink based printers are designed to do this because they 
>> can just catch the ink that gets oversprayed, and you can clean/empty the 
>> waste ink container periodically. Toner is different because the paper with 
>> the toner has to travel through the fuser, and then what doesn't get fused 
>> gets picked up in the waste toner bin AFTER the fusing process. The toner 
>> that gets left behind on a toner based printer has to have some means of 
>> being collected. 
>>
>> There are a few production based copiers that can do this, but they are made 
>> to do it. Most other printers are not. 
>>
>> Bob S
>>
>>
>>> On Jun 30, 2017, at 12:48 , Paul Dupuis via use-livecode 
>>>  wrote:
>>>
>>> Some printer can not print right to the edge of the paper. I believe
>>> that the numbers you are seeing reflect the physical limitation on the
>>> edges of this particular printer.
>>
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: PrintPaperRectangle

2017-07-01 Thread Terence Heaford via use-livecode

Thanks for your explanation. It does seem logical.

But where does 587 come from in 8,8,834,587 ?

A4 is 553.

Thanks

Terry



> On 30 Jun 2017, at 20:56, Bob Sneidar via use-livecode 
>  wrote:
> 
> Almost no toner based printer can do this. It's called Full Bleed, and think 
> about what happens to the excess toner that has to go off the edge of the 
> paper to do that. Ink based printers are designed to do this because they can 
> just catch the ink that gets oversprayed, and you can clean/empty the waste 
> ink container periodically. Toner is different because the paper with the 
> toner has to travel through the fuser, and then what doesn't get fused gets 
> picked up in the waste toner bin AFTER the fusing process. The toner that 
> gets left behind on a toner based printer has to have some means of being 
> collected. 
> 
> There are a few production based copiers that can do this, but they are made 
> to do it. Most other printers are not. 
> 
> Bob S
> 
> 
>> On Jun 30, 2017, at 12:48 , Paul Dupuis via use-livecode 
>>  wrote:
>> 
>> Some printer can not print right to the edge of the paper. I believe
>> that the numbers you are seeing reflect the physical limitation on the
>> edges of this particular printer.
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: PrintPaperRectangle

2017-06-30 Thread Bob Sneidar via use-livecode
Almost no toner based printer can do this. It's called Full Bleed, and think 
about what happens to the excess toner that has to go off the edge of the paper 
to do that. Ink based printers are designed to do this because they can just 
catch the ink that gets oversprayed, and you can clean/empty the waste ink 
container periodically. Toner is different because the paper with the toner has 
to travel through the fuser, and then what doesn't get fused gets picked up in 
the waste toner bin AFTER the fusing process. The toner that gets left behind 
on a toner based printer has to have some means of being collected. 

There are a few production based copiers that can do this, but they are made to 
do it. Most other printers are not. 

Bob S

 
> On Jun 30, 2017, at 12:48 , Paul Dupuis via use-livecode 
>  wrote:
> 
> Some printer can not print right to the edge of the paper. I believe
> that the numbers you are seeing reflect the physical limitation on the
> edges of this particular printer.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: PrintPaperRectangle

2017-06-30 Thread Paul Dupuis via use-livecode
On 6/30/2017 2:17 PM, Terence Heaford via use-livecode wrote:
> LC 8.1.4, MacOS 10.12.5
>
> Print Paper Rectangle returns 8,8,834,587 for A4 Landscape.
>
> This does not seem to match the description in the dictionary?
>
> "The printPaperRectangle property contains four comma-separated integers and 
> is in points.
> The default value reflects the default values of the printPaperSize and 
> printPaperOrientation.
> The four numbers represent the left, top, right and bottom of the rectangle 
> being printed to.
> The rectangle is relative to the top-left of the page, and the left and top 
> will currently always be 0.”
>
> Can anyone shed some light on this please.
>

Some printer can not print right to the edge of the paper. I believe
that the numbers you are seeing reflect the physical limitation on the
edges of this particular printer.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

PrintPaperRectangle

2017-06-30 Thread Terence Heaford via use-livecode
LC 8.1.4, MacOS 10.12.5

Print Paper Rectangle returns 8,8,834,587 for A4 Landscape.

This does not seem to match the description in the dictionary?

"The printPaperRectangle property contains four comma-separated integers and is 
in points.
The default value reflects the default values of the printPaperSize and 
printPaperOrientation.
The four numbers represent the left, top, right and bottom of the rectangle 
being printed to.
The rectangle is relative to the top-left of the page, and the left and top 
will currently always be 0.”

Can anyone shed some light on this please.

Thanks


Terry
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: printPaperRectangle LC7

2015-03-23 Thread Terence Heaford

 On 22 Mar 2015, at 22:08, Paul Hibbert p...@livecode.org wrote:
 
 I really can't see why anybody would want the formatting printer to be 
 different from the destination printer, but that's probably just me.


What seems to happen is that when you select a printer via. the print dialogue 
box subsequent visits to the page setup dialogue box now has the same printer 
selected.

A lot of apps only provide access to the Page Setup in the menu. Those apps 
that provide access to printing from a Toolbar only seem to provide access to 
the Print Dialogue box from the Toolbar and not the Page Setup Dialogue box.

I agree that it would be better if LC provided access to the new style Print 
Dialogue Box which also provides the Page Setup.

Have you requested LC provide this?



All the best

Terry

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: printPaperRectangle LC7

2015-03-23 Thread Terence Heaford
Paul,

I think I’ve figured out how to make the settings stick and with the correct 
dimensions:

There is some poor dialogue box design from Apple involved so please be patient 
while I try to explain.

Firstly open a Page Setup Dialogue Box.

There is a pop up menu at the top titled Settings which has 2 items in it.

1. Page Attributes
2. Save as Default

Select all the settings you require:

Orientation
Paper Size
Scale

and choose your printer in Format For:

DO NOT PRESS OK YET

Now go to the popup menu titled Settings and select “Save as Default”

Now Press OK.

You can now quit LiveCode.

Reopen LiveCode and print using something like:

on mouseUp
   
   answer printer as sheet
   if the result = cancel then
  exit mouseUp
   end if

   send printChart to group generalChart
   
end mouseUp

I have found that LC/Printer has maintained it’s settings from the previous 
session.

I suspect that using the Page Setup Dialogue Box to apply settings to different 
printers will result in those being applied if you select a different printer 
in the answer printer dialogue box.


Hope this helps


Terry







___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: printPaperRectangle LC7

2015-03-23 Thread Paul Hibbert
Thank you for the notes, I have tried setting the defaults, but unfortunately 
it still can't do what I need, I have 5 different printers and all but two have 
very different paper margins.

I realise now that it's not LC's fault when things go awry, but at least I 
found an odd workaround for the current problem by calling the Page Setup after 
the Print dialogue, it's a bit klunky, but at least everything lines up 
correctly that way.

I've had notice today that the print card… 'into pageRect' should be fixed in 
LC7.0.4-rc-3 which is currently awaiting build.

Paul

 On Mar 23, 2015, at 1:39 PM, Terence Heaford t.heaf...@icloud.com wrote:
 
 Paul,
 
 I think I’ve figured out how to make the settings stick and with the correct 
 dimensions:
 
 There is some poor dialogue box design from Apple involved so please be 
 patient while I try to explain.
 
 Firstly open a Page Setup Dialogue Box.
 
 There is a pop up menu at the top titled Settings which has 2 items in it.
 
 1. Page Attributes
 2. Save as Default
 
 Select all the settings you require:
 
 Orientation
 Paper Size
 Scale
 
 and choose your printer in Format For:
 
 DO NOT PRESS OK YET
 
 Now go to the popup menu titled Settings and select “Save as Default”
 
 Now Press OK.
 
 You can now quit LiveCode.
 
 Reopen LiveCode and print using something like:
 
 on mouseUp
 
   answer printer as sheet
   if the result = cancel then
  exit mouseUp
   end if
 
   send printChart to group generalChart
 
 end mouseUp
 
 I have found that LC/Printer has maintained it’s settings from the previous 
 session.
 
 I suspect that using the Page Setup Dialogue Box to apply settings to 
 different printers will result in those being applied if you select a 
 different printer in the answer printer dialogue box.
 
 
 Hope this helps
 
 
 Terry
 
 
 
 
 
 
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: printPaperRectangle LC7

2015-03-22 Thread Terence Heaford

 On 22 Mar 2015, at 01:28, Paul Hibbert p...@livecode.org wrote:
 
 Long answer to a short question, skip this if you're not interested in 
 printing on a Mac…

Paul,

Thanks for the feedback.

So, I was exploring this method of printing to overcome the fact that  print 
card [from topLeft to rightBottom] [into pageRect] does not work in LC 7.

I was using it to centre the printing of a group.

Is there really no way to do this in LC7 or do I have another option?

If the answer is no then it really is imperative that LC get print card [from 
topLeft to rightBottom] [into pageRect]” working.

If a solution is not available then it’s back to LC 6.7.3.


All the best

Terry


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: printPaperRectangle LC7

2015-03-22 Thread Terence Heaford

 On 22 Mar 2015, at 01:28, Paul Hibbert p...@livecode.org wrote:
 
 Long answer to a short question, skip this if you're not interested in 
 printing on a Mac…

The mystery is growing:

printPaperRect

LC 7.0.3
First pass = 18,18,801,577
Subsequent passes = 8,8,834,587

LC 6.7.3
First pass = 0,0,842,596
Subsequent passes = 0,0,842,596


Can someone explain this please?


All the best

Terry
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: printPaperRectangle LC7

2015-03-22 Thread Terence Heaford

 On 22 Mar 2015, at 01:28, Paul Hibbert p...@livecode.org wrote:
 
 Long answer to a short question, skip this if you're not interested in 
 printing on a Mac…


The issue for me  seems to be that the first time I open the page setup dialog 
box my default printer is not selected, “Any Printer” is selected.

This seems to throw the dimensions and hence calculations.

On the first pass if I select the printer actually connected to my computer the 
printout is correct.

So, the question is:

How can I ensure that the default printer is showing in the Page Setup Dialog 
Box?

My default printer is selected correctly in the System Preferences.


All the best

Terry
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: printPaperRectangle LC7

2015-03-22 Thread Terence Heaford

 On 22 Mar 2015, at 11:06, Terence Heaford t.heaf...@icloud.com wrote:
 
 How can I ensure that the default printer is showing in the Page Setup Dialog 
 Box?


There appears to be a bug in LC 7’s implementation of the Page Setup Dialogue 
Box.


On LC 6.7.3 if you select a printer in the Page Setup Dialogue Box that 
selection is retained the next time you open it.


On LC 7.0.3 if you select a printer in the Page Setup Dialogue Box the 
selection is not retained as next time you visit it it says “Any Printer”


This may only apply to Mac, as I have no means of testing on other systems.


All the best


Terry
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: printPaperRectangle LC7

2015-03-22 Thread J. Landman Gay

On 3/22/2015 2:47 PM, Paul Hibbert wrote:

I couldn't find a bug report to cover this issue, so I'll submit one
just to see what LiveCode's answer is, and to see if there is any
chance of a fix.


It might be related to this one:
http://quality.runrev.com/show_bug.cgi?id=9023

Marked as closed, probably because the cause couldn't be fixed but the 
documentation could. It isn't quite what you're describing but it's close.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: printPaperRectangle LC7

2015-03-22 Thread Paul Hibbert
You are just slowly coming to the same conclusions I did, apart from the fact 
that this is an Apple bug, not a LC bug, I'm sure if you continue with LC6.7.3 
you will see the same problems occur, I just tested it again and saw the same 
problem, and in LC 5.5.5 too. It also happens in Apple's own Pages app.

In my long reply I did explain one reliable way to use the print system by 
reversing the order that the dialogue boxes are shown, try it and I'm sure you 
will find it works fine, but it's just not so intuitive! Although at least in 
LC you can do it that way.

  on mouseUp
 answer printer as sheet
 if the result is Cancel then exit to top
 answer page Setup as sheet
 if the result is Cancel then exit to top
 print card
  end mouseUp

I'm also quite confident the print into rect will be working in the next 
release, so that should overcome your original problem, but I'm also equally 
confident the issue you are seeing right now can't be fixed by LiveCode, 
however, I couldn't find a bug report to cover this issue, so I'll submit one 
just to see what LiveCode's answer is, and to see if there is any chance of a 
fix.

As a point of interest, take a look at Apple's latest Preview app, the Page 
Setup is combined with the Print dialogue, I hope LC will have the option go 
the same way soon.

Happy LiveCoding :)

Paul


 On Mar 22, 2015, at 4:20 AM, Terence Heaford t.heaf...@icloud.com wrote:
 
 
 On 22 Mar 2015, at 11:06, Terence Heaford t.heaf...@icloud.com wrote:
 
 How can I ensure that the default printer is showing in the Page Setup 
 Dialog Box?
 
 
 There appears to be a bug in LC 7’s implementation of the Page Setup Dialogue 
 Box.
 
 
 On LC 6.7.3 if you select a printer in the Page Setup Dialogue Box that 
 selection is retained the next time you open it.
 
 
 On LC 7.0.3 if you select a printer in the Page Setup Dialogue Box the 
 selection is not retained as next time you visit it it says “Any Printer”
 
 
 This may only apply to Mac, as I have no means of testing on other systems.
 
 
 All the best
 
 
 Terry
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: printPaperRectangle LC7

2015-03-22 Thread Terence Heaford

 On 22 Mar 2015, at 19:47, Paul Hibbert p...@livecode.org wrote:
 
 You are just slowly coming to the same conclusions I did, apart from the fact 
 that this is an Apple bug, not a LC bug, I'm sure if you continue with 
 LC6.7.3 you will see the same problems occur, I just tested it again and saw 
 the same problem, and in LC 5.5.5 too. It also happens in Apple's own Pages 
 app.

I am not convinced there is a bug at all (LC or Apple).

My workflow:

1. Open PageSetup

2. Note in the PageSetup Format For: - On first run this says “Any Printer”

3. I press OK to continue.

4. Continue with Answer Printer etc.

5. Printout is offset I think because printPaperRect picks up a set of default 
dimensions associated with “Any Printer”


Close down LiveCode and open my project again.

Using the same workflow except for 2.

1. Open PageSetup

2. Select my default printer from the popup menu.

3  4. As before

5. Printout is correct I think because printPaperRect has now picked up the 
dimensions associated with my printer selection.


I have done a little Cocoa programming before and think this is the way Apple 
intends it to work.

If you want to read more, see this link.

https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Printing/osxp_aboutprinting/osxp_aboutprt.html#//apple_ref/doc/uid/1083-SW1


 As a point of interest, take a look at Apple's latest Preview app, the Page 
 Setup is combined with the Print dialogue, I hope LC will have the option go 
 the same way soon.

Yes, that would solve the page setup all together. There is an image of the 
dialogue in the link above.



All the best

Terry







___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: printPaperRectangle LC7

2015-03-22 Thread Terence Heaford
Paul  any others interested,

Here is a snippet from the thread below that may help:


http://developer.apple.com/documentation/Printing/Conceptual/
About_MacOSX_Printing/abtprt_chap2/chapter_2_section_2.html#//
apple_ref/doc/uid/20001017-CH205-TPXREF127 
http://developer.apple.com/documentation/Printing/Conceptual/About_MacOSX_Printing/abtprt_chap2/chapter_2_section_2.html#//apple_ref/doc/uid/20001017-CH205-TPXREF127

Particularly:

It’s important to keep in mind that the formatting printer does not
specify the destination printer—that is, the printer to which the
document is printed. The destination printer is specified in the
Print dialog, which by default is the default printer in Print
Center. The user can change the destination printer in the Print
dialog, but changing the formatting printer in the Page Setup dialog
does not change the destination printer.”


http://www.cocoabuilder.com/archive/cocoa/179023-detecting-printer-changes-in-nspagelayout-question.html
 
http://www.cocoabuilder.com/archive/cocoa/179023-detecting-printer-changes-in-nspagelayout-question.html



All the best


Terry
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: printPaperRectangle LC7

2015-03-22 Thread Paul Hibbert

 Particularly:
 
 It’s important to keep in mind that the formatting printer does not
 specify the destination printer—that is, the printer to which the
 document is printed. The destination printer is specified in the
 Print dialog, which by default is the default printer in Print
 Center. The user can change the destination printer in the Print
 dialog, but changing the formatting printer in the Page Setup dialog
 does not change the destination printer.”

I guess that's where Apple and I don't agree, to my mind, setting the printer 
in Page Setup is a conscious choice and it should update the destination 
printer and therefore, the printerName, the printSettings in LC, but it does 
none of this, however it does update the printPaperRect.

So in the case of an app that can display the Page Setup, to ensure the 
printPaperRect is as you expect, you would need to set the formatting printer 
in Page Setup, along with the paper size/options and orientation to match the 
destination printer that you are going to choose in the Print dialogue.

Not doing any of this, as stated here…

https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Printing/osxp_flexible/osxp_flexible.html#//apple_ref/doc/uid/1083i-CH1-SW6

 Some apps also provide users with the option to setup the page through the 
 Page Setup pane as shown in Figure 1-5. Most of the time users shouldn’t need 
 to perform any setup through this panel. So if your app doesn’t need it, make 
 the user experience simpler by not providing a Page Setup command.

…Can cause unexpected results, as you found out. I guess the clue is in if 
your app doesn’t need it!

I really can't see why anybody would want the formatting printer to be 
different from the destination printer, but that's probably just me.

At least I guess there's no need for a bug report. :)

Paul
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: printPaperRectangle LC7

2015-03-21 Thread Terence Heaford
Here’s an image on DropBox that demonstrates the problem.

The left margin is clearly less than the right margin.

I don’t know why?

https://dl.dropboxusercontent.com/u/98788898/LiveCode/printing.png 
https://dl.dropboxusercontent.com/u/98788898/LiveCode/printing.png



Thanks

Terry

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

printPaperRectangle LC7

2015-03-21 Thread Terence Heaford
I have been trying to overcome the issue of printing/scaling part of a card to 
a print rect by

using printScale with print card and have come across this issue.

I have placed various “put” statements in my code to obtain the data before it 
prints.

Here is the data:

chart width = 814  This is the width of a group I am printing calculated by 
me using a ratio eventually passed to printScale

printPaperRectangle = 8,8,834,587  returned by LC

printMargins = 10,10,10,10  the print margins I previously set.


The relationship between the chart width calculation (814) and the 
printpaperRectangle width (834) seems correct when you add the left and right 
margins to the 834.

However, I have no idea where the 8,8 has come from in the printPaperRectangle 
as the documentation in LC suggests that these should always be 0,0.

The docs state

The four numbers represent the left, top, right and bottom of the rectangle 
being printed to. The rectangle is relative to the top-left of the page, and 
the left and top will currently always be 0.

Comments:
The printPaperRectangle property is read-only and cannot be set. Changing the 
printMargins 
applewebdata://6917CC1F-41E6-4643-8586-70AB8FF22BB4/dictionary/property/2353.xml”


I think this might confirm why my chart does not print centrally in the 
horizontal.


Is this another printing bug or is this now expected and the docs are incorrect?



Thanks

Terry



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: printPaperRectangle LC7

2015-03-21 Thread Terence Heaford

 On 21 Mar 2015, at 18:17, J. Landman Gay jac...@hyperactivesw.com wrote:
 
 So your printer has a print area of 8,8,834,587. The printmargins you set 
 will be offset by that area. If you set the left print margin to 10, on the 
 actual paper it will be 18 (10 for your margin + 8 from the printer.)

Yes, the docs are poorly worded if this is the case.

I experimented to come to the conclusion the docs are poorly worded and this, 
from visual inspection, seems to work

put  the printPaperRectangle into tPaperRect
put item 1 of tPaperRect into tPaperLeft
put item 2 of tPaperRect into tPaperTop
put item 3 of tPaperRect into tPaperWidth
put item 4 of tPaperRect into tPaperHeight

put tPaperLeft/2 into tOffsetH
put tPaperTop/2 into tOffsetV

set the printMargins to tMargin + tOffsetH, tMargin + tOffsetV, tMargin - 
tOffsetH, tMargin - tOffsetV


All the best

Terry







___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: printPaperRectangle LC7

2015-03-21 Thread Terence Heaford

 On 21 Mar 2015, at 18:17, J. Landman Gay jac...@hyperactivesw.com wrote:
 
 So your printer has a print area of 8,8,834,587


I have just identified an issue.

On my first pass through the routines the printPaperRectangle = 18,18,801,577 
and the chart is offset to the left.

On my second and subsequent passes through the routines printPaperRectangle = 
8,8,834,587 and the chart is entered correctly.

Why would printPaperRectangle not be 8,8,834,587 after I set the pagesetup to 
landscape on the first pass?

Firstly from a button I do this:

   answer page setup as sheet
   if the result = cancel then
  exit mouseUp
   end if
   answer printer as sheet
   if the result = cancel then
  exit mouseUp
   end if
   send printChart to group  “generalChart


Then my print routine:

on printChart

   put 10 into tLeftMargin
   put 10 into tRightMargin
   put 10 into tTopMargin
   put 10 into tBottomMargin
   
   put the printPaperRectangle into tPaperRect
   
   put tPaperRect
   
   put item 1 of tPaperRect into tPaperLeft
   put item 2 of tPaperRect into tPaperTop
   put item 3 of tPaperRect into tPaperWidth
   put item 4 of tPaperRect into tPaperHeight
   
   put tPaperWidth - tLeftMargin - tRightMargin into tAvailWidth
   put tPaperHeight - tTopMargin - tBottomMargin into tAvailHeight
   
   put the width of me into tChartWidth
   put the height of me into tChartHeight
   put tAvailWidth/tChartWidth into tWidthRatio   
   put tAvailHeight/tChartHeight into tHeightRatio   
   put min(tWidthRatio,tHeightRatio) into tRatio
   
   put tRatio * tChartWidth into tActualWidth
   put tRatio * tChartHeight into tActualHeight
   
   put (tPaperWidth - tActualWidth)/2 into tLM
   --put (tPaperHeight - tActualHeight)/2 into tTM -- this centres chart 
vertically on the page
   put tTopMargin into tTM -- this keeps the chart at the top of the page
   
   put tPaperLeft/2 into tOffsetH
   put tPaperTop/2 into tOffsetV
   
   set the printMargins to tLM + tOffsetH,tTM + tOffsetV,tLM - tOffsetH,tTM - 
tOffsetV
   
   set the printScale to tRatio
   
   --put chart width =   tW  return  printPaperRectangle =   tPaperRect 
 return  printMargins =   the printMargins
   
   put the topLeft of me into tTopLeft
   put the bottomRight of me into tBottomRight
   
   print card from tTopLeft to tBottomRight
   
end printChart
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: printPaperRectangle LC7

2015-03-21 Thread J. Landman Gay

On 3/21/2015 3:38 AM, Terence Heaford wrote:

The docs state

The four numbers represent the left, top, right and bottom of the
rectangle being printed to. The rectangle is relative to the top-left
of the page, and the left and top will currently always be 0.


This isn't very well written. What it really means is:

The four numbers represent the left, top, right and bottom of the 
printing area the printer supports. The rectangle is relative to the 
top-left of the paper, which is 0,0.


So your printer has a print area of 8,8,834,587. The printmargins you 
set will be offset by that area. If you set the left print margin to 10, 
on the actual paper it will be 18 (10 for your margin + 8 from the printer.)


What I usually do is ignore the right and bottom margins and set them to 
zero if I'm sure the whole printout will fit on a page. If my top and 
left calculations are correct, it doesn't matter what those are. Then I 
calculate the amount of inset I need for the top and left, set those 
printmargins (minus the printer offsets) and print the page.


So if you want your printout to begin at 20 pixels from the left of the 
physical paper, the left printmargin would be 12. The right side should 
just fall into place by itself if you've scaled the image correctly.


I should warn that printing is voodoo and while you can get very close, 
it may never be perfect on all printers and in all cases. Printers are 
independent with minds of their own.



--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: printPaperRectangle LC7

2015-03-21 Thread Paul Hibbert

 On Mar 21, 2015, at 1:44 PM, Terence Heaford t.heaf...@icloud.com wrote:
 
 Why would printPaperRectangle not be 8,8,834,587 after I set the pagesetup to 
 landscape on the first pass?

Long answer to a short question, skip this if you're not interested in printing 
on a Mac…

If you changed the printer settings in the Page setup dialogue or just assume 
that what you saw there was correct, then I suspect you may be hitting a bug 
that AFAIK is an old Apple bug and I seem to remember that LC has no control 
over it.

It is possible to have the print sizes mixed up from page setup to the print 
command, I just found this still exists. If you change the printer in the Page 
Setup dialogue it doesn't reflect the change in the Print dialogue, but it does 
the other way around.

This happens in Apple's Pages too along with some other apps that still use 
Page Setup, whereas apps like Preview have the Page Setup combined with the 
Print dialogue, much more sensible.

My conclusion is that the only *reliable* way to choose a print size is to set 
the correct printer first in the Print Dialogue (don't hit Cancel as the choice 
will not stick), then go back to Page Setup to choose the correct paper size, 
orientation etc., now you can print to that size with more confidence.

I haven't found an easy answer to this issue so far, but under certain 
circumstances this can cause the printPaperRect to be different to what you 
expect. Of course, if you use the same printer and page setup all the time, 
then this really shouldn't happen. One odd unintuitive workaround is to call 
the Answer Page Setup after calling the Answer Print dialogue, then everything 
lines up correctly e.g.

  case Print
 answer printer
 if the result is Cancel then exit to top
 answer page Setup
 if the result is Cancel then exit to top
 print card
   break

This is fine for personal stuff, but not so much for published apps.

Below is a test script I used in a menu button, you will need 2 printers 
connected with different margins to test this, usually from different 
manufacturers or maybe laser vs inkjet then try printing to alternate printers:

   case Print
 answer the printerName  the printPaperRect -- Returns the name of 
the last used printer  the last used printPaperRect
 answer page Setup -- ** Causes a problem if you don't have the correct 
printer selected here **
 if the result is Cancel then exit to top
 answer the printerName  the printPaperRect -- Returns the name of 
the last used printer  the printPaperRect of the page/paper chosen
 answer printer -- Note previous printer shown, now switch to the 
desired printer
 if the result is Cancel then exit to top
 answer the printerName  the printPaperRect -- Returns the name of 
the new printer chosen  the printPaperRect of the page/paper chosen in Page 
Setup
 -- print card -- Disabled to save paper!
   break

  case Print Fix
 answer the printerName  the printPaperRect -- Returns the name of 
the last used printer  the last used printPaperRect
 answer printer -- You need to switch printers here to ensure correct 
output
 if the result is Cancel then exit to top
 answer the printerName  the printPaperRect -- Returns the name of 
the new printer chosen  the last used printPaperRect
 answer page Setup -- The correct printer displays in the dialogue box 
- no confusion!
 if the result is Cancel then exit to top
 answer the printerName  the printPaperRect -- Returns the name of 
the new printer chosen  the correct printPaperRect of the page/paper chosen
 -- print card -- Disabled to save paper!
   break

In the first case Print, if the previously used printer is a laser printer 
with margins of say 18 and in the Page Setup dialogue you choose the paper size 
of letter, but overlook setting the printer, then in the Print dialogue, you 
set the printer to an inkjet printer that has margins of say 8, the new margins 
will not be applied to the printPaperRectangle, they will be 18.

In the second case Print Fix, choosing the printer in the Print dialogue will 
update the printer choice in the Page Setup dialogue so when you choose a page 
size, the margins will be correct for the printer chosen.

Of course this should all go away if/when LC has access to the new style print 
dialogue like the one used for Apple's Preview app. I notice that Adobe has 
rolled their own for Photoshop.

Paul
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode