pdf: Add Qt PDF examples

This commit is contained in:
Rick Calixte 2025-04-20 13:15:14 -04:00
parent c43c65ee2a
commit fdb15300e8
No known key found for this signature in database
6 changed files with 54 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,27 @@
package main
import (
"os"
"github.com/mappu/miqt/qt"
"github.com/mappu/miqt/qt/pdf"
)
func main() {
qt.NewQApplication(os.Args)
d := pdf.NewQPdfDocument()
d.Load("example.pdf")
p := pdf.NewQPdfView2()
p.SetWindowTitle("Qt 5 PDF Example")
p.SetMinimumSize2(650, 600)
p.SetPageMode(pdf.QPdfView__MultiPage)
p.SetZoomMode(pdf.QPdfView__FitInView)
p.SetDocument(d)
p.Show()
qt.QApplication_Exec()
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

View File

@ -0,0 +1,27 @@
package main
import (
"os"
qt "github.com/mappu/miqt/qt6"
"github.com/mappu/miqt/qt6/pdf"
)
func main() {
qt.NewQApplication(os.Args)
d := pdf.NewQPdfDocument()
d.Load("example.pdf")
p := pdf.NewQPdfView2()
p.SetWindowTitle("Qt 6 PDF Example")
p.SetMinimumSize2(650, 600)
p.SetPageMode(pdf.QPdfView__MultiPage)
p.SetZoomMode(pdf.QPdfView__FitInView)
p.SetDocument(d)
p.Show()
qt.QApplication_Exec()
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB