PDA

View Full Version : Save as PDF returns a blank page with file size 954


delmonk
September 22, 2004, 19:56:11
I have txt control 11 with service pack 1 installed

When I call this code

tx.Load("C:\\183D83DC-8C03-4df6-8DEB-F8B8B777627A.DOC", COleVariant(long(0)), COleVariant(long(9)),COleVariant(long(1)));
tx.SetViewMode(1);
tx.Save("c:\\183D83DC-8C03-4df6-8DEB-F8B8B777627A.PDF", COleVariant(long(0)), COleVariant(long(12)),COleVariant(long(0)));


The size of the file that is saved is 954 and it is a blank pdf file when I open it.
Why is that? I am able to convert it successfully if I open it in TX text control words and export it as pdf.

delmonk
September 23, 2004, 03:20:12
Ok I have that figured out the doc file was actually an rtf file with a doc extension so it couldn't convert it correctly to pdf.

I now have another problem. With the same code, after I do a save all the headers and footers are missing in the pdf.

Björn Meyer
September 23, 2004, 13:16:49
Hello

Did you set the ViewMode to at least 1?

delmonk
September 23, 2004, 18:13:56
I have tried setting the view mode to 1 or 2. Same result, generated pdf has no headers or footers.

Björn Meyer
September 24, 2004, 10:26:32
tx.SetViewMode(1);
tx.Load("C:\\183D83DC-8C03-4df6-8DEB-F8B8B777627A.DOC", COleVariant(long(0)), COleVariant(long(9)),COleVariant(long(1)));
tx.Save("c:\\183D83DC-8C03-4df6-8DEB-F8B8B777627A.PDF", COleVariant(long(0)), COleVariant(long(12)),COleVariant(long(0)));


The ViewMode must be set before loading the document.