PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sat Apr 27, 2024 11:22 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Aug 08, 2008 1:24 pm 
Offline

Joined: Thu Aug 07, 2008 6:57 pm
Posts: 1
Location: NY, USA
I am using a function like the one below to expose a pdf as a stream. PDFDoc is a PdfDocument object that was opened using a file-path pointing to a PDF created by Crystal Reports 2008. In debug mode everything works fine, but at runtime the Pages collection is null so the save operation fails. It seems like a stream buffer needs to be flushed. Am I doing something wrong?

Code:
public override System.IO.Stream GetData()
{
   System.IO.Stream pStream;
   System.IO.MemoryStream mStream;
   
   if (IsOpen)
   {
      mStream = new System.IO.MemoryStream();
      pStream = (System.IO.Stream)mStream;

      PDFDoc.Save(pStream,false);
            
      return pStream;
   }

   return null;
}


TIA,

Using PdfSharp 1.2.1269

_________________
Brian


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 399 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