1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Dim TempPathOfXPS As String
Dim packageUri As New Uri("memorystream:/Document.xps")
Dim xpsStream As Stream
Dim package__1 As Package
Dim xpsDoc As XpsDocument
Private Sub LoadXPSDoc(ByVal FilePath As String)
TempPathOfXPS = FilePath
xpsStream = File.OpenRead(FilePath)
package__1 = Package.Open(xpsStream, FileMode.Open, FileAccess.Read)
'Add package to PackageStore
PackageStore.AddPackage(packageUri, package__1)
xpsDoc = New XpsDocument(package__1, CompressionOption.SuperFast, packageUri.ToString)
Dim docReference As DocumentReference = xpsDoc.GetFixedDocumentSequence().References.First
DocumentViewer1.Document = docReference.GetDocument(False)
' PackageStore.RemovePackage(packageUri)
End Sub |
Partager