We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test.docx
using (FileStream fs = new FileStream(exisDocPath, FileMode.Open, FileAccess.ReadWrite)) { XWPFDocument doc = new XWPFDocument(fs); IList<XWPFParagraph> paragraphs = doc.Paragraphs; //get all paragraphs for (int par = 0; par < paragraphs.Count; par++) { IList<XWPFRun> runs = a[par].Runs; //get all paragraphs for (int runNum = 0; runNum < runs.Count; runNum++) //get all runs in each paragraph { if (runs[runNum].GetEmbeddedPictures().Count != 0) //get picture { List<XWPFPicture> pictures = runs[runNum].GetEmbeddedPictures(); pictures[0].GetCTPicture().spPr.xfrm.ext.cx = 360045 * 5; //resize picture width pictures[0].GetCTPicture().spPr.xfrm.ext.cy = 360045 * 5; //resize picture height using (FileStream imgWrite = File.OpenWrite(exisDocPath)) { doc.Write(imgWrite); } } } } }
the code above try to resize the Picture in docx file, while it doesn't seem to be effective
The text was updated successfully, but these errors were encountered:
https://stackoverflow.com/questions/29920094/apache-poi-image-scale-image
Sorry, something went wrong.
No branches or pull requests
NPOI Version 2.6.0
File Type
Upload the Excel File
test.docx
Reproduce Steps
Issue Description
the code above try to resize the Picture in docx file, while it doesn't seem to be effective
The text was updated successfully, but these errors were encountered: