Profile Picture

Diagram PDF Export

Posted By Dieter Schulten 11 Years Ago
Author
Message
Dieter Schulten
Posted 11 Years Ago
View Quick Profile
Junior Member

Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)

Group: Forum Members
Last Active: 9 Years Ago
Posts: 10, Visits: 2
Hello, i am looking for the correct way to export a diagram.

As far is i know, there is a "NPdfExporter" which can be used to export a diagram to PDF.

NPdfExporter pdfExporter = new NPdfExporter(documment);
pdfExporter.CompressContents = true;
pdfExporter.Resolution = 300;
pdfExporter.PageSize = new NSizeF(documment.Width, documment.Height);
pdfExporter.PageColumns = 1;
pdfExporter.PageRows = 1;
pdfExporter.ZoomPercent = 100;
pdfExporter.Layout = PagedLayout.ZoomTo;

If i am using this kind of code, the exported PDF has more pages, the the diagram i see in the NDrawingView.
Maybe i don't understand the relationship between the "NDrawingDocument" showing in the "NDrawingView"
and the epxorted PDF.

What i want to do is pretty simple. If want the user to click a button in my application.
After the user has clicked the button a "A4" NDrawingDocument should be created.
This NDrawingDocument should have one single page in the NDrawingView.

If the user clicks on another button, the "A4 NDrawingDocument" should be saved as
a "A4 PDF Document"

In the attached Screenshot you can see, that the "PDF Export" has 16 Pages (I DON'T KNOW WHY).

In the other Screenshot you can see, that the "Exported PDF Page Size" is "74,1 x 104,8 mm" (I DON'T KNOW WHY).

Hopefully you can give me further information.

Kind Regards, Dieter

PS: Do you already have a Release Date for the "Nevron Diagram 2013.1"


Attachments
Screenshot.png (183 views, 27.00 KB)
Screenshot2.png (180 views, 15.00 KB)
Dieter Schulten
Posted 11 Years Ago
View Quick Profile
Junior Member

Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)

Group: Forum Members
Last Active: 9 Years Ago
Posts: 10, Visits: 2
Hello,

do you have any information on this topic.
It is important to us, to have s pdf export.

In your documentation i can not find any information about the pdf export.
Maybe the information is there, but i can't find it.

What are the relationships between a PDF Page (A4) and a NDrawingDocument?

It would be nice, if you could provide further information on the pdf export.

I need the functionality to enable the user to create a new document.
The user needs to selects the page format, like A4.
After this, the user can create his diagram.
The application will show a A4 document wihtin the application.
The PDF export needs to look excaclty like the document in the screen.

Thanks for your help.

Dieter

Dieter Schulten
Posted 11 Years Ago
View Quick Profile
Junior Member

Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)Junior Member (10 reputation)

Group: Forum Members
Last Active: 9 Years Ago
Posts: 10, Visits: 2
Dear Nevron Team,

it would be nice to get a hint to solve the topic.
If it is NOT POSSIBLE, please let me know.

Kind Regards, Dieter

Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

A little clarification about PDF export.

First the PageSize of NPdfExporter is specified in points, while the NDrawingDocument Width and Height are by default in pixels (but can virtually be in any measurement unit)
- see Diagram for .NET > User's Guide > Document Object Model > Drawing Documents - Measurement Units and Drawing Scale for complete discussion.

So the first thing would be to calculate a PDF page size that is equal to the drawing document Width and Height.
Then there is the Layout property which can be of the following values:

ZoomTo - Zooms the drawing to a user defined zoom percent. Aspect is preserved.
The pages grid is automatically determined. This means that the PageColumns and PageRows are not used when this layout mode is effective.

FitToPages - User selects PageColumns and PageRows count. Zoom is automatically determined.
Aspect is preserved. This means that ZoomFactor is not used when FitToPages is effective.

FitToPagesWidth - User selects PageColumns count.
The number of pages in rows and zoom is automatically determined. ZoomPercent is used. Aspect is preserved.

FitToPagesHeight - User selects PageRows count.
The number of pages in cols and zoom is automatically determined. ZoomPercent is used. Aspect is preserved.

If you simply want to display a drawing document in a single PDF page - you need to use this code:

pdfExporter.Layout = PageLayout.FitToPages;
pdfExporter.PageSize = new NSizeF(595, 842); // A4 size in points
pdfExporter.PageColumns = 1;
pdfExporter.PageRows = 1;

If you want to create a drawing document in A4 format you can use this code:

drawingDocument.MeasurementUnit = Nevron.GraphicsCore.NGraphicsUnit.Point;
drawingDocument.Width = 595;
drawingDocument.Height = 842;

Hope this helps - questions or comments - please feel free...


 



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic