Free Support Forum - aspose.com

DOC to PDF shows $TAB

Hello, I'm having a problem with converting a mailmerged word doc to a PDF. Here is my code (vb.net)...

dim fn(0) as string
dim vn(0) as string
dim wd as word.document
dim ms as memorystream
dim xmlDoc as XmlDocument
dim p as pdf.pdf

fn(0) = "[[MAILTAG]]"
vn(0) = "Hello World"

wd = new word.document("c:\Template.doc").MailMerge.Execute(fn,vn)

ms = new memorystream
wd.save(ms,word.saveformat.formatasposepdf)

xmldoc = new xmldocument
ms.position = 0
xmldoc.load(ms)

p = new pdf.pdf
p.bindxml(xmldoc,nothing)
p.save("abc.doc",pdf.savetype.openinacrobat, me.response)

------------------------------------------------------------------END CODE

A Open/Save/Cancel web box pops up and when I click open the tags were change correctly but the pdf file is filled with '$TAB' everywhere. It looks like the conversion is not ignoring TAB's which are in the word template. I've searched the forums, is this a bug?

Thanks,

-Randy



Hi,

Thank you for considering Aspose.

Could you please also attach the document template?

Template attached

I ran your code using your template and the resulting pdf doesn’t contain “$TAB” at all. Please make sure you are using the latest version both of Aspose.Word and Aspose.Pdf.

BTW, there is a little mismatch in this line:

p.save(“abc.doc”,pdf.savetype.openinacrobat, me.response)

The file extension should be .pdf.

Thanks, I was a few hot fixes behind one both word and pdf components, its work great now.

-r