DOC textbox to DOC flow

Using Aspose.Pdf, I can use the line of code

    // Create DocSaveOptions object
DocSaveOptions saveOption = new DocSaveOptions();

// Set the recognition mode as Flow
saveOption.setMode(DocSaveOptions.RecognitionMode.Flow);

as well as

saveOption.setMode(DocSaveOptions.RecognitionMode.Textbox);

likewise, with Aspose.Words, can we convert DOC textbox to DOC flow (editing) by Aspose.Words?

For reference, source document attached. Sample.zip (103.1 KB)


This Topic is created by Farhan.Raza using the Email to Topic plugin.

@KhaNguyen

Thank you for your inquiry. Please have a look at SaveOptions class and PdfSaveOptions class for available features and working with TextBox.

Hi Rizwan,

Thanks for your answer. But I want to work with flow (Word editing all not text box)

@KhaNguyen

Thank you for your feedback. We are sorry we not sure as exactly what you are looking for but you can look into the supported load features and supported save features for .DOC and .DOT documents in details. We are sorry for the inconvenience.

Hi @rizwan.niazi

My mean: I have a file DOC with format is export from Crystal Report with format TextBox. Now, I want to convert from DOC format TextBox to DOC Editing and can edit anywhere in the document. Because DOC format TextBox only edit in Textbox.

@KhaNguyen

Thank you for the details. According to your shared information first you need the DOC or DOCX document exported in a way that Aspose.Words can read and allow to edit. Please have a look at Aspose.Words for Reporting Services.

Thanks,

But I’m using JAVA version 1.7 and export document by Crystal Report.

@KhaNguyen

Thank you for writing back. We will look into the details for Crystal Reports exported document and JAVA platform specific TextBox document editing and will share the information with you here as soon as possible. Thank you for your cooperation.

@KhaNguyen

Thank you for your patience. We have investigated this in details by considering other aspects and your provided Crystal Reports Exported DOC file and found provided input DOC is not actually exported Mode as TextBox instead it has Images/Shape. We have also verified you can even load and manipulate this document using Aspose.Words and edit using ShapeBase as Shape objects to Remove or any other operations as required.

We suggest you to explore the shared features and also share the TextBox based input DOC document and expected output DOC or DOCX document so we can give you the exact information to achieve that. Thank you for your cooperation.

Hi @rizwan.niazi,

Thanks a lot,

May you share me your sample code?.

This is file sample: SamepleDocWithTextbox.zip (5.9 KB)

Currently, The attach file just edit beside Textbox. Cannot edit outside or all.

My expectation use Aspose.Words convert word with format Textbox to Doc or Docx can edit all.

@KhaNguyen

Thank you for the details. We are working on this scenario and will share our findings as soon as we have more information. Thank you for your cooperation.

@KhaNguyen

Thank you for your patience. We have investigated the current scenario in detail and found the provided document is based on Frames. However Aspose.Words have limited features to manipulate the Frames itself. Please have a look at this sample code which demonstrate to edit your provided document Frame_Docs_Input_Output.zip (12.2 KB).

// The path to the documents directory.
String dataDir = Utils.getDataDir(TestFrameDocs.class);

// Open document
Document doc= new Document(dataDir + "SamepleDocWithTextbox.doc");

// Create builder
DocumentBuilder builder = new DocumentBuilder(doc);

builder.write("Aspose.Words Text is added.");

// Get all paragraphs
NodeCollection paragraphs = doc.getChildNodes(NodeType.PARAGRAPH, true);

for (Paragraph para : (Iterable<Paragraph>) paragraphs) {   	
	
	// Clear Frame formatting.
	para.getParagraphFormat().clearFormatting();

	// Get Runs within each paragraph.
	NodeCollection runs = para.getChildNodes(NodeType.RUN, true);

	for (Run run : (Iterable<Run>) runs) {
		
		// Paragraph 3 which contains character as '3'
		if(run.getText().contains("3"))
		{
			// update text
			run.setText(run.getText() + " - Updated text using Aspose.Words");
		}
		
		if(run.getText().contains("5"))
		{
			// update font style
			run.getFont().setBold(true);
		}
	}
}

// Save updated document as DOCX
doc.save(dataDir + "SamepleDocWithTextbox_DOC_Updated_Out.docx", SaveFormat.DOCX);