Hi Everyone,
Help please. Editing an iPad app in Xojo 2025 r1.1. I paste the following example code (below) directly out of the Xojo PDFDocument documentation into the iPad app, and a compiler error results on build (below). I’ve looked everywhere for a solution and tried a dozen different things… any insight would be appreciated.
Var pdf As New PDFDocument
Var g As Graphics = pdf.Graphics
g.PenSize = 1
g.DrawLine(0, 0, 0, 324)
g.DrawLine(0, 324, g.Width, 324)
Var r As New Random
Var startX As Integer = 1
Var colors() As Color
Var bars() As Integer
If colors.LastIndex = -1 Then
For n As Integer = 0 To 5
colors.Add(Color.RGB(r.InRange(0, 255), r.InRange(0, 255), r.InRange(0, 255)))
bars.Add(r.InRange(325 * 0.1, 325 - 325 * 0.2))
Next
End If
Var barWidth As Integer = g.Width / 6 * 0.8
Var spaceBetween As Integer = g.Width / 6 * 0.2
For n As Integer = 0 To 5
g.DrawingColor = colors(n)
g.FillRectangle(startX, 325 - bars(n), barWidth, bars(n) - 1)
startX = startX + barWidth + spaceBetween
Next
Var f As FolderItem = SpecialFolder.Documents.Child(“Barchart.pdf”)
pdf.Save(f)
** Build error:
Parameter “f” expects class FolderItem, but this is class Xojo.IO.FolderItem.
How do I satisfy the compiler so that it will save this pdf?