Hi,
By looking at forums & examples, I could do a complete section delete using doc.getSection[i].delete method.
How do I delete sub-sections embedded at any level inside the section?
Using below code snippet, it is possible to increase/decrease an image size:
ImageSize imageSize = shape.getImageData().getImageSize();
shape.setWidth(imageSize.getWidthPoints() * 0.5);
shape.setHeight(imageSize.getHeightPoints() * 0.5)
Using below code snippet, I would expect auto-resize of an image to page. But it did not happen. How do I do it?
Shape shape = builder.insertImage("xxx.png");
// Make position relative to the page.
shape.setRelativeHorizontalPosition(RelativeHorizontalPosition.PAGE);
shape.setRelativeVerticalPosition(RelativeVerticalPosition.PAGE);
Thanks.
Hi
Thanks for your request.
- What do you mean when say “Sub Section”? Please attach sample document and highlight content that you would like to remove.
- RelativeHorizontalPosition and RelativeVerticalPosition do not resize the image, these option just specifies how the shape is positioned on the page. If you would like to fit your image to page you should use code provided here:
https://forum.aspose.com/t/95167
Hope this helps.
Best regards.
Hi,
Thanks for your reply.
- For Sub section, I have attached a sample document. For e.g. I look into below section
2 Data Center Reference Architecture [SECTION]
2.1 Requirements Table [SUB-SECTION]
Table 1 Data Center Reference Architecture
Data Center Reference Architecture CR # Classification
2.2 Guiding Principles for the Architecture [SUB-SECTION]
The following guiding principles are part of the Reference Architecture design.
2.2.1 Mature and Proven Technologies [SUB-SUB-SECTION]
Some components of future architecture may include leading edge technologies that will enable $customerName to provide customer centric services, reduce cost and improves efficiencies.
2.2.2 High Resiliency and Availability [SUB-SUB-SECTION]
As the SUB*Section can be embedded upto 9 level, how can I delete something at 2.2.2 but retain rest in a generic manner?
- The image code snippet is good if a page has only the image to fit. In a page, I can have multiple content - paragraph1 + image1 + paragraph2 + image2 … etc. You can look into page#15 of the attached document for an idea. Do I need to calculate the height/width parameter for every image before putting? Can not the image auto fit?
Thank you.
Hi
Thank you for additional information.
- These are not subsections, these are sub-headings. Please see the following link to learn more about Word sections:
https://docs.aspose.com/words/net/working-with-sections/
If you need to works with sub-headings, I think the code provided in the following forum thread could be useful for you:
https://forum.aspose.com/t/94231
- You can specify needed size of picture. Code I provided fits picture to page.
Best regards.