Platforms to show: All Mac Windows Linux Cross-Platform
/PDFlib/pdflib lite hello with image
Feedback.
Function:
You find this example project in your Plugins Download as a Realbasic project file within the examples folder: /PDFlib/pdflib lite hello with image
This example is the version from Fri, 25th Feb 2010.
Notes: Last modified: Fri, 25th Feb 2010
Feedback.
Function:
You find this example project in your Plugins Download as a Realbasic project file within the examples folder: /PDFlib/pdflib lite hello with image
This example is the version from Fri, 25th Feb 2010.
Notes: Last modified: Fri, 25th Feb 2010
Class App
Inherits Application
// Event implementations
Sub Open()
dim p as PDFLibLiteMBS
dim n as integer
dim fonthandle as integer
dim f as folderItem
dim img,e as integer
dim filename as String
if not PDFLibLiteMBS.APIloaded then
MsgBox "no static lib!?"
quit
end if
p=new PDFLibLiteMBS
// on Linux and Mac OS MachO you may need to search to find this file
// so use non relative file pathes there.
filename="hello "+p.PluginName+".pdf"
f=GetFolderItem(filename)
p.SetParameter("compatibility", "1.4") // for compatibility to older and newer Acrobat Readers.
n=p.openFile(f)
if n<0 then
quit
else
p.setinfo "Creator","Realbasic test application"
p.setinfo "Author", "Christian Schmitz"
p.setinfo "Title","Hello World (RB)"
p.beginPage 500,500
fonthandle = p.FindFont("Helvetica-Bold","host",0)
p.setfont fonthandle,24
p.settextpos 50,400
p.show "Hello World!"
p.continueText "(says Realbasic)"
p.continueText "PDFlib: "+str(p.GetValue("major",0))+"."+str(p.GetValue("minor",0))+"."+str(p.GetValue("revision",0))
p.continueText p.pluginname
img=p.LoadImage("auto",getfolderitem("mbs.jpg"),"")
if img=-1 then
MsgBox "Failed to load mbs.jpg file."
else
p.FitImage img, 100,100,""
end if
p.endpage
// second page with a lot of fonts...
p.beginPage 500,500
fonthandle=p.FindFont("Helvetica-Bold","host",0)
p.setfont fonthandle,24
p.settextpos 50,400
p.show "Hello World!"
p.continueText "(says Realbasic)"
fonthandle=p.FindFont("Helvetica","host",0)
p.setfont fonthandle,14
p.settextpos 50,220
p.show "Helvetica"
fonthandle=p.FindFont("Helvetica-Bold","host",0)
p.setfont fonthandle,14
p.settextpos 50,200
p.show "Helvetica-Bold"
fonthandle=p.FindFont("Helvetica-Oblique","host",0)
p.setfont fonthandle,14
p.settextpos 50,180
p.show "Helvetica-Oblique"
p.endpage
p.close
end if
p=nil
f.Launch
quit
Exception ex as PDFLibLiteExceptionMBS
MsgBox "PDF Lib Exception: "+ex.ErrorMessage+" ("+str(ex.ErrorNumber)+", "+ex.FunctionName+")"
quit
End Sub
End Class
See also:
Links
MBS Realbasic Chart Plugins - Förderverein St. Arnulf Nickenich