Re: Page 2 of a PDF

2013-04-06 Thread J. Landman Gay

On 4/6/13 1:00 PM, David Epstein wrote:

 J. Landman Gay:
That's pretty good, it works great. Where'd you get the "75" from?

Based on your calculation, this one-liner also works:

on goPage n
set the currenttime of player 1 to (n-1)*75
end goPage


Thank you, that's an improvement.  The 75 came from observing that the
"duration" of a player with a PDF loaded seemed to be 75*(z-1) where z =
the number of pages.


Nice observation, I wouldn't have thought of it. The next question is if 
that's a Mac-only convention or if it works universally. If it's 
universal, it becomes a handy cross platform solution.


--
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: Page 2 of a PDF

2013-04-06 Thread David Epstein

 J. Landman Gay:
That's pretty good, it works great. Where'd you get the "75" from?

Based on your calculation, this one-liner also works:

on goPage n
set the currenttime of player 1 to (n-1)*75
end goPage


Thank you, that's an improvement.  The 75 came from observing that  
the "duration" of a player with a PDF loaded seemed to be 75*(z-1)  
where z = the number of pages.



Thomas McGrath III:
Do you have more code or explanations about how this works? I am  
actually looking for a step for images in a scrolling group on iOS  
and Android but your email made me think that maybe a pdf might  
work. I need the images to 'land' fully in view even if the user  
has not scrolled all the way on a touch.




I don't know about iOS or Android, but I would think you could move  
an image to the group's top edge by setting the scroll of the group  
to the top of the image minus item 2 of the formattedRect of the group.


David Epstein

___
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: Page 2 of a PDF

2013-04-05 Thread J. Landman Gay

On 4/5/13 8:33 AM, dfepst...@comcast.net wrote:



I think this will work on a Mac:



on pdfToPage n -- show page n of the pdf in player 1
   put round(n) into n -- n as passed by scrollBarDrag doesn't seem to
   -- always be an integer
   put (n-1)*75 into t
   set the playSelection of player 1 to true
   set the startTime of player 1 to t
   set the endTime of player 1 to t+1
   play step player 1
end pdfToPage


That's pretty good, it works great. Where'd you get the "75" from?

Based on your calculation, this one-liner also works:

on goPage n
   set the currenttime of player 1 to (n-1)*75
end goPage

--
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: Page 2 of a PDF

2013-04-05 Thread Thomas McGrath III
Do you have more code or explanations about how this works? I am actually 
looking for a step for images in a scrolling group on iOS and Android but your 
email made me think that maybe a pdf might work. I need the images to 'land' 
fully in view even if the user has not scrolled all the way on a touch.

Thanks,

Tom

-- Tom McGrath III
http://lazyriver.on-rev.com
mcgra...@mac.com

On Apr 5, 2013, at 9:33 AM, dfepst...@comcast.net wrote:

> 
> 
> I think this will work on a Mac: 
> 
> 
> 
> on pdfToPage n -- show page n of the pdf in player 1 
>   put round(n) into n -- n as passed by scrollBarDrag doesn't seem to 
>   -- always be an integer 
>   put (n-1)*75 into t 
>   set the playSelection of player 1 to true 
>   set the startTime of player 1 to t 
>   set the endTime of player 1 to t+1 
>   play step player 1 
> end pdfToPage 
> 
>  Ray Horsley wrote 
> 
>   using a player object I can't control from a script which page of the 
> PDF the player object is displaying. 
> 
> 
> 
> David Epstein 
> ___
> 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: Page 2 of a PDF

2013-04-05 Thread dfepstein


I think this will work on a Mac: 



on pdfToPage n -- show page n of the pdf in player 1 
  put round(n) into n -- n as passed by scrollBarDrag doesn't seem to 
  -- always be an integer 
  put (n-1)*75 into t 
  set the playSelection of player 1 to true 
  set the startTime of player 1 to t 
  set the endTime of player 1 to t+1 
  play step player 1 
end pdfToPage 

 Ray Horsley wrote 

      using a player object I can't control from a script which page of the PDF 
the player object is displaying. 



David Epstein 
___
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: Page 2 of a PDF

2013-04-04 Thread Mac Bennett
I've been using "pdfimages"  one of the tools that comes with "xpdf";  I am 
using Livecode shell calls to batch process a hundred or so pdfs of old letters 
which were scanned as pdf.  From the commandline, pdfimages outputs numbered 
jpg or ppm files of each page in multipage pdfs.  

(Note: this only works with images inside pdf files, not actual pdf text;  xpdf 
has a tool "pdftoppm" which outputs raw images of multipage pdfs; but I haven't 
tried it.)

xpdf webpage:   http://www.foolabs.com/xpdf/index.html

Mac


On Apr 4, 2013, at 2:35 PM, Ray Horsley  wrote:

> I believe this has come up before but don't I see any way to convert page 2, 
> page 3, etc. of a PDF to a PNG or JPEG via snapshot using either revBrowser 
> or a player object.  A browser object doesn't seem to display a specified 
> page at all, and while I can manually scroll through a PDF using a player 
> object I can't control from a script which page of the PDF the player object 
> is displaying.  The end result is to convert a single PDF to multiple PNG's 
> or JPEG's.  Suggestions?  Thanks!!!
> ___
> 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: Page 2 of a PDF

2013-04-04 Thread Andrew Kluthe
I was calling imagemagick and ghost script for a while to do this from the
shell, but recently start using VeryPDF's proprietary solution for doing
this from a command line to save on filesize when I bundle it.


On Thu, Apr 4, 2013 at 2:35 PM, Ray Horsley  wrote:

> I believe this has come up before but don't I see any way to convert page
> 2, page 3, etc. of a PDF to a PNG or JPEG via snapshot using either
> revBrowser or a player object.  A browser object doesn't seem to display a
> specified page at all, and while I can manually scroll through a PDF using
> a player object I can't control from a script which page of the PDF the
> player object is displaying.  The end result is to convert a single PDF to
> multiple PNG's or JPEG's.  Suggestions?  Thanks!!!
> ___
> 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
>



-- 
Regards,

Andrew Kluthe
and...@ctech.me
___
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


Page 2 of a PDF

2013-04-04 Thread Ray Horsley
I believe this has come up before but don't I see any way to convert page 2, 
page 3, etc. of a PDF to a PNG or JPEG via snapshot using either revBrowser or 
a player object.  A browser object doesn't seem to display a specified page at 
all, and while I can manually scroll through a PDF using a player object I 
can't control from a script which page of the PDF the player object is 
displaying.  The end result is to convert a single PDF to multiple PNG's or 
JPEG's.  Suggestions?  Thanks!!!
___
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