Word Online Editing \ generating images (including screenshots and merging)

Source: Internet
Author: User

1. Business reasons

If the text edited by word is copied to the HTML editor (fck, etc.), the layout may be disordered, so it is chaotic. There needs to be a new method to end, so there is a series of problems such as whether the word can be edited online, stored in the background, and the front-end display light.

2. First, you can edit the word online by using weboffice or dsoframer. The advantage is that you can edit the word online only in the IE browser. Tangle...

3. After editing, save it in the background. weboffice or dsoframer has corresponding interfaces.

4. After saving the image to the background, convert the page Image Using aspose. Words.

5. Because the image generated by aspose. Words has a small margin, you need to save it.

6. Save the multiple graphs.

Pay key code:

Document Doc = new document (server. mappath (".. /.. /uploads/"+ guid + ". doc "); imagesaveoptions = new imagesaveoptions (saveformat. PNG );

[CSHARP] View plaincopyprint?
  1. For (INT I = 0; I <Doc. pagecount; I ++ ){
  2. Options. pageindex = I;
  3. Doc. mailmerge. deletefields ();
  4. Doc. save (server. mappath (".. /.. /uploads/"+ guid +"-"+ I. tostring () + "-copy.png"), options); // Save the converted Image
  5. Bitmap Bm = new Bitmap (server. mappath (".../uploads/" + guid + "-" + I. tostring () + "-copy.png "));
  6. Rectangle clonerect = new rectangle (0,100,794,920); //, remove the top PX
  7. Pixelformat format = BM. pixelformat;
  8. Bitmap clonebitmap = BM. Clone (clonerect, format );
  9. Clonebitmap. save (server. mappath (".. /.. /uploads/"+ guid +"-"+ I. tostring () + ". PNG "), imageformat. PNG); // save
  10. Clonebitmap. Dispose ();
  11. }
[CSHARP] View plaincopyprint?
  1. Bitmap BMP = new Bitmap (794,920 * Doc. pagecount); // create a blank image (combination)
  2. Graphics G = graphics. fromimage (BMP );
  3. For (INT I = 0; I <Doc. pagecount; I ++)
  4. {
  5. Bitmap MP = new Bitmap (server. mappath (".../uploads/" + guid + "-" + I. tostring () + ". PNG "));
  6. G. drawimage (MP, new point (0, I * 920 ));
  7. }
  8. G. Save ();
  9. BMP. Save (server. mappath (".../uploads/" + guid + ". PNG "));
  10. G. Dispose ();
  11. BMP. Dispose ();

Word Online Editing \ generate image (including and merging)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.