PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Aug 18, 2017 8:19 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: RTF/PDF/DDL to XPS?
PostPosted: Wed Jun 21, 2017 8:16 am 
Offline

Joined: Tue Apr 26, 2016 8:24 pm
Posts: 14
Hello everyone,

It is possible to transform RTF/PDF/DDL to XPS with migradoc? (or any free tool out there?)

Or migradoc Document to FixedDocument?

I want to change to a fixed document or xps to be able to use all document viewer functions, such as search and go to bookmark.


Top
 Profile  
Reply with quote  
 Post subject: Re: RTF/PDF/DDL to XPS?
PostPosted: Wed Jun 21, 2017 9:47 am 
Offline
empira Employee
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 2689
Location: Cologne, Germany
Hi!

MigraDoc does not have an XPS renderer yet. Neither is there a FixedDocument renderer.

There are no MigraDoc importers for RTF or PDF yet.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject: Re: RTF/PDF/DDL to XPS?
PostPosted: Mon Jun 26, 2017 5:24 pm 
Offline

Joined: Tue Apr 26, 2016 8:24 pm
Posts: 14
Thank you Thomas, I actually managed to convert the document to FixedDocument, that allows me to search into the document. I will post it maybe it will be useful for someone

Preview.Ddl = Convert.ToString(e.NewValue);

var fixedDocument = (FixedDocument)Preview.Viewer.Document;

// Set up fresh XpsDocument
var stream = new MemoryStream();
var uri = new Uri("pack://document.xps", UriKind.Absolute);
var package = Package.Open(stream, FileMode.Create, FileAccess.ReadWrite);
PackageStore.AddPackage(uri, package);
var xpsDoc = new XpsDocument(package, CompressionOption.SuperFast, uri.AbsoluteUri);

// Write FixedDocument to the XpsDocument
var docWriter = XpsDocument.CreateXpsDocumentWriter(xpsDoc);
docWriter.Write(fixedDocument);

FixedDocumentSequence document = xpsDoc.GetFixedDocumentSequence();

// Display XpsDocument in DocumentViewer
Preview.Viewer.Document =document;

Thomas Hoevel wrote:
Hi!

MigraDoc does not have an XPS renderer yet. Neither is there a FixedDocument renderer.

There are no MigraDoc importers for RTF or PDF yet.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], williams3, Yahoo [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group