PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Apr 28, 2024 3:06 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Oct 14, 2015 7:59 am 
Offline

Joined: Wed Oct 14, 2015 7:07 am
Posts: 2
I used DocumentPreview to view generated document in Preview Mode. Even-though i have more than one pages scroll bar is not enabled.I can scroll the pages using mouse but i need scroll bar to view all the pages.Please help. :(


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 14, 2015 8:22 am 
Offline
PDFsharp Guru
User avatar

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

Scrollbars are enabled and working in our application. So there must be a problem with your code.

Please provide an SSCCE.
See also:
viewtopic.php?f=2&t=832

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 15, 2015 5:06 am 
Offline

Joined: Wed Oct 14, 2015 7:07 am
Posts: 2
Hi,
My sample code is here .I have added the dll based on GDI+( PDFsharp + MigraDoc) Version is 1.32.4334 .Please finds the image as well. If I did anything wrong please let me know am new to migradoc. :(

Code:
//Button click

private void button1_Click(object sender, EventArgs e)
        {
            Document document1 = new Document();

            document1=CreateDocument();
            string ddl = MigraDoc.DocumentObjectModel.IO.DdlWriter.WriteToString(document1);
            documentPreview1.Ddl = ddl;
         }

//Create Document Method

public static Document CreateDocument()
        {

            Document document = new Document();
            Section section = document.AddSection();
            section.PageSetup.TopMargin = 25;
            section.PageSetup.LeftMargin = 25;
            section.PageSetup.RightMargin = 25;
           
            section.PageSetup.PageFormat = PageFormat.A4;
            Paragraph paragraph = section.AddParagraph();
            paragraph.Format.Font.Color = MigraDoc.DocumentObjectModel.Color.FromCmyk(100, 30, 20, 50);
            Table envTable = new Table();
            envTable = section.AddTable();
            Row row = new Row();
            Column column = envTable.AddColumn("7.0cm");
            row = envTable.AddRow();
            row.Borders.Color = Colors.LightGray;
            row.Format.Font.Bold = true;
            row.Format.Font.Size = 12;
            row.Format.Alignment = ParagraphAlignment.Center;
            row.VerticalAlignment = VerticalAlignment.Center;
            row.Height = "1cm";
            row.Cells[0].AddParagraph("Sample Field");
            row.Cells[0].Format.Alignment = ParagraphAlignment.Left;
            row.Cells[0].Borders.Right.Visible = true;

            for (int i = 0; i < 60; i++)
            {
                row = new Row();
                row = envTable.AddRow();
                row.Borders.Color = Colors.LightGray;
                row.Format.Alignment = ParagraphAlignment.Center;
                row.VerticalAlignment = VerticalAlignment.Center;
                row.TopPadding = 4;
                row.Cells[0].AddParagraph("Test1- "+i.ToString());
                row.Cells[0].Format.Alignment = ParagraphAlignment.Left;
                row.Cells[0].Borders.Right.Visible = true;
            }
           
             return document;
        }


Attachments:
withoutscrollbar.jpg
withoutscrollbar.jpg [ 137.96 KiB | Viewed 4923 times ]
Top
 Profile  
Reply with quote  
PostPosted: Thu Oct 15, 2015 6:19 am 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 340
Hi!
karth wrote:
My sample code is here.
Just a code snippet that leaves out the relevant parts (e.g. the file maintained by the designer).

A working sample is this:
http://pdfsharp.net/wiki/DocumentViewer-sample.ashx

Sample source code included with the source package of MigraDoc.
Take that as a starting point and make sure you do not lose the scroll bar functionality.

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


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

All times are UTC


Who is online

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