Printing a Widget Browser

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Printing a Widget Browser

Richmond Mathewson via use-livecode

Not posted for a long time but still keeping an eye on progress.

Is there any chance of printing a Browser Widget any time soon?

This code just gives a grey printout.

I am waiting patiently for this so that I can use for example amCharts within LiveCode.

I have implemented a print routine by exporting to an image but as this is an image it can turn out blurred.

Thanks

Terry


on mouseUp
   
   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
   
   put  the printPaperRectangle into tPaperRect
   put item 3 of tPaperRect into tAvailWidth
   put item 4 of tPaperRect into tAvailHeight
   
   put the width of widget "Browser" into tChartWidth
   put the height of widget "Browser" into tChartHeight
   
   put tAvailWidth/tChartWidth into tWidthRatio  
   put tAvailHeight/tChartHeight into tHeightRatio  
   put min(tWidthRatio,tHeightRatio) into tRatio  
   
   put tRatio * tChartWidth into tPrintWidth
   put tRatio * tChartHeight into tPrintHeight
   
   put 0 into item 1 of tPrintRect
   put 0 into item 2 of tPrintRect
   put tPrintWidth into item 3 of tPrintRect
   put tPrintHeight into item 4 of tPrintRect
   
   print card from topleft of widget "Browser" to bottomRight of widget "Browser" into tPrintRect
   
   
end mouseUp
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Printing a Widget Browser

Richmond Mathewson via use-livecode
Could you export to a file, launch that in the user's standard browser, and print from there?

Sent from my iPhone

> On Jun 29, 2017, at 2:04 PM, Terence Heaford via use-livecode <[hidden email]> wrote:
>
>
> Not posted for a long time but still keeping an eye on progress.
>
> Is there any chance of printing a Browser Widget any time soon?
>
> This code just gives a grey printout.
>
> I am waiting patiently for this so that I can use for example amCharts within LiveCode.
>
> I have implemented a print routine by exporting to an image but as this is an image it can turn out blurred.
>
> Thanks
>
> Terry
>
>
> on mouseUp
>
>   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
>
>   put  the printPaperRectangle into tPaperRect
>   put item 3 of tPaperRect into tAvailWidth
>   put item 4 of tPaperRect into tAvailHeight
>
>   put the width of widget "Browser" into tChartWidth
>   put the height of widget "Browser" into tChartHeight
>
>   put tAvailWidth/tChartWidth into tWidthRatio  
>   put tAvailHeight/tChartHeight into tHeightRatio  
>   put min(tWidthRatio,tHeightRatio) into tRatio  
>
>   put tRatio * tChartWidth into tPrintWidth
>   put tRatio * tChartHeight into tPrintHeight
>
>   put 0 into item 1 of tPrintRect
>   put 0 into item 2 of tPrintRect
>   put tPrintWidth into item 3 of tPrintRect
>   put tPrintHeight into item 4 of tPrintRect
>
>   print card from topleft of widget "Browser" to bottomRight of widget "Browser" into tPrintRect
>
>
> end mouseUp
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Printing a Widget Browser

Richmond Mathewson via use-livecode
Also, have you tried this:

Do "window.print()" in widget "my widget"

Sent from my iPhone

> On Jun 29, 2017, at 3:37 PM, [hidden email] wrote:
>
> Could you export to a file, launch that in the user's standard browser, and print from there?
>
> Sent from my iPhone
>
>> On Jun 29, 2017, at 2:04 PM, Terence Heaford via use-livecode <[hidden email]> wrote:
>>
>>
>> Not posted for a long time but still keeping an eye on progress.
>>
>> Is there any chance of printing a Browser Widget any time soon?
>>
>> This code just gives a grey printout.
>>
>> I am waiting patiently for this so that I can use for example amCharts within LiveCode.
>>
>> I have implemented a print routine by exporting to an image but as this is an image it can turn out blurred.
>>
>> Thanks
>>
>> Terry
>>
>>
>> on mouseUp
>>
>>  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
>>
>>  put  the printPaperRectangle into tPaperRect
>>  put item 3 of tPaperRect into tAvailWidth
>>  put item 4 of tPaperRect into tAvailHeight
>>
>>  put the width of widget "Browser" into tChartWidth
>>  put the height of widget "Browser" into tChartHeight
>>
>>  put tAvailWidth/tChartWidth into tWidthRatio  
>>  put tAvailHeight/tChartHeight into tHeightRatio  
>>  put min(tWidthRatio,tHeightRatio) into tRatio  
>>
>>  put tRatio * tChartWidth into tPrintWidth
>>  put tRatio * tChartHeight into tPrintHeight
>>
>>  put 0 into item 1 of tPrintRect
>>  put 0 into item 2 of tPrintRect
>>  put tPrintWidth into item 3 of tPrintRect
>>  put tPrintHeight into item 4 of tPrintRect
>>
>>  print card from topleft of widget "Browser" to bottomRight of widget "Browser" into tPrintRect
>>
>>
>> end mouseUp
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...