I'm trying to display a PDF in the PDFView with the following features:
- Display 2 pages side-by-side while the iPhone in the portrait mode
- Fit the width to snap to the vertical edges of the screen
- Support RTL direction. (swipe from left to right to display next couple of pages it's an Arabic PDF)
- The page on the right is the first page and the left one is the second (again, Arabic PDF)
That's the code I tried and didn't achieve anything
struct PDFViewRep: UIViewRepresentable {
func makeUIView(context: Context) -> UIView {
let pdfView = PDFView()
pdfView.document = Bundle.main.url(forResource: "file", withExtension: "pdf")!
pdfView.displayMode = .twoUpContinuous
pdfView.displayDirection = .horizontal
pdfView.displayRTL = true
return pdfView
}
func updateUIView(_ uiView: UIView, context: Context) {}
}
struct MainView: View {
var body: some View {
PDFViewRep()
}
}
Can anyone help?