Create pdf which contain multiple layout in C#

Create pdf which contain multiple layout in C#

Anonymous
Not applicable
1,581 Views
4 Replies
Message 1 of 5

Create pdf which contain multiple layout in C#

Anonymous
Not applicable

Hello

 

I am trying to create pdf which contain all open layout sheet in C#

I have tried multiple solution but not getting output.

please help me

Thank you

0 Likes
1,582 Views
4 Replies
Replies (4)
Message 2 of 5

_gile
Consultant
Consultant

Hi,

 

You can try this one:

http://www.theswamp.org/index.php?topic=31897.msg494504#msg494504



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 5

Anonymous
Not applicable

Thank you ,

I have referred your code in the link but at plotter.publish(); it throw an exception as (Inner exception:-> Operation is not valid due to the current state of objects. message:->exception has been thrown by the target of invocation.)

 

I have attached 2 screenshot to show where is exact exception thrown.

 1.png

 

2.png

 

0 Likes
Message 4 of 5

Anonymous
Not applicable

Hello

 

still I have not found any solution to plot open sheet into single pdf.

 

please help me to get it done.

 

Thank you.

0 Likes
Message 5 of 5

waseefur.rahman
Advocate
Advocate

Hi,

Just by sending the command in Command line, all layout will be created in PDF.

Try below code:

Public ReadOnly Property ThisDrawing() As AcadDocument  ' This is neccesary to use the VBA commands
Get
Return Autodesk.AutoCAD.ApplicationServices.DocumentExtension.GetAcadDocument(Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument)
End Get
End Property



ThisDrawing.Save()
ThisDrawing.SendCommand("FILEDIA" + vbCr & "0" + vbCr)
ThisDrawing.SendCommand("-EXPORT" & vbCr & "PDF" & vbCr & "ALL" & vbCr & "D:\" & vbCr)
ThisDrawing.SendCommand("FILEDIA" + vbCr & "1" + vbCr)

Thanks

0 Likes