Skip to main content
Known Participant
November 16, 2010
Question

How to write a txt file using AdobeIndesign CS4 Plugin

  • November 16, 2010
  • 1 reply
  • 412 views

Hi,

    Im trying to write a txt file in a particular path(of my choice of the folder path to crete the txt file).Someone help me,

This topic has been closed for replies.

1 reply

JADarnell
Inspiring
November 20, 2010

Here's how I do it:

void SaveToText()
{
   InterfacePtr<IPMStream> Output(StreamUtil::CreateFileStreamWrite(TagFileName));

   Output->Open();
   Output->XferByte((uchar *) Report.c_str(), Report.size());
   Output->Close();
}

The Report is some kind of string object.  Pile on your text into the string object and then use XferByte to save it all to the file you specify in TagFileName.  This works for both Mac and Win computers.

HTH!

John