Basically we want to be able to open up a docx file in as3 or Flex 4 and convert it to a text flow while preserving formatting, embedded images, tables, columns, etc. I know theorectically it's possible as the new Text Layout Framework is powerful enough to pull it off, but I haven't been able to find any case where someone has achieved anything along these lines except for Adobe's BuzzWord web app which does just this. Ideally the solution would be for RTF documents as conversions to RTF from anything are pretty familiar.
I used TextConverter to convert a TextFlow in Flex to String to store it in my Database. How to convert that string back to TextFlow in order to display in Rich Text format
was just wondered if it is possible to link to a bookmark in a microsoft word document? I figured it would work similar to how you'd link to a bookmark in a HTML file but to no avail. heres my code so far:
btn1.addEventListener(MouseEvent.CLICK, lndFunction);function lndFunction(event: MouseEvent) { var request:URLRequest = new URLRequest("test.docx#number8"); navigateToURL(request, "_self");}
To my knowledge as3 cannot read the contents of a .doc/.docx file (it can, but it gets stuck in the beginning random/garbage data. Does this have to do with xml formatting?). Am I correct?
If I am correct in assuming as3 cannot read .doc/.docx files, does anyone know a workaround for this? I don't need the formatting, just the text. Can I skip the beginning garbage data? (How do I determine where the good data starts? Is it fixed location I can begin at?) Can I convert it to a .txt file in javascript or php or some other language? (I know very little about them, but am willing to learn) Is there another workaround that I haven't thought of that is worth looking into?
Using the office open XML format by microsoft I was able to create the files needed for a clean Word document. These files are all XML files. What I do is write the XML content to a different bytearray for each file.
I then add the bytearray's to the FZIP library [url] and create a docx file using the following code:
CODE:
Ok this creates a new docx file in my documents. If I rename the .docx to .zip and unzip it it will follow the exact structure needed for Word documents (example: [url]
In this example "Untitled Document" was originally "Untitled document.docx" (then renamed to .zip and extracted)
So you can see everything works fine untill... you try to open the "Untitled document.docx" in Word. It will say the file is corrupt.
WHAT DOES WORK HOWEVER... After extracting the docx file (like in screenshot) when you select all the files/folders inside the Untitled Document folder and ZIP those, then rename ZIP file to docx (see result: [url]) it works fine in Word and word reads the file correctly.
NOTE: If you try to zip and rename the Untitled Document folder again it will become corrupt again as well.
So my question: What could be the problem that the word file is corrupt when zipped using FZIP in actionscript 3 but works fine when you ZIP the files after extracting your corrupt file.
We are in the process of developing a CRM application and for that we need to upload *.doc and *.docx files and display that contents.
We successfully uploaded the *.doc and *.docx files in application by using FileReference and FileReferenceList. Would you please tell me some idea to read the contents from *.doc and *.docx files and to display the uploaded file content into flex text area.
U can see the output on the pic. It just uses the TextFormat for the last line and why are the spaces to the first pics big and get lower and lower to the followin ones?
I want the ability to select some text in a textarea and then replace the selected text with a SpanElement. I cannot use a TextLayoutFormat because it doesn't have an "id" property.
How do I insert a span in a specific position in a textarea?
I am working as a developer on a Flex/Air application and we are using the buggy Flex RTE (RichTextEditor) to let the user manage his notes. At the moment I am trying to evaluate how costly it would be for us to build a new text component using the TLF (Text Layout Framework).Really important is the question if we can import the HTML text, produced by the RTE straight away. I know that there are some limitations regarding lists with TLF 1.1, but does it work in general?
I have just tried to grab some HTML formatted text from RTE like:
[code]I want a specific toolTip for "icon". I have read about using HTML and rollOver and rollOut but I'm building this as part of a larger text block; it's difficult to switch from incremental objects to HTML in the middle.If I cannot set an event on the icon, can I create an HTML bit in ActionScript as part (but not all) of a paragraph ?
i'm trying to add whitespaces in front of my text, but flex removes all but one whitespace from the text. So i can't format the text.
Here is the specified line:
<s:p> - Lorem</s:p> <s:p> ipsulum</s:p>
Here its shown correctly but when running the swf it reduces the whitespaces of the second line. Of course i tried to use CDATA but this didn't work too.
Is there an easy way to compare two TextFlow objects with each other? I have two text flow objects that are created with TextConverter.importToFlow() and want to check if they are equal or not. Only way I found so far is to use TextConverter.export() to export them to a string then compare which seems bit convoluted...
I need to use TLF textFlow to change the format of my text, I have links, italics, bold, paragraphs, etc. Is there a way to PUT the textFlow inside a textField so I can scroll the text inside the textField?
I need to use TLF textFlow to change the format of my text, I have links, italics, bold, paragraphs, etc. Is there a way to PUT the textFlow inside a textField so I can scroll the text inside the textField?
The link elements I'm talking about are single words, so they are not wrapped inside the container, which means that they should have a single bounding rectangle. But how do I go about finding this rectangle? I'm familiar with Flex3 but don't know enough about the new Text Layout Engine in Flex4.
I have embedded a Font in my flex app. That works on any components without problems. @font-face { src:url("../assets/fonts/wedtxtn.ttf"); fontFamily: "CSSFont"; cff: true; }
However, when I try to apply the font to my TextFlow object, it is not working. However, it does work when I use the FTE and do it my self. I debugged through the TLF and the looks like the correct FontDescription is created.
Here is the code I use to create text (Full Source @ Pastbin) var element:SpriteVisualElement = new SpriteVisualElement; element.verticalCenter = 0; element.horizontalCenter = 0; // Create Text using TLF var span:SpanElement = new SpanElement(); [Code] .....
i have textflow with name mytextflow and after i wrote text i want to replace the text with another in array i use these code it's go write but replace the line with the second element in array line 1 with array2 and so
for ( var ii:int = start_index ; ii <= end_index ; ii++) { add_kashida(ii); }
How can I use an Embedded font from my library in a TextFlow object?I tried to use formattt.fontFamily = 'ArialNarrow'; where "ArialNarrow" is the Class name of the embedded font,but it didn't work.[code]...
I would like to know how possible it is to undo/redo the resize of the the textflow container through an EditManager?.For example I manually reset the size of the textflow through ContainerController.setCompositionSize(w, h), and then I would like to undo the resize?
<s:TextArea id="editor"> <s:textFlow> <s:TextFlow id="_tf" > <s:p>Lorem ipsum etc.</s:p>
[code]...
But still no joy in inserting into the middle. Also, the above code wouldn't replace highlighted text, but that's not the real concern here.Based on Eugene's link the key to this is EditManager.The following code represents the working updated function:
protected function imageBtn_clickHandler(evt:MouseEvent):void { var em:EditManager = editor.textFlow.interactionManager as EditManager; em.selectRange(editor.selectionAnchorPosition, editor.selectionActivePosition);
open google docs, new document, and type in: hello world (world bolded)
then download it as html(zipped)
i unzip the html file, and save it to the assets folder in src folder of my Flex app
i have a Spark:TextArea instance and i want to do:
var importer:ITextImporter = TextConverter.getImporter(TextConverter.TEXT_FIELD_HTML_FORMAT); myTextArea.textFlow = importer.importToFlow(htmlSource);
where htmlSource should point to the saved html file somehow
how do i do this? i tryed embedding, converting to ByteArrayAsset and to String, but i always get the source of the html file and not it's rendered rich text (ie "hello world).
Given the following:private var errorHtml:String = "<TextFlow xmlns="http://ns.adobe.com/textLayout/2008"><p>Existing account, please <a click="clickHandler(event);">click here</a>.</p></TextFlow>";
I am using text layout framework textflow in Flex 3 to get embedded images. In the edit field for the application the user can apply formatting. This all works fine except if the user deletes all the text they have entered and then starts typing again then the formatting is lost.[code]To setup the initial formatting then similar code to apply the formatting when the user changes it.So how can I stop the user from 'deleting' the formatting if they delete all the text?
I have a PDF file with images etc that I would like to convert to a SWF with buttons to replace the PDF thumnails, but I don't know how to do it. The only thing I found was SWFTools for Linux but I use Windows and want to do it in MX.