PDFsharp & MigraDoc Foundation

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

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: Tue May 04, 2010 1:50 am 
Offline

Joined: Tue May 04, 2010 1:39 am
Posts: 1
I have a code that runs ok in VS2008, it concatenates documents gererated on the fly from rdlc files, and if the document page count was odd, then the code concatenates a blank page (this is for duplex printing).

I just migrates to framework 4.0, the document are created, with the same file size, but the pages are blank when yuo open them in Adobe Reader.

this is the method code :

Code:

    PdfDocument consolidado;

    private void ConcatenaInforme(byte[] pdfAlumno)
    {
        PdfDocument original;

        MemoryStream s = new MemoryStream(pdfAlumno);
        original = PdfReader.Open(s, PdfDocumentOpenMode.Import);
       
        int cnt = original.PageCount;
        for (int idx = 0; idx < cnt; idx++)
        {
            PdfPage pagina = original.Pages[idx];
            consolidado.AddPage(pagina);
        }
       
        if ( original.PageCount % 2 != 0 )
        {
            PdfPage page = new PdfPage();
            consolidado.AddPage(page);
        }
    }

    private void GrabaInforme()
    {
        if (consolidado.PageCount > 0)
        {
            consolidado.Save(HttpContext.Current.Server.MapPath("~/") + @"\Boletines\Boletin_Grado_" + gsGrado.Trim() + "_Periodo_" + gsPeriodo + ".pdf");
        }   
    }



Someone can herlp me?

Regards,


Mauricio Atanache G.


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: Google [Bot] and 344 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