Platforms to show: All Mac Windows Linux Cross-Platform

/MacOSX/CoreGraphics PDF/Show PDF
Feedback.

Function:
You find this example project in your Plugins Download as a Realbasic project file within the examples folder: /MacOSX/CoreGraphics PDF/Show PDF
This example is the version from Mon, 13th Mar 2005.
Notes: Last modified: Mon, 13th Mar 2005
Class Window1
Inherits Window
// Properties
Protected Dim pdf as CGPDFDocumentMBS

// Event implementations
Sub DropObject(obj As DragItem)
do
if obj.FolderItemAvailable then
openfile obj.FolderItem
end if
loop until not obj.NextItem
End Sub
Sub Paint(g As Graphics)
dim r as CGRectMBS

if pdf<>nil then
// if you do not use the mediabox, you can strech the pdf
r=pdf.MediaBox(1)
r.Left=r.Left+100 // move
r.top=r.top+100
'r.Width=r.Width*5 // Scaling?
'r.Height=r.Height*5
g.DrawCGPDFDocumentMBS pdf,r,1
end if
End Sub
Sub Open()
me.AcceptFileDrop "special/any"
End Sub

// Methods
Sub openfile(f as folderItem)
dim p as CGPDFDocumentMBS

if f<>Nil then
p=CGOpenPDFDocumentMBS(F)

if p<>nil then
pdf=p
Refresh
else
MsgBox "Failed to open PDF file!"
end if
end if
End Sub
End Class

Class App
Inherits Application
End Class


See also:




Links
MBS REAL studio Chart Plugins - Besuchen Sie die JUZ Nickenich Webseite