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?
- For (INT I = 0; I <Doc. pagecount; I ++ ){
-
- Options. pageindex = I;
-
-
- Doc. mailmerge. deletefields ();
-
-
- Doc. save (server. mappath (".. /.. /uploads/"+ guid +"-"+ I. tostring () + "-copy.png"), options); // Save the converted Image
- Bitmap Bm = new Bitmap (server. mappath (".../uploads/" + guid + "-" + I. tostring () + "-copy.png "));
-
-
- Rectangle clonerect = new rectangle (0,100,794,920); //, remove the top PX
-
- Pixelformat format = BM. pixelformat;
- Bitmap clonebitmap = BM. Clone (clonerect, format );
-
-
- Clonebitmap. save (server. mappath (".. /.. /uploads/"+ guid +"-"+ I. tostring () + ". PNG "), imageformat. PNG); // save
-
- Clonebitmap. Dispose ();
-
-
- }
[CSHARP] View plaincopyprint?
-
- Bitmap BMP = new Bitmap (794,920 * Doc. pagecount); // create a blank image (combination)
-
- Graphics G = graphics. fromimage (BMP );
-
-
-
- For (INT I = 0; I <Doc. pagecount; I ++)
-
- {
- Bitmap MP = new Bitmap (server. mappath (".../uploads/" + guid + "-" + I. tostring () + ". PNG "));
-
-
-
- G. drawimage (MP, new point (0, I * 920 ));
-
-
-
- }
-
- G. Save ();
- BMP. Save (server. mappath (".../uploads/" + guid + ". PNG "));
-
- G. Dispose ();
-
- BMP. Dispose ();
-
Word Online Editing \ generate image (including and merging)