PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Jul 15, 2024 10:10 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Aug 28, 2012 2:13 am 
Offline

Joined: Tue Aug 28, 2012 1:59 am
Posts: 1
Hello,

I'm trying to use PDFsharp and MigraDoc on the Windows Azure platform. Has anyone been able to successfully do this? I've been investigating how to use it with Blob Storage, but have been unsuccessful so far. I have code that works on my local machine just off my c drive.

string filename = "MixMigraDocAndPdfSharpCG.pdf";
Document doc = new Document();
...
PdfDocumentRenderer renderer = new PdfDocumentRenderer(true, PdfSharp.Pdf.PdfFontEmbedding.Always);
renderer.Document = doc;
renderer.RenderDocument();
renderer.PdfDocument.Save(filename);

However with Azure I have to work through the methods specified here http://www.windowsazure.com/en-us/devel ... b-storage/ and cannot save files locally, but instead want to save them directly to the cloud. Is there a way to do this?

Thanks.


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 28, 2012 8:17 am 
Offline
PDFsharp Guru
User avatar

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

I'm not familiar with Azure, but PDFsharp allows you to save the PDF in a stream (instead of a file). And you can get a byte[] from that stream.

There should be solutions to save streams and byte[] to Azure blobs.

The Clock sample is for PDFsharp, not MigraDoc, but it shows how to use MemoryStream (and the MigraDoc PdfDocumentRenderer exposes a PDFsharp PDFdocument object):
http://www.pdfsharp.net/wiki/Clock-sample.ashx

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 38 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:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group