Is it possible to create/generate a PDF file from an existing text file using Infragistics.Documents.PDF.PdfDocument? If not, how do you use the 'PdfDocument' class to create a new PDF file? I am able to add a page and generate a PDF file, but don't know how to write text to it? I am using VB.NET 2008
Dim PDF As New Infragistics.Documents.PDF.PdfDocument
The best thing to do in this case is study the documentation:
Placing text from a file should be fairly easy because reading a text file into a string variable is well documented all over the web. Then after you read the text into the variable, add it to the document like this help article suggests.
Thanks for the reply. However, the examples and documentation you have specified are using the ReportDocument. I don't want to create a report or have anything to do with a report. In VB6 you could do something like "Printer.Print [some text]". This is kind of what I am after, but being able to add the data I want to print to a PDF document. For example, the bold line below is what I am trying to accomplish/find:
Dim PDF As New PdfDocumentWith PDF .AddPage()
.AddText([The text to add], [XLocation to print the text], [YLocation to print the text], [Font to print the text in])
.Generate([some file location/name])End With
The links that were provided are a good resource for doing this. You should take a look at the samples that are provided with the SDK, specifically the "Text" region within the Documents SamplesGallery. I'm not sure why you need direct access to the PdfDocument class though. As far as I can generally see with this class, you shouldn't really ever need to directly deal with it. You should always be dealing with the report object itself, then call "Publish", passing in the file name and the format (PDF).