Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Jul 08, 2020 11:40 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Copying part of a PDF (using EditableMovie)
PostPosted: Sun Jan 17, 2010 8:51 pm 
Offline

Joined: Wed Jan 25, 2006 11:29 am
Posts: 39
Location: Lexington, KY
I can't figure out why this is not working.... running the following code copies the entire PDF file.... no matter what position I am in from the original.....
Dim emCopy As New EditableMovie
Dim f As FolderItem
Dim track As QTVideoTrack
Dim r As Boolean

f = SpecialFolder.Desktop.Child("TestCopy.pdf")
emCopy = f.CreateMovie()
track = emCopy.NewVideoTrack(em.BaseMovieWidth, em.BaseMovieHeight, em.TimeScale, empagelen)
track.AppendVideoTrackSegment(em.VideoTrack(1), MovieView.Position, (em.Duration - MovieView.Position), True, False)


em is an EditableMovie containing the original PDF

_________________
Tim Forshee
Bluegrass Digital Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: Copying part of a PDF (using EditableMovie)
PostPosted: Sun Jan 17, 2010 10:16 pm 
Offline
User avatar

Joined: Sat Apr 04, 2009 5:10 pm
Posts: 954
Quote:
I can't figure out why this is not working


What exactly is 'this'? Or what exactly does not work?

_________________
Mac OS X 10.5.8/REALBasic 2008 R5.1 ~ REALBasic 2009 R4
--------------------------------------------------
Please don't use my topics in order to advertise your plug-ins.
Watch out for European spammers who try to sell plug-ins you don't even need.


Last edited by rbasic20091005153 on Mon Jan 18, 2010 8:55 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Copying part of a PDF (using EditableMovie)
PostPosted: Mon Jan 18, 2010 10:36 am 
Offline

Joined: Wed Jan 25, 2006 11:29 am
Posts: 39
Location: Lexington, KY
the code that I pasted does not work....

As the Subject states, I am trying to copy part of a PDF file.... but the code I pasted copies the entire PDF file... not just the part starting at em.Position (em is being viewed via MovieView... so em.Position and MovieView.Position are equal in my code)

_________________
Tim Forshee
Bluegrass Digital Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: Copying part of a PDF (using EditableMovie)
PostPosted: Mon Jan 18, 2010 2:49 pm 
Offline
User avatar

Joined: Wed Nov 15, 2006 3:50 pm
Posts: 2353
Location: England
um... I know I will regret asking this question (bring on the flames) but...
When did PDF files become movies?
What does movieview.position mean in the context of a document comprising some pages with embedded text and/or images?

Im astonished that this code does anything at all.
Is it just reading in a PDF to memory, then writing out the same buffer?


Top
 Profile  
Reply with quote  
 Post subject: Re: Copying part of a PDF (using EditableMovie)
PostPosted: Mon Jan 18, 2010 3:04 pm 
Offline

Joined: Wed Jan 25, 2006 11:29 am
Posts: 39
Location: Lexington, KY
You can view PDF files in MoviePlayer... including multi-page ones.... my program currently loads a PDF and allows a user to page through it....

No different than a movie.... a PDF file contains 'frames' - a movie just typically goes through them very quickly... when someone looks at a PDF, they traverse the pages slowly.... I am not saying that PDFs ARE physically just movies... I know they are not.... BUT... MoviePlayer does allow you to act on them as if they were.


I am looking for help on how to successfully copy part of an EditableMovie to a new file.... I assume that the process will work with PDFs...

Yes, my code reads the PDF into variable em, tries to create a new PDF (emCopy) and append part of em to emCopy

Again, em and emCopy are EditableMovie's

_________________
Tim Forshee
Bluegrass Digital Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: Copying part of a PDF (using EditableMovie)
PostPosted: Mon Jan 18, 2010 5:25 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
jefftullin wrote:
um... I know I will regret asking this question (bring on the flames) but...
When did PDF files become movies?

They aren't
It just happens to be that QuickTime on OS X can open them and the movieplayer uses QuickTime

jefftullin wrote:
What does movieview.position mean in the context of a document comprising some pages with embedded text and/or images?

Which page you're on

jefftullin wrote:
Im astonished that this code does anything at all.
Is it just reading in a PDF to memory, then writing out the same buffer?

I'm not surprised at all
I've had code posted on my web site that lets you use a movieplayer, on OS X, to show a PDF
That's been possible for years

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Copying part of a PDF (using EditableMovie)
PostPosted: Mon Jan 18, 2010 5:31 pm 
Offline
User avatar

Joined: Wed Nov 15, 2006 3:50 pm
Posts: 2353
Location: England
Every day is a school day.


Top
 Profile  
Reply with quote  
 Post subject: Re: Copying part of a PDF (using EditableMovie)
PostPosted: Mon Jan 18, 2010 5:57 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
tj4shee wrote:
You can view PDF files in MoviePlayer... including multi-page ones.... my program currently loads a PDF and allows a user to page through it....

No different than a movie.... a PDF file contains 'frames' - a movie just typically goes through them very quickly... when someone looks at a PDF, they traverse the pages slowly.... I am not saying that PDFs ARE physically just movies... I know they are not.... BUT... MoviePlayer does allow you to act on them as if they were.


I am looking for help on how to successfully copy part of an EditableMovie to a new file.... I assume that the process will work with PDFs...

Yes, my code reads the PDF into variable em, tries to create a new PDF (emCopy) and append part of em to emCopy

Again, em and emCopy are EditableMovie's


I'm just not certain that using quicktime you can create a PDF this way
I think it's read only when you do this and you cant output a PDF from this mechanism

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Copying part of a PDF (using EditableMovie)
PostPosted: Mon Jan 18, 2010 7:00 pm 
Offline

Joined: Wed Jan 25, 2006 11:29 am
Posts: 39
Location: Lexington, KY
I was guessing that would be the answer.... but had hopes maybe it wouldn't be.... :D

The more I think about it the more I convince myself of just what you are saying.... that it will display PDFs but it does not have the ability to create new ones..... hence the result of just making a copy of the entire PDF.

_________________
Tim Forshee
Bluegrass Digital Inc.


Top
 Profile  
Reply with quote  
 Post subject: Re: Copying part of a PDF (using EditableMovie)
PostPosted: Mon Jan 18, 2010 8:02 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
yeah
everything on Apple's web site leads me to believe that using QuickTime this was y is a one way street
you can read them but not write them

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Copying part of a PDF (using EditableMovie)
PostPosted: Tue Jan 19, 2010 4:52 pm 
Offline

Joined: Fri Nov 16, 2007 10:18 pm
Posts: 195
Location: Portland, OR
Couldn't you just paste the frames on a new graphics object and save it out as a new pdf?

_________________
Windows: Win7 64bit sp1, Vista 32bit sp2, WinXP 32bit SP3
Linux: RH EL6
Mac: Died in 2011 and took 2 months to notice.

RealStudio: 2012r2


Top
 Profile  
Reply with quote  
 Post subject: Re: Copying part of a PDF (using EditableMovie)
PostPosted: Tue Jan 19, 2010 5:29 pm 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
see the first post in this thread - that copies the entire PDF

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group