Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

saving inside of div tag to pdf or word via php?

Posted on 2009-05-13
2
Medium Priority
?
2,211 Views
Last Modified: 2013-12-13
i can create and save some word, excel, pdf files via php. but i am saving data to array then post to other page and create word file and parsing data after pasting to it and saving file. but i dont want to do that way because data vary i want to copy data inside specific div tag and paste to document and save it. because inside div tag there will be image, decorated text and etc. how can i do this.

<div id="print_to_word">
Some Data
</div>
<input type="button" onclick="run function">

or

<div id="print_to_word">
Some Data
</div>
<input type="button" onclick="run function">
0
Comment
Question by:phparmy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 49

Accepted Solution

by:
Roonaan earned 2000 total points
ID: 24391208
You could have a hidden form

<form name="createword" style="display:none" action="create-word.php" target="_blank" method="post">
   <input type="hidden" name="html" />
</form>

<input type="button" onclick="createWord()" />

<script type="text/javascript">
function createWord() {
  document.forms['createword'].html.value = document.getElementById('print_to_word').innerHTML;
  document.forms['createword'].submit();
}
</script>

Then you have to have your word creation script use the $_POST['html'] as its document content.
0
 

Author Comment

by:phparmy
ID: 24409178
thank you very much this solve my problem.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logiā€¦
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question