Font BOLD in doc files.

Hi Guys,
I have used a Random Access File to create a file and I am writing some data within the file.
How do I change the contents of the file so that I can use different fonts for the data.
Shall I change the font at the time of writing(If yes ,how..) or after making the file(If yes ,how..).My code is given below:
try{
               DataOutputStream addressfile = new DataOutputStream(new FileOutputStream(new File (TEMP.get("filename").toString()+".doc")));                                   
               List answers = (ArrayList)TEMP.get("answer_options");
               List count_options = (ArrayList)TEMP.get("count_options");
               List count_options_percent = (ArrayList)TEMP.get("count_options_percent");
     int size = count_options_percent.size();
     long filelength;
     int j = 1;
     addressfile.writeBytes("\n\n\n");
     addressfile.writeBytes("VOTE OPTIONS");           
     addressfile.writeBytes("\t\t");
     addressfile.writeBytes("NUMBER OF PEOPLE");           
     addressfile.writeBytes("\t\t");
     addressfile.writeBytes("PERCENTAGE");
     for(int i = 0;i<size;i++){
          addressfile.writeBytes("\n");
          addressfile.writeBytes(j+")");
          addressfile.writeBytes(answers.get(i)+"");
          int numberspaces = 28-answers.get(i).toString().length();
          for(int k=0;k<numberspaces;k++)           
               addressfile.writeBytes(" ");
          addressfile.writeBytes(count_options.get(i)+"");
          int numberspaces2 = 21 - count_options.get(i).toString().length();           
          for(int k=0;k<numberspaces2;k++)           
               addressfile.writeBytes(" ");
          addressfile.writeBytes(count_options_percent.get(i)+"");
          addressfile.writeBytes("\n");
          j++;
     addressfile.close();
          }catch(Exception e){
               logger().error("Writing to a file error");
               throw new NoSuchFieldError("Writing to a file error");
Thanks in advance for your suggestions:
Yours sincerely,
Coolfunky Dude

You've clearly been reading this thread and responding to it, but also it's pretty clear that none of what's been written above has actually sunk in.
Short of decoding the MS proprietary doc encoding scheme, or using an external API, you cannot generate .doc encoding the way you are trying to do it.
I do not know (nor do I ever intend to know) the MS encoding schemes for their proprietary document types. If my clients require functionality I inform them that they need support libraries, if they don't want that they do not get the functionality.
J

Similar Messages

  • Generated XML doc file contains comments from MFC source code

    Hello, in my project I use the option /doc to generate XML doc file from my source codes but unfortunately in the output XML file there are mixed also comments from original MFC source codes, see the part of generated xml file:
    Is there a solution to ignore these MFC cpp files?
    Many thanks
    Regards
    Petr Stejskal
    <?xml version="1.0"?>
    <style xmlns="http://www.w3.org/1999/xhtml">@namespace html url(http://www.w3.org/1999/xhtml); :root { font:small Verdana; font-weight: bold; padding: 2em; padding- } * { display: block; padding- } html|style { display: none; } html|span, html|a
    { display: inline; padding: 0; font-weight: normal; text-decoration: none; } html|span.block { display: block; } *[html|hidden], span.block[html|hidden] { display: none; } .expand { display: block; } .expand:before { content: '+'; color: red; } .collapse
    { display: block; } .collapse:before { content: '-'; color: red; } </style><doc><assembly><assembly>       
    "Console"    </assembly></assembly><members><members><member name="T:_RS"><member
    name="T:_RS">Reed-Solomon codec control block</member></member><member name="M:MMask_makeMask(System.Int32,System.Byte*,System.Int32,QRecLevel)"><member
    name="M:MMask_makeMask(System.Int32,System.Byte*,System.Int32,QRecLevel)">Mode indicator. See Table 2 in Appendix 1 of JIS X0510:2004, pp.107.</member></member><member
    name="M:CMFCControlRenderer.IsScaled"><member
    name="M:CMFCControlRenderer.IsScaled"><summary><summary>Tells whether this control
    renderer works with scaled (resized) images.</summary></summary><returns><returns>Returns TRUE if this control
    renderer works with resized (scaled) images.</returns></returns></member></member><member name="M:CMFCControlRenderer.SmoothResize(System.Double)"><member
    name="M:CMFCControlRenderer.SmoothResize(System.Double)"><summary><summary> 
    Smoothly resizes images.</summary></summary><param name="dblScale" /><param
    name="dblScale"> Scale ratio.</param><returns><returns>
    TRUE if resize succeeds; otherwise FALSE.</returns></returns></member></member><member name="M:CDrawingManager.CreateBitmap_32(HBITMAP__*,System.UInt32!System.Runtime.CompilerServices.IsLong)"><member
    name="M:CDrawingManager.CreateBitmap_32(HBITMAP__*,System.UInt32!System.Runtime.CompilerServices.IsLong)"><summary><summary>
    Creates a 32 bit bitmap from the specified bitmap.</summary></summary><returns><returns> A handle to created
    bitmap, or NULL, if creation fails.</returns></returns><param name="bitmap" /><param
    name="bitmap"> A handle to the original bitmap.</param><param name="clrTransparent"
    /><param
    name="clrTransparent"> An RGB value specifying transparent color of the original bitmap.</param></member></member><member
    name="M:CDrawingManager.CreateBitmap_32(CSize!System.Runtime.CompilerServices.IsConst*!System.Runtime.CompilerServices.IsImplicitlyDereferenced,System.Void**)"><member
    name="M:CDrawingManager.CreateBitmap_32(CSize!System.Runtime.CompilerServices.IsConst*!System.Runtime.CompilerServices.IsImplicitlyDereferenced,System.Void**)"><summary><summary>
    Creates an empty 32 bit bitmap.</summary></summary><returns><returns> A handle to created bitmap, or NULL,
    if creation fails.</returns></returns><param name="size" /><param
    name="size">Specifies bitmap size.</param><param name="pBits" /><param
    name="pBits">When the function returns contains a pointer to bitmap bits.</param></member></member><member
    name="M:CDrawingManager.DrawRotated(CRect,CDC*!System.Runtime.CompilerServices.IsImplicitlyDereferenced,System.Int32)"><member
    name="M:CDrawingManager.DrawRotated(CRect,CDC*!System.Runtime.CompilerServices.IsImplicitlyDereferenced,System.Int32)"><summary><summary>Rotates
    a source DC content inside the given rectangle by +/- 90 degrees</summary></summary><param name="rectDest" /><param
    name="rectDest">Destination rectangle</param><param name="dcSrc" /><param
    name="dcSrc">The source device content.</param><param name="bClockWise"
    /><param
    name="bClockWise">TRUE - rotate +90 degrees, FALSE - 90.</param></member></member><member
    name="M:AfxRegDeleteKey(HKEY__*,System.Char!System.Runtime.CompilerServices.IsConst*,ATL.CAtlTransactionManager*)"><member
    name="M:AfxRegDeleteKey(HKEY__*,System.Char!System.Runtime.CompilerServices.IsConst*,ATL.CAtlTransactionManager*)"><summary><summary>Deletes
    the specified registry key.</summary></summary><returns><returns>  If the function succeeds, the return
    value is ERROR_SUCCESS. If the function fails, the return value is a nonzero error code defined in Winerror.h</returns></returns><param name="hKey" /><param
    name="hKey">A handle to an open registry key.</param><param name="lpSubKey"
    /><param
    name="lpSubKey">The name of the key to be deleted.</param><param name="pTM" /><param
    name="pTM">Pointer to CAtlTransactionManager object</param></member></member><member
    name="M:AfxRegOpenKeyEx(HKEY__*,System.Char!System.Runtime.CompilerServices.IsConst*,System.UInt32!System.Runtime.CompilerServices.IsLong,System.UInt32!System.Runtime.CompilerServices.IsLong,HKEY__**,ATL.CAtlTransactionManager*)"><member
    name="M:AfxRegOpenKeyEx(HKEY__*,System.Char!System.Runtime.CompilerServices.IsConst*,System.UInt32!System.Runtime.CompilerServices.IsLong,System.UInt32!System.Runtime.CompilerServices.IsLong,HKEY__**,ATL.CAtlTransactionManager*)"><summary><summary>Opens
    the specified registry key.</summary></summary><returns><returns>  If the function succeeds, the return
    value is ERROR_SUCCESS. If the function fails, the return value is a nonzero error code defined in Winerror.h</returns></returns><param name="hKey" /><param
    name="hKey">A handle to an open registry key.</param><param name="lpSubKey"
    /><param
    name="lpSubKey">The name of a key that this function opens or creates.</param><param name="ulOptions"
    /><param
    name="ulOptions">This parameter is reserved and must be zero.</param><param name="samDesired" /><param
    name="samDesired">A mask that specifies the desired access rights to the key.</param><param
    name="phkResult" /><param
    name="phkResult">A pointer to a variable that receives a handle to the openedkey.</param><param
    name="pTM" /><param
    name="pTM">Pointer to CAtlTransactionManager object</param></member></member></members>

    Hi stejsky,
    Thank you for posting in MSDN forum.
    >>In my project I use the option /doc to generate XML doc file from my source codes but unfortunately in the output XML file there are mixed also comments from original MFC source codes.
    Based on your issue, could you please tell me how you use the option /doc to generate XML doc file from your source codes?
    If you use the option /doc to generate the XML doc file by right-click the your MFC project->Properties->Configuration Properties->C/C++->Output file->set the Generate XML document files as Yes(/doc) like the following screen shot.
    (1)If yes, since we could not reproduce your issue in mu side, so if possible, I suggest you could share me your MFC project so that we will further help you support this issue.
    You could upload your MFC project to the OneDrive and then copy link here.
    (2)If no, please try the above way to generate XML doc file and then check if you still get same issue.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Understanding compile errors due to copying code from a doc file and not a txt file

    SITUATION:
    My instructor for my micro-controller class refuses to save sample code to a text file and instead saves it to a word document file instead. When I open up the doc file and copy/paste the code into my IDE "CodeWarrior" it causes errors upon compile time.
    I am having to rewrite all the code into a text editor and then copy/paste it into my IDE.
    MY UNDERSTANDING:
    I was told to always save code as a text file because when you save code as a word document file it will bring in unwanted characters when your copy/pasting the code into your IDE for compiling.
    Their are students in my class using the schools computers running "Windows" that copied and pasted the code into CodeWarrior and it compiled fine. This is not only frustrating but confusing. However, I know their are students in class with "PC's" running windows that had the same trouble I did so I know it's not a Mac issue. 
    Also I am running "Parallels" because my IDE for this micro-controller "Code Warrior" is not avaiable for my OS. I realize there are several IDE's out there that require "Windows OS" in general but I know this situation is not a Mac issue or Parallels issue or even a Windows issue. It's purly an issue of formatting that is done between the file being copied and the target program or so I'm understanding.
    Can someone exlain to me in better words or perhaps provide a resource, documentation or article that will enlighten me on this issue. I would like to better state my case next time. I'm tired of being told this is a MAC issue and that Windows is just plain better.

    The problem is (as you suggest) almost certainly a gremlin issue - characters that for one reason or another Code Warrior cannot interpret correctly. Why it happens to you and not others is a different matter. That could mean that the pofessor uses fonts that are not on your machine, or that he is using a different version of word, or it could be in how you access the data. For instance, if the prof posts this word doc on the web you may get different results if you download the file and open it in Word as opposed to opening it directly from a web browser.
    The sure-fire solution is to download TextWrangler and copy the code in there first. TW has a number of tools for finding and removing unpleasant characters. it adds a step, but... you could also try resaving the doc file as a plain text file from within word.

  • How to embed the needed fonts in a pdf file

    Dear Sir/Mam,
    We had purchased licenced version of adobe acrobat x pro
    We are facing issues while embedding the font in the pdf file
    Please find the below mentioned requirement
    Requirement:
    We have a pdf file (template) with some static images and static text in it
    We need to populate dynamic data in the pdf file for this we may use text boxes
    We need to set the font name for the text box and embed that font in the pdf template (Eg:Font to be used in textboxes is "RotisSansSerif-Bold")
    Queries
    Please let us know how to embed the needed fonts in the pdf file?
    Once user exports the pdf file, even if user doesnot have the fonts installed in his system the text need to be displayed in the same fonts,how to acheive this?Eg:if we define "RotisSansSerif-Bold" as font in the textboxes,after exporting the data the text need to be in the same font.
    Note:
    Fonts will only installed in the application server and not in the client system
    The mentioned requirement need to work on below mentioned specifications
    OS:Windiows-XP,  Browser:IE
    OS:Mac osx, Browser:Safari
    Regards,
    S.N.Prasad

    There is a similar post just a few away from yours. I will suggest what I would try. Open your job settings file (press or print preferred to get all fonts) and then select the properties and the font tab. At your font to the always embed list and you will likely need to uncheck the subset box. Then save your job settings (give it a name that is meaningful to you, you can not use the settings file you started with as they are read only and I do not recommend changing that). Maybe that will do the job. Of course that is for the creation of the PDF, I forgot you were talking about a form. You might check the form field properties, but I suspect you have already tried that. Guess I don't play with forms enough. Others may be by to answer.

  • How to create pdf from word doc file

    HI
    I have a word doc file. (not docx). I have adobe 8 pro. I wrote a word script to create the file using the distiller. The fonts in the pdf file it makes look wacky. That script looks liek this:
    * create archive pdf file
    lfilename = "t:\cardeals\pdf\pdf_archive\" + PADL(alltrim(STR(month(date()))),2,"0") + PADL(alltrim(STR(DAY(DATE()))),2,"0") + SUBSTR(ALLTRIM(STR(YEAR(DATE()))),3,2) + "1.pdf"
    oWord = createOBJECT("Word.Application")
    oWord.DisplayAlerts = .f.
    oWord.documents.open('t:\cardeals\cardeals.doc')
    oword.ActivePrinter = "\\CSSSERVERONE\Overflow"
    oword.application.printout(,,,,,,,4,,,,,,,,,,,)
    oWord.PrintOut(.F.,.F.,,"c:\output.ps",,,,,,.F.)
    oPDF = CREATEOBJECT ( "PDFDistiller.PDFDistiller.1" )
    oPDF.FileToPDF("c:\output.ps", "&lfilename.", "High Quality" )
    oWord.application.quit
    release oword
    I also wrote a script to attempt to print it from the Adobe printer. It seems to work, but when I go to open the created pdf file it I get the following message:
    Acrobat could not open mypdf.pdf because it is either not a supported file type or because the file has been damaged.
    The code was this:
      Set oWordApp = CreateObject("Word.Application")
        Set oDocument = CreateObject("Word.Document")
        oWordApp.Visible = True
        oWordApp.Application.WindowState = wdWindowStateMinimize
        Set oDocument = oWordApp.Documents.Open("t:\cardeals\cardeals.doc")
        strOutputPDFName = "c:\mypdf.pdf"
        holdprtrdefault = oWordApp.ActivePrinter
        oWordApp.ActivePrinter = "Adobe PDF"
        oWordApp.Application.PrintOut FileName:="t:\cardeals\cardeals.doc", _
            Copies:=1, _
            Range:=wdPrintAllDocument, _
            Item:=wdPrintDocumentContent, _
            Pages:="", _
            PageType:=wdPrintAllPages, _
            Collate:=True, _
            Background:=False, _
            PrinttoFile:=False, _
            OutputFileName:=strOutputPDFName
    If I clkick on the PDFMaker icon iside word, the resultant file is BEAUTIFUL. Can I automate this from within word? If not, does PDFMaker have a command line utility that I could put in a batch file?

    I don't have an answer, but you might get a better response in the scripting forum.

  • Problem with reading text from .DOC files through java and POI

    I have used a jar file "poi-scratchpad-3.2-FINAL-20081019.jar" and "poi-3.2-FINAL.jar" to read text from a .DOC file. I used the "getParagraphText()" function of the class "org.apache.poi.hwpf.extractor.WordExtractor" to get the text.
    I am able to get the text in the .DOC file but along with that i am getting the following messages/warnings
    Current policy properties
    *     thread.thread_num_limited: true*
    *     file.write.state: disabled*
    *     net.connect_ex_dom_list:*
    *     mmc.sess_cab_act.block_unsigned: false*
    *     mmc.sess_cab_act.action: validate*
    *     mmc.sess_pe_act.block_blacklisted: false*
    *     mmc.sess_pe_act.block_invalid: true*
    *     jscan.sess_applet_act.stub_out_blocked_applet: true*
    *     file.destructive.in_list:*
    *     jscan.sess_applet_act.block_all: false*
    *     file.write.in_list:*
    *     file.nondestructive.in_list:*
    *     window.num_limited: true*
    *     file.read.state: disabled*
    *     jscan.session.origin_uri: http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/poi/poi/3.2-FINAL/poi-3.2-FINAL.jar*
    *     file.nondestructive.state: disabled*
    *     jscan.session.user_ipaddr: 10.136.64.153*
    *     net.connect_other: false*
    *     thread.thread_num_max: 8*
    *     file.destructive.ex_list:*
    *     file.nondestructive.ex_list:*
    *     file.write.ex_list:*
    *     jscan.sess_applet_act.sig_invalid: block*
    *     file.read.in_list:*
    *     mmc.sess_cab_act.block_invalid: true*
    *     jscan.session.policyname: TU1DIERlZmF1bHQgUG9saWN5*
    *     mmc.sess_pe_act.action: validate*
    *     thread.threadgroup_create: false*
    *     net.connect_in_dom_list:*
    *     net.bind_enable: false*
    *     jscan.sess_applet_act.sig_trusted: pass*
    *     jscan.session.user_name: 10.166.64.201*
    *     jscan.session.user_hostname:*
    *     file.read.ex_list:*
    *     jscan.sess_applet_act.sig_blacklisted: block*
    *     jscan.session.daemon_protocol: http*
    *     net.connect_src: true*
    *     jscan.sess_applet_act.unsigned: instrument*
    *     mmc.sess_pe_act.block_unsigned: false*
    *     file.destructive.state: disabled*
    *     mmc.sess_cab_act.block_blacklisted: true*
    *     window.num_max: 5*
    Below the above messages/warnings the data is getting printed. Only the text part of the data is retrieved not the fonts, styles and bullets etc.
    Can anyone explain me why I am getting above warnings and how can I remove them. Is it possible to fetch the text depending on delimiters.
    Thanks in advance,
    Tiijnar
    Edited by: tiijnar on May 21, 2009 2:45 AM

    The jar files which were used are downloaded from http://jarfinder.com. Those jars created the problem of displaying those messages on console. I downloaded APIs from apache.org and used them in my application. Now my application is running good.
    Tiijnar

  • Prob with chinese font bold, italic... in PDF report

    Hello everyone ! :D
    My symptoms (overview) : to create my RDF report, I'm using a font, simsun.ttf, wich allow me to view chineses and french characters. Everything is ok, except in PDF format, all the items remains in "normal" style.
    My configuration : Windows NT4 SP6a
    Report Builder 9.0.4.2
    Acrobat Reader 7.0
    Oracle Database 9.2.0.6
    In Detail : in report builder, every items (text fields, labels,...) are directly created with SimSun font. Some items are bold, some italic, ...
    If i generate the report in RTF format, my items bold, italic, ... are ok in Microsoft Word (SimSun Bold, ...). However, if i generate the report in PDF format, everything is in "normal" style.
    I changed the file UIFONT.ALI like this :
    [ PDF:Subset ]
    # This example shows how to subset Arial True Type font into the PDF file
    # Arial = "Arial.ttf"
    # The True Type font files must exist in any one of the folders specified in
    # REPORTS_PATH.
    SimSun..Italic.Bold.. = "SimSun.ttf"
    SimSun...Bold.. = "SimSun.ttf"
    SimSun..Italic... = "SimSun.ttf"
    SimSun..... = "SimSun.ttf"
    and also like that (just to try something else, but it does not change anything) :
    [ PDF:Subset ]
    # This example shows how to subset Arial True Type font into the PDF file
    # Arial = "Arial.ttf"
    # The True Type font files must exist in any one of the folders specified in
    # REPORTS_PATH.
    SimSun = "SimSun.ttf"
    Obviously, with an Arial font, we can map the different files Arialb.ttf, Arialbi.ttf, ... according to the desired font style we want, but with SimSun font, there is only one file : SimSun.ttf.
    Obviously, i have no choice for the font... I have to use SimSun.
    Anyway, if i take a look at my PDF, the used fonts (in file>property>fonts>) i can see several personnalized fonts, each one corresponding to a SimSun style (one for SimSun, Bold, an other for SimSun, BoldItalic, ...) but everything is the same style on screen.
    Does somebody have an idea??
    Thanks a lot !

    Hi I am also facing same Problem If you get solution to this please help me.
    I have one sugestion,Inf you PDF file go to file>Document Properties>fonts
    chech that if tyep is TYPE3 and font is CUSTOM then it is using subsetting ,and if not then report is using pdfs default font and it is not using required font
    Hope this may solve your Problem

  • Can't make font bold, shortcut stopped working

    In the last week or so a few of our users have no longer been able to use the keyboard shortcut to make some fonts bold even though you can go select the bold from the type menu so obviously the bold version is installed and active. After talking with others in our group, some of them have had this happen in the past and then things resolved on their own.  I researched this and found the thread here
    http://forums.adobe.com/message/2653026#2653026
    which mentioned that some fonts don't contain the data to indicate that they contain a bold version, but that theory doesn't seem to apply in our situation. We use a set of corporate fonts that have not changed and the same version of the fonts are installed on all our computers, which are all cloned off a single image so set up is identical. Some users can make the fonts bold using shortcuts and others cannot, so I don't think it has anything to do with the font itself not containing the proper data or it wouldn't work on any of the computers. Also, if I switch to a different user on the same computer I am able to use the shortcut keys so again. Could there be any other reason why the shortcut keys would simply stop working? I've tried replacing InDesign's preference files and that does not work either. We are running CS4 on OS X 10.5.8.

    [email protected] wrote:
    Just wanted to follow-up. I have been in contact with Extensis regarding this issue and they were able to replicate it with several of our fonts. The very nice representative I've been working with said that the issue would be passed on to their product managers to review for a possible fix in a future release. Until then if you add your fonts in place rather than into the fontvault, your shortcuts keys in InDesign should work fine.
    I'm having this issue on the latest version of InDesign. At first I thought it was related to Suitcase, but after updating Suitcase to the latest version, trashing all my prefs and FontVault, re-adding all my fonts, and clearing all my system's font caches, the problem still happens.
    Then I realized it's not related to Suitcase at all, but to certain font families. I'm not sure what causes it, maybe it's because these families have a Roman, Regular, Bold, Extra Bold, Black, Condensed, Bold Condensed, etc. and it just doesn't know which one to pick, so it does nothing? It should at least toggle between Roman and Bold, though!
    This is a very frustrating problem. Anyone know how to fix it? I even tried making a character style called "Bold" and setting a shortcut for it, but any keys I press to set the shortcut, it just beeps at me and nothing happens! Argh!

  • How to get all paragraphs style and their fonts of a  indesign file and write all info with para info into txt file with scripting

    how to get all how to get all paragraphs style and their fonts of a  indesign file and write all info with para info into txt file with scriptingstyle and their fonts of a  indesign file and write all info with para info into txt file with scripting

    I write the script this one works
              var par=doc.stories.everyItem().paragraphs.everyItem().getElements();
      for(var i=par.length-1;i>=0;i--)
           var font=par[i].appliedParagraphStyle.name;
            var font1=par[i].appliedFont.name;
             var size=par[i].pointSize;
            WriteToFile (par[i].contents  +   "\r" +  "Style  : " + font  + "\r" +  "FONT1  : " + font1  + "\r" +  "Size  : " + size  + "\r", reportFilePath);
                            function WriteToFile(text, reportFilePath) { 
        file = new File(reportFilePath); 
        file.encoding = "UTF-8"; 
        if (file.exists) { 
            file.open("e"); 
            file.seek(0, 2); 
        else { 
            file.open("w"); 
          file.writeln(text);  
        file.close(); 
    Thanks for all your support

  • How to Write in bold to a file using java I/O classes?

    Hi,
    Using I/O classes I want to prepare a .doc file in which some text will be there. I want that text to be formatted. Like some text I want to be bold. Some text to be italic. How can I write bold/Italic text to the file using java I/O classes.
    Thanks
    Prashant

    By .doc file, I'm assuming you mean an MS Word document, yes? (fyi, Word Perfect also used the .doc extension)
    The .doc format is proprietary to Microsoft and isn't documented by them. In order to output a file in .doc format you'd have to understand that format correctly, otherwise MS Word will spit out it's tongue at you, call you names, and maybe send the Microsoft Police to "audit" your PC Software Licensing.
    Fortunately for you there is an open source project to demangle the microsoft file formats. See http://jakarta.apache.org/poi/ and especially pay attention to the HDF project (Horrible Document Format).
    - David

  • Pages error when opening .doc file

    I've recently installed Snow Leopard, but I'm still using Pages 2/iWork '06.
    Before I installed SL, I had the same version of Pages installed for my own work as well NeoOffice to open any .docs I was sent.
    Although I normally used NeoOffice for those .docs, Pages would still open any .doc file, but would normally not display it correctly.
    Since installed SL, I've also installed Pages, but not NeoOffice. I want to open a .doc file with Pages, but when I try to do so, I get an error message, which reads:
    Pages quit unexpectedly while using SLCompatibility plug-in.
    Click Reopen to open the application again. Click Report to see more detailed information and send a report to Apple.
    If I click 'Reopen', Pages opens, but the .doc file doesn't. If I click 'Ignore' (another button), Pages closes.
    The same error and crash occurs whatever .doc file I try to open. It's not just one file.
    I don't know what SLCompatibility plug-in is, those SL could be Snow Leopard.
    Does anyone know what the problem is and how I can fix it?
    Thanks in advance,
    Jonathan.

    Thanks for the reply.
    I'm running 10.6.2 -- I'm not sure what you mean by 'combo' update, but I updated my new installation of SL yesterday with all the updates that software update could find.
    My Pages is version 2.0.2.
    I deleted the specified file, then repaired permissions, but I'm still having exactly the same problem.
    Some .doc files say:
    Pages quit unexpectedly while using SLCompatibility plug-in.
    Click Reopen to open the application again. Click Report to see more detailed information and send a report to Apple.
    Some others say:
    The document "xxxxxx.doc" couldn't be opened
    Do you have any more ideas what's going wrong?
    EDIT: Should I remove the Arial .tff fonts which have minor problems according to Font Book? I don't know much about Font Book. If I remove them, will I still be able to use Arial? I don't want to permanently delete Arial.
    Thanks,
    Jonathan.
    Message was edited by: j.mercer

  • Mixed fonts when exporting ePub file from InDesign

    I am an ePubs newbie and have been watching some of the training videos on Lynda.com and  tried creating my first ePub document today.
    I am having problems with mixed fonts when exporting the file and viewing on iBooks on an iPhone.
    I have a document with paragraphs of text to be in a regular weight and certain words within the paragraphs are to be picked out in bold. So I've used a Paragraph Style for the main text and then used a Character Style to pick out the bold words. Simple enough!!
    On export I am not embedding any fonts as I have unchecked that option on the export dailaogue. I have used the same font family in InDesign, but I cannot work out why I am getting both Serif and Sans Serif fonts displaying when viewing it on the iPhone. The main body appears in the Sans Serif font, but I have the bold character styles, subheads and even the numbers in the numbered lists are all displaying in a Serif Font.
    In iBooks I can change the display font (I have the choices: Georgia, Iowan, Palatino, Seravek and Times New Roman) and this affects the fonts which are displaying as Serif, but the main body font remains constant as a Sans Serif (looks like Helvetica).
    I would ideally like all the fonts in the document to display as Sans Serif with certain words, plus the headings and subheadings to be in the bold weight version of the same font family.
    I've tried this in CS5.5 and CS6 with the same results.
    Can anyone offer any suggestions please.

    Hi Steve,
    Yes, you are correct. It is Anne-Marie Concepcion's videos that I've been watching.
    I understand what you are saying about testing in other readers and I will be looking into that further. However our main task is to get some of our client's manuals and documents into a digital version that can be read on  Apple devices, as these are what are being used by their sales force.
    We have already produced some documents for use on the iPad and have used iBooks Author for that with some success. They have now asked about getting something onto iPhones, so we are now looking into the ePub format to do that. I realise that ePubs can also be used on iPads, but we would still be pushing the iBooks Author files for use on iPads as there is more interactive widgets that can be included. But the main ePub reader that will be used is going to be iBooks, so we are looking to get something to work in that App. Other formats may follow, but we are starting with getting something to work on iBooks first.
    I have tried viewing the file in Adobe Digital Editions as you have suggested and have to say that this displays the file in a way that is certainly more appealing, as the fonts are at least consistent. However, I understand from Anne-Marie's videos that ADE is rather basic and is only intended as a rough proofing device. Which is why I transferred my ePub to my iPhone and iPad to view in iBooks.
    As I have mentioned, I am a total ePub newbie. I come from a mainly print background and my knowledge of CSS and HTML is very basic. I have an understanding of the concepts, but I would always rely on developers to produce websites that I may have designed.
    You seem to be implying that it may be in iBooks where the issues lie and from viewing the file in ADE this would certainly look that way. So I am simply trying to establish what I would need to do to make it work in iBooks in a more satisfactory way.
    I have included some screen grabs below to illustrate my problems...
    ePub viewing in ADE
    If it looked like this on the iPhone I would be relatively happy!!!
    ePub on iPhone
    The main body copy is displaying in a sans serif font (Helvetica?) yet the heading, subheadings, numbers of the numbered lists, address, URL and legal line are all displaying as a serif font. All the style sheets are assigned to the same font family in InDesign (Helvetica). I have managed to get the bold text to appear in the sans serif font, by mapping the character style to the "strong" tag in the Export Tagging dialogue. All other paragraph styles are left as "Automatic".
    I can change the font in iBooks and this affects the displaying of all styles apart from the main body, which stays consistently in the "Helvetica" font.
    iPhone Fonts
    iPad Fonts
    On the iPad I'm also getting some elements coming in justified which looks awfull (see the main heading above). This image also shows how changing to an alternative font changes the heading and subheadings, but does not affect the main body!!!
    Any suggestions???
    Thanks

  • Pages 2.0 is exporting Word files in name.docx format causing duplicates files on my PC via iTunes.  Anyway to have it export name.doc files as Pages did earler?

    Pages 2.0 is exporting Word files in name.docx format causing duplicates files on my PC via iTunes.  Anyway to have it export name.doc files as Pages did earler?

    What I read in the PDF version of the manual (while I was waiting for my plane this afternoon), it seems pretty comprehensive. I was particularly interested in what it had to say about creating your own templates.
    Supposedly, it will remember if I left invisibles showing in templates (one of my big complaints with Pages 1). I'll find out soon enough. I must say that opening my two documents I use for answering posts here in discussions sure did open faster & navigating an 11-page table was much faster.
    Another good thing I noticed, the font used for the serial number is much clearer & there were no confusing characters - O/0, S/5, etc.
    Peggy

  • Opening .doc files from IFS

    Hi,
    I have a question about some functionality in the default web package with ifs. It is probably quite basic, but I am having difficulty with it. In the out of the box web ui, if I click on an uploaded .doc file, Microsoft Word gets loaded in my browser with the file openned.
    I am using the JAVA API, and I have uploaded and foldered a .doc file. When I click on it, href="//computer/path/file.doc" word opens, but I get the file was not found.Any ideas?? Thank you.
    Ian

    Ian
    The decision on which application the browser runs is taken by the browser based on information supplied in the HTTP response.
    Here's an updated version of the RenderContent method that gives you some degree of control over this process...
    // $Header$
    * Please complete these missing tags
    * @author
    * @rref
    * @copyright
    * @concurrency
    * @see
    package ifs.pm.common.jsp;
    import oracle.ifs.adk.http.HttpUtils;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import javax.servlet.ServletInputStream;
    import oracle.ifs.beans.Selector;
    import oracle.ifs.beans.Format;
    import java.util.Enumeration;
    import java.util.Locale;
    import java.net.URLEncoder;
    import java.lang.Class;
    import java.lang.reflect.Method;
    import java.lang.reflect.InvocationTargetException;
    import oracle.ifs.adk.security.IfsHttpLogin;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.io.FileOutputStream;
    import java.io.File;
    import ifs.pm.common.trace.Alert;
    import oracle.ifs.beans.LibraryObject;
    import oracle.ifs.beans.ClassObject;
    import oracle.ifs.beans.Document;
    import oracle.ifs.beans.LibraryObjectDefinition;
    import oracle.ifs.beans.Attribute;
    import oracle.ifs.common.AttributeValue;
    import oracle.ifs.beans.PublicObject;
    import oracle.ifs.beans.FolderPathResolver;
    import oracle.ifs.beans.LibrarySession;
    import oracle.ifs.common.IfsException;
    import oracle.ifs.beans.LibraryService;
    import oracle.ifs.beans.LibrarySession;
    import oracle.ifs.common.CleartextCredential;
    import oracle.ifs.common.ConnectOptions;
    import java.util.Hashtable;
    import java.util.Date;
    import java.text.SimpleDateFormat;
    public class JspHelper extends Object
    public static final String ACTION = "Action";
    public static final String OPERATION = "Operation";
    public static final String POLICY = "Policy";
    public static final String MIMETYPE = "MimeType";
    public static final String OPEN = "Open";
    public static final String DOWNLOAD = "Download";
    public static final String RENDER = "Render";
    public static final String WEBLOGON = "/Login";
    public static final String USERNAME = "username";
    public static final String PASSWORD = "password";
    public static final String SERVICE = "service";
    public static final String SCHEMA_PASSWORD = "schemapassword";
    public static final String IFSHTTPLOGIN = "IfsHttpLogin";
    public static final String IFSWEBROOT = "/ifs/webui";
    public static final String IFSTIMEOUT_URL = "/html/timeout.html";
    private static String m_ServletPath = null;
    private static final boolean DEBUG = true;
    private static final String OPEN_SAVEAS_DIALOG = "oracleifs/download";
    * Please complete the missing tags for JspHelper
    * @param
    * @return
    * @throws
    * @pre
    * @post
    private static Hashtable characterEncoding = new Hashtable();
    static {
    characterEncoding.put("+","%2B");
    characterEncoding.put("#","%23");
    characterEncoding.put("&","%26");
    characterEncoding.put(" ","%20");
    characterEncoding.put("'","%27");
    characterEncoding.put(":","%3A");
    characterEncoding.put("(","%28");
    characterEncoding.put(")","%29");
    characterEncoding.put("-","%2D");
    private static String getServletPath()
    return m_ServletPath;
    public static String generateURL(Long id)
    // Creates an Encoded URL from a Docid
    String url = "";
    if (getServletPath() != null) {
    url = getServletPath();
    url = url + "/";
    url = url + (String) characterEncoding.get(":");
    url = url + id.toString();
    return url;
    public static String generateURL(String path)
    // Creates an Encoded URL from a Docid
    String url = "";
    if (getServletPath() != null) {
    url = getServletPath();
    if (!path.startsWith("/")) {
    url = url + "/";
    url = url + encodePath(path);
    return url;
    private static void setupServletPath(HttpServletRequest req)
    // If never initialized, get the servlet path and store
    // in the static
    if ( null == m_ServletPath )
    String contextPath = null;
    String servletPath = "";
    // Start with an empth string
    m_ServletPath = "";
    //let's figure out whether we're running under Servlet API 2.2
    //or an earlier version
    Class c = req.getClass();
    try
    //getContextPath() is first defined in 2.2
    Method m = c.getMethod("getContextPath", null);
    contextPath = (String)m.invoke(req, null);
    catch (NoSuchMethodException e1)
    catch (InvocationTargetException e2)
    catch (IllegalAccessException e3)
    if (DEBUG) {
    Alert.log("JspHelper.setupServletPath(): contextPath = " + contextPath);
    servletPath = req.getServletPath();
    if (DEBUG) {
    Alert.log("JspHelper.setupServletPath(): servletPath = " + servletPath);
    if ( null != contextPath )
    m_ServletPath = contextPath;
    if ( null != servletPath )
    m_ServletPath += servletPath;
    else
    if (DEBUG) {
    Alert.log("JspHelper.setupServletPath(): not first time through.");
    if (DEBUG) {
    Alert.log ("JspHelper.setupServletPath(): m_ServletPath = " + m_ServletPath);
    private static String getReposPath( HttpServletRequest request )
    String result = null;
    String path = request.getParameter(DOCUMENT_PATH);
    if (null == path) {
    path = request.getParameter(ALTERNATIVE_PATH);
    return getReposPath(path);
    public static String getReposPath(String path)
    if (DEBUG) {
    Alert.log ("JspHelper.getReposPath(request): Initial Path = " + path);
    if (path != null) {
    if ( ( null != getServletPath() ) && path.startsWith(getServletPath())) {
    path = path.substring(getServletPath().length());
    if (DEBUG) {
    Alert.log ("JspHelper.getReposPath(request): Stripped Path = " + path);
    path = undoSubstitutions(path);
    if (DEBUG) {
    Alert.log ("JspHelper.getReposPath(request): Converted Path = " + path);
    if (DEBUG) {
    Alert.log("JspHelper.getReposPath(request) Final Path = " + path);
    return path;
    public static String encodePath(String path)
    // Substitute '%', then everything else
    path = replaceString(path,"%","%25");
    return doSubstitutions(path);
    public static String decodePath(String path)
    path = undoSubstitutions(path);
    return replaceString(path,"%25","%");
    public static String doSubstitutions(String path)
    String encodedPath = path;
    Enumeration keys = characterEncoding.keys();
    while (keys.hasMoreElements()) {
    String source = (String) keys.nextElement();
    String target = (String) characterEncoding.get(source);
    encodedPath = replaceString(encodedPath,source,target);
    return encodedPath;
    public static String undoSubstitutions(String path)
    String encodedPath = path;
    Enumeration keys = characterEncoding.keys();
    while (keys.hasMoreElements()) {
    String source = (String) keys.nextElement();
    String target = (String) characterEncoding.get(source);
    encodedPath = replaceString(encodedPath,target,source);
    return encodedPath;
    public static String getReposPath( HttpServletRequest request )
    return HttpUtils.getIfsPathFromJSPRedirect(request);
    public static String generateURL(HttpServletRequest request, Long id)
    return HttpUtils.getURLFromIfsPath(request,":" + id.toString());
    public static String generateURL(HttpServletRequest request, String path)
    return HttpUtils.getURLFromIfsPath(request,path);
    public JspHelper()
    IfsException.setVerboseMessage( true );
    * Please complete the missing tags for getArgumentAsString
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static String getArgumentAsString( Object arg )
    if( null == arg )
    return "";
    else
    return arg.toString();
    * Please complete the missing tags for getArgumentAsString
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static String getArgumentAsString( String formatMask, Date arg )
    if( null == arg )
    return "";
    else
    SimpleDateFormat sdf = new SimpleDateFormat( formatMask );
    return sdf.format( arg );
    * Please complete the missing tags for getSession
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static LibrarySession getSession( HttpServletRequest request, HttpServletResponse response )
    throws IfsException
    if( DEBUG )
    Alert.log( "getSession(request,response): Entering Method." );
    dumpServletParameters( request );
    // setupServletPath(request);
    LibrarySession ifsSession = null;
    HttpSession httpSession = request.getSession( true );
    if( null != httpSession )
    IfsHttpLogin ifsLogin = ( IfsHttpLogin ) httpSession.getValue( IFSHTTPLOGIN );
    if( ifsLogin != null )
    ifsSession = ifsLogin.getSession();
    if( null == ifsSession )
    try
    // String timeoutPath = generateURL(request,getTimeOutURL());
    String timeoutPath = HttpUtils.getURLFromIfsPath( request, getTimeOutURL() );
    if( DEBUG )
    Alert.log( "getSession(request,response): Unable to get a valid Session = assuming Timeout problem. Redirecting to " + timeoutPath );
    response.sendRedirect( timeoutPath );
    catch( IOException ioe )
    throw new IfsException( 9999, ioe );
    return ifsSession;
    * Please complete the missing tags for getObject
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static PublicObject getObject( HttpServletRequest request, HttpServletResponse response )
    throws IfsException
    // Will return null and set a Redirect to the Timeout Page if the Sesssion
    // is null.
    String path = null;
    PublicObject po = null;
    LibrarySession ifsSession = getSession( request, response );
    if( null != ifsSession )
    // path = getReposPath(request);
    path = HttpUtils.getIfsPathFromJSPRedirect( request );
    if( path.charAt( 1 ) == ':' )
    Long docId = new Long( path.substring( 2 ) );
    po = ifsSession.getPublicObject( docId );
    else
    FolderPathResolver fpr = new FolderPathResolver( ifsSession );
    fpr.setRootFolder();
    po = fpr.findPublicObjectByPath( path );
    if( DEBUG )
    Alert.log( "getObject(request,response): Object is a " + po.getClassname() );
    po = po.getResolvedPublicObject();
    return po;
    * Please complete the missing tags for getExtendedAttributeValues
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static LibraryObjectDefinition getExtendedAttributeValues( LibraryObject lo, HttpServletRequest request )
    throws IfsException
    // Returns a Library Object Definition containing the Attribute Values for each
    // Extended Attribute which appears as a parameter in the request obvject.
    ClassObject co = lo.getClassObject();
    Attribute [] attributes = co.getExtendedClassAttributes();
    return getAttributeValues( attributes, request );
    * Please complete the missing tags for getEffectiveAttributeValues
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static LibraryObjectDefinition getEffectiveAttributeValues( LibraryObject lo, HttpServletRequest request )
    throws IfsException
    // Returns a Library Object Definition containing the Attribute Values for each
    // Extended Attribute which appears as a parameter in the request obvject.
    ClassObject co = lo.getClassObject();
    Attribute [] attributes = co.getEffectiveClassAttributes();
    return getAttributeValues( attributes, request );
    * Please complete the missing tags for getAttributeValues
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static LibraryObjectDefinition getAttributeValues( Attribute [] attributes, HttpServletRequest request )
    throws IfsException
    LibraryObjectDefinition def = new LibraryObjectDefinition();
    if( attributes != null )
    for( int i = 0; i < attributes.length; i++ )
    AttributeValue av = getAttributeValue( attributes [ i ], request );
    if( av != null )
    def.setAttribute( av );
    return def;
    * Please complete the missing tags for getAttributeValue
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static AttributeValue getAttributeValue( Attribute attribute, HttpServl etRequest request )
    throws IfsException
    AttributeValue av = null;
    String name = attribute.getName();
    String newValue = request.getParameter( name );
    if( newValue != null )
    if( newValue.equals( "" ) )
    av = AttributeValue.newNullAttributeValue( attribute.getDataType() );
    else
    av = AttributeValue.newAttributeValue( newValue );
    av.setName( name );
    return av;
    * Please complete the missing tags for downloadContent
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static void downloadContent( HttpServletRequest request, HttpServletResponse response )
    throws IfsException
    boolean download = false;
    String action = request.getParameter( ACTION );
    if( action != null )
    if( action.equals( DOWNLOAD ) )
    download = true;
    Alert.log( "JspHelper.downloadContent(): download = " + download );
    try
    Document doc = ( Document ) JspHelper.getObject( request, response );
    OutputStream os = response.getOutputStream();
    if( download )
    response.setContentType( OPEN_SAVEAS_DIALOG );
    response.setHeader( "Content-Disposition", "attachment; filename=" + doc.getName() );
    else
    response.setContentType( doc.getFormat().getMimeType() );
    response.setHeader( "Content-Disposition", "inline; filename=" + doc.getName() );
    response.setContentLength( ( int ) doc.getContentSize() );
    InputStream is = doc.getContentStream();
    byte [] bytesRead = new byte [ 1024 ];
    for( int byteCount = is.read( bytesRead, 0, bytesRead.length );
    byteCount > 0;
    byteCount = is.read( bytesRead, 0, bytesRead.length ) )
    os.write( bytesRead, 0, byteCount );
    catch( Exception e )
    throw new IfsException( 9999, e );
    * Please complete the missing tags for dumpServletParameters
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static void dumpServletParameters( HttpServletRequest request )
    // setupServletPath(request);
    Enumeration parmList = request.getParameterNames();
    Alert.log( "Parameter List:" );
    while( parmList.hasMoreElements() )
    String parmName = ( String ) parmList.nextElement();
    Alert.log( " " + parmName );
    Alert.log( "Parameter Processing Completed." );
    * Please complete the missing tags for obtainSession
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static LibrarySession obtainSession( HttpServletRequest request, HttpServletResponse response )
    throws IfsException
    if( DEBUG )
    Alert.log( "obtainSession(request,response): Servlet Parameters = " );
    dumpServletParameters( request );
    // setupServletPath(request);
    HttpSession httpSession = request.getSession( true );
    if( httpSession != null )
    IfsHttpLogin ifsLogin = ( IfsHttpLogin ) httpSession.getValue( IFSHTTPLOGIN );
    if( ifsLogin != null )
    LibrarySession ifsSession = ifsLogin.getSession();
    if( ifsSession != null )
    return ifsSession;
    if( DEBUG )
    Alert.log( "JspHelper.obtainSession: Unable to get Session. - Attempting to create new Session" );
    LibrarySession ifs = null;
    String username = "guest";
    String password = "welcome";
    String service = "IfsDefault";
    String schemaPassword = "manager";
    String suppliedUsername = request.getParameter( USERNAME );
    String suppliedPassword = request.getParameter( PASSWORD );
    String suppliedService = request.getParameter( SERVICE );
    String suppliedSchemaPassword = request.getParameter( SCHEMA_PASSWORD );
    if( suppliedUsername != null )
    username = suppliedUsername;
    if( suppliedPassword != null )
    password = suppliedUsername;
    if( suppliedService != null )
    service = suppliedService;
    if( suppliedSchemaPassword != null )
    schemaPassword = suppliedSchemaPassword;
    if( DEBUG )
    Alert.log( "JspHelper.obtainSession: Creating new Session." );
    Alert.log( " Username = " + username );
    Alert.log( " Password = " + password );
    Alert.log( " Service = " + service );
    Alert.log( " Schema Password = " + schemaPassword );
    LibraryService ifsService = new LibraryService();
    CleartextCredential me = new CleartextCredential( username, password );
    ConnectOptions connect = new ConnectOptions();
    connect.setLocale( Locale.getDefault() );
    connect.setServiceName( service );
    connect.setServicePassword( schemaPassword );
    LibrarySession ifsSession = ifsService.connect( me, connect );
    if( DEBUG )
    Alert.log( "JspHelper.obtainSession: Session Created." );
    JspLogin login = new JspLogin();
    login.setSession( ifsSession );
    httpSession.putValue( IFSHTTPLOGIN, login );
    if( DEBUG )
    Alert.log( "JspHelper.obtainSession: Login Object Saved." );
    return ifsSession;
    * Please complete the missing tags for replaceString
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static String replaceString( String string, String string1, String string2 )
    int offset = string.indexOf( string1 );
    switch( offset )
    case - 1 :
    return string;
    case 0 :
    return string2 + replaceString( string.substring( string1.length() ), string1, string2 );
    default:
    return string.substring( 0, offset ) + string2 + replaceString( string.substring( offset + string1.length() ), string1, string2 );
    * Please complete the missing tags for printLink
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static void printLink( javax.servlet.jsp.JspWriter out,
    String name,
    String url,
    String color )
    throws java.io.IOException
    if( null != url )
    if( url.indexOf( "http://" ) != 0 )
    url = "http://" + url;
    out.println( "<BR><A HREF=\"" + url + "\"><FONT COLOR=\"" + color + "\"><B>" + name + "</B></FONT></A>" );
    * Please complete the missing tags for printItem
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static void printItem( javax.servlet.jsp.JspWriter out,
    String titleValue,
    String dataValue,
    String titleColor,
    String dataColor )
    throws java.io.IOException
    if( null != dataValue )
    out.println( "<FONT COLOR=\"" + titleColor + "\">" + titleValue + ": </FONT> <FONT COLOR=\"" + dataColor + "\"><B>" + dataValue + "</B></FONT><BR>" );
    * Please complete the missing tags for printItem
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static void printItem( javax.servlet.jsp.JspWriter out,
    String titleValue,
    Integer dataValue,
    String titleColor,
    String dataColor )
    throws java.io.IOException
    if( null != dataValue )
    printItem( out, titleValue, dataValue.toString(), titleColor, dataColor );
    * Please complete the missing tags for printItem
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static void printItem( javax.servlet.jsp.JspWriter out,
    String titleValue,
    Boolean dataValue,
    String titleColor,
    String dataColor )
    throws java.io.IOException
    if( null != dataValue )
    printItem( out, titleValue, dataValue.toString(), titleColor, dataColor );
    * Please complete the missing tags for printItem
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static void printItem( javax.servlet.jsp.JspWriter out,
    String titleValue,
    Date dataValue,
    String titleColor,
    String dataColor )
    throws java.io.IOException
    if( null != dataValue )
    printItem( out, titleValue, dataValue.toString(), titleColor, dataColor );
    * Please complete the missing tags for renderContent
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static void renderContent( HttpServletRequest request, HttpServletResponse response )
    throws IfsException
    Document doc = ( Document ) JspHelper.getObject( request, response );
    boolean download = false;
    boolean renderedOutput = false;
    String mimeType = null;
    // Determine if we are opening or Downloading Content based on Action
    String action = request.getParameter( ACTION );
    if( action != null )
    if( action.equals( DOWNLOAD ) )
    download = true;
    if( DEBUG )
    Aler t.log( "JspHelper.downloadContent(): download = " + download );
    // Determine is we want Raw or Rendered Content. For Rendered Content both
    // Operation and Policy must be supplied.
    String operation = request.getParameter( OPERATION );
    String policy = request.getParameter( POLICY );
    if( ( null != operation ) && ( null != policy ) )
    renderedOutput = true;
    if( DEBUG )
    Alert.log( "JspHelper.downloadContent(): renderedOutput = " + renderedOutput );
    // Determine if contentType comes from Document or is supplied explicity.
    mimeType = request.getParameter( MIMETYPE );
    if( null == mimeType )
    mimeType = doc.getFormat().getMimeType();
    if( DEBUG )
    Alert.log( "JspHelper.downloadContent(): mimeType = " + mimeType );
    // Process as Requested.
    try
    response.setContentType( mimeType );
    String filename = doc.getName();
    String fileExtension = filename.substring( filename.lastIndexOf( '.' ) + 1 );
    filename = filename.substring( 0, filename.lastIndexOf( '.' ) - 1 );
    Selector mySelector = new Selector( getSession( request, response ) );
    mySelector.setSearchClassname( Format.CLASS_NAME );
    mySelector.setSearchSelection( Format.MIMETYPE_ATTRIBUTE + "='" + mimeType + "'" );
    if( mySelector.getItemCount() > 0 )
    Format f = ( Format ) mySelector.getItems( 0 );
    fileExtension = f.getExtension();
    filename = filename + '.' + fileExtension;
    if( DEBUG )
    Alert.log( "JspHelper.RenderContent(): Filename = " + filename );
    if( download )
    response.setHeader( "Content-Disposition", "attachment; filename=" + filename );
    else
    response.setHeader( "Content-Disposition", "inline; filename=" + filename );
    InputStream is;
    if( renderedOutput )
    is = doc.renderAsStream( operation, policy, null );
    else
    is = doc.getContentStream();
    response.setContentLength( ( int ) doc.getContentSize() );
    OutputStream os = response.getOutputStream();
    byte [] bytesRead = new byte [ 1024 ];
    for( int byteCount = is.read( bytesRead, 0, bytesRead.length );
    byteCount > 0;
    byteCount = is.read( bytesRead, 0, bytesRead.length ) )
    os.write( bytesRead, 0, byteCount );
    catch( Exception e )
    throw new IfsException( 9999, e );
    * Please complete the missing tags for dumpInputStream
    * @param
    * @return
    * @throws
    * @pre
    * @post
    public static void dumpInputStream( ServletInputStream sis )
    throws IOException
    FileOutputStream fos;
    if( File.separator.equals( "\\" ) )
    fos = new FileOutputStream( "C:\\temp\\request.txt" );
    else
    fos = new FileOutputStream( "/tmp/request.txt" );
    byte [] bytes = new byte [ 1024 ];
    for( int bytesRead = sis.readLine( bytes, 0, bytes.length );
    bytesRead > 0;
    bytesRead = sis.read( bytes, 0, bytes.length ) )
    Alert.log( "JspHelper.dumpInputStream() BytesRead = " + bytesRead );
    fos.write( bytes, 0, bytesRead );
    fos.close();
    * Please complete the missing tags for getTimeOutURL
    * @param
    * @return
    * @throws
    * @pre
    * @post
    private static String getTimeOutURL()
    Locale locale = Locale.getDefault();
    String country = locale.getCountry();
    String language = locale.getLanguage().toLowerCase();
    String localizedFolder = language;
    if( country != null )
    if( ( ! language.equalsIgnoreCase( "en" ) ) &#0124; &#0124;
    ( ( language.equalsIgnoreCase( "en" ) ) && ( ! country.equalsIgnoreCase( "US" ) ) ) )
    language = language + "_" + country.toUpperCase();
    return IFSWEBROOT + "/" + language + IFSTIMEOUT_URL;
    null

  • Crashing when loading .doc file

    I have a 14 page .doc file that I was hoping to review on my iPad. when I select it from the file folder on in Pages on the iPad, it apears to load it - and then displays a set of errors (like The missing font ... was replaced by ...) and then it Pages crashes and exits.
    Is this the expected behavior from this $9.99 software? File available and screenshot of error messages available.

    It depends on the exact error... can you post it???
    iWork for iPad is a very different beast than iWork for MACs...
    There are some items, mostly the spruce up stuff like fonts and such that are loaded in iWork for MAC but not in iWork for iPad...
    If the doc you're attempting to load happens to have either more than one item iWork for iPad doesn't include or even just one main item like if all text in the doc is a font that iPad doesn't have...then yes I guess this is expected behavior...although very frustrating behavior

Maybe you are looking for