• Post Reply Bookmark Topic Watch Topic
  • New Topic

Inputting and outputting documents  RSS feed

 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...

We have a template system which uses placeholders ie. __JobNo__ and __Part No__.These placeholders correspond with the database.
We usually use php's file functions(and regex) to read the whole file as a string and replace the placeholders with values and subsequently output the modified file.

The problem is that the files contain image components(like signatures).I think the type of file is .doc....

Anyway, what classes can I use to implement this in Java??
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, Java has file, regex and string replacement "functions" as well. I think the real question is "how did you accomplish this in PHP?"

Are you *inserting* the contents of a *.doc into the variables, or are the variables in the *.doc? (Are you inserting a *.doc into the template, or is the template a *.doc?)
 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it was using fopen("filename.doc",someotherparameter).Then sticking the whole file into a string and doing some replacement using regex and finally re-outputting the file.

I think Ive actually overcome this problem because I thought that the FileReader/FileWriter was intended for text.But,I was reading on the weekend that because they operate at the byte level they are well suited for images.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!