Hi all,
I'm new to this pdfsharp library and I want to use it to create my own pdf's in Delphi
For storing pdf's in my database I want to save the pdf as a stream.
For Delphi there is a function in the document object to store the pdf to a _stream. (document.save_2(astream,false))
However the stream for this function must be of the type _stream.
How can a convert this _stream to a "normal" TMemorystream.
Thanks in advance
Here is some code I tried
Code:
FFont.Name:='Arial' ;
FFont.Size:=12;
AppDomainManager := GetAppDomainManager as _CustomAppDomainManager;
Document := AppDomainManager.CreatePdfDocument;
Page := Document.AddPage;
Page.size:=PageSize_A4;
Page.Orientation:=PageOrientation_Portrait;
TempFontStyle:=0;
XFont:= AppDomainManager.CreateXFontClass.XFont_2(FFont.Name, FFont.Size, TempFontStyle);
XBrush := AppDomainManager.CreateXBrushesClass.Black.XBrush;
Graphics := AppDomainManager.CreateXGraphicsClass.FromPdfPage(Page);
Point._x:=0;
Point._y:=0;
Graphics.DrawString(text,XFont,XBrush,Point);
Document.Save_2(astream,true);