[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

How to use X++ code to create a PDF file ?

Dave

11/8/2005 4:05:00 AM

Hi All,
Now I have to read a MS word file and export it
to PDF file !
So, I examine the PDFViewer class, but don't know how to begin (I must call
which method, in which order to achieve a PDF file ?).
and I try to create an instance of the PDFViewer class :
public void new(PrintJobHeader _jobsCursor, PrintJobPages _pagesCursor)
but I cannot know where to achieve the PrintJobHeader class/object and
PrintJobPages class/object.
1 Answer

Dave

11/8/2005 4:15:00 AM

0

in the main() method of PDFViewer, I tried :
PDFViewer pdf = new PDFViewer(null, null);
TextBuffer tb = new TextBuffer();
int catalogObj, infoObj;
int xrefOffset;

pdf.writePDFHeader(tb.getText());

catalogObj = pdf.writePDFCatalog(tb);

infoObj = pdf.writePDFInfoObject('From Job', 'PV', 'Test');
xrefOffset = pdf.writePDFXref();
pdf.writePDFTrailer();

pdf.writePDFStartXRef(xrefOffset);
tb = pdf.buf();

tb.toFile('c:\\ttt1.pdf');

the buf() method is my method added to get the buffer. But it doesn't work,
have any advise ??