Diff for /Amaya/amaya/HTMLbook.c between versions 1.74 and 1.75

version 1.74, 2000/10/07 10:56:39 version 1.75, 2000/10/09 13:23:01
Line 425  Document            doc; Line 425  Document            doc;
   ThotBool           status, textFile;    ThotBool           status, textFile;
   
   textFile = (DocumentTypes[doc] == docText ||    textFile = (DocumentTypes[doc] == docText ||
                 DocumentTypes[doc] == docSource ||
               DocumentTypes[doc] == docCSS);                DocumentTypes[doc] == docCSS);
   
    CheckPrintingDocument (doc);    CheckPrintingDocument (doc);
    ustrcpy (viewsToPrint, TEXT("Formatted_view "));    ustrcpy (viewsToPrint, TEXT("Formatted_view "));
    if (!textFile && WithToC)    if (DocumentTypes[doc] == docHTML && WithToC)
      ustrcat (viewsToPrint, TEXT("Table_of_contents "));      ustrcat (viewsToPrint, TEXT("Table_of_contents "));
     
     if (textFile)
       {
         if (PageSize == PP_A4)
           {
             if (Orientation == PP_Landscape)
               TtaSetPrintSchema (TEXT("TextFilePL"));
             else
               TtaSetPrintSchema (TEXT("TextFilePP"));
           }
         else
           {
             if (Orientation == PP_Landscape)
               TtaSetPrintSchema (TEXT("TextFileUSL"));
             else
               TtaSetPrintSchema (TEXT("TextFilePPUS"));
           }
       }
     else if (DocumentTypes[doc] == docSVG)
       TtaSetPrintSchema (TEXT("GraphMLP"));
     else if (DocumentTypes[doc] == docMath)
       TtaSetPrintSchema (TEXT("MathMLP"));
     else if (DocumentTypes[doc] == docAnnot)
       TtaSetPrintSchema (TEXT("AnnotP"));
     else if (DocumentTypes[doc] == docHTML && NumberLinks)
       /* display numbered links */
       {
         /* associate an attribute InternalLink with all anchors refering
            a target in the same document.  This allows P schemas to work
            properly */
         SetInternalLinks (DocPrint);
         if (PageSize == PP_A4)
           {
             if (Orientation == PP_Landscape)
               TtaSetPrintSchema (TEXT("HTMLPLL"));
             else
               TtaSetPrintSchema (TEXT("HTMLPLP"));
           }
         else
           {
             if (Orientation == PP_Landscape)
               TtaSetPrintSchema (TEXT("HTMLUSLL"));
             else
               TtaSetPrintSchema (TEXT("HTMLPLPUS"));
           }
         ustrcat (viewsToPrint, TEXT("Links_view "));
       }
     else if (PageSize == PP_A4)
       {
         if (Orientation == PP_Landscape)
           TtaSetPrintSchema (TEXT("HTMLPL"));
         else
           TtaSetPrintSchema (TEXT("HTMLPP"));
       }
     else
       {
         if (Orientation == PP_Landscape)
           TtaSetPrintSchema (TEXT("HTMLUSL"));
         else
           TtaSetPrintSchema (TEXT("HTMLPPUS"));
       }    
     
     status = TtaIsDocumentModified (doc);
   
    if (textFile)    if (textFile || DocumentTypes[doc] == docImage ||
      {        DocumentTypes[doc] == docHTML)
         if (PageSize == PP_A4)      {
           {        /* post or remove the PrintURL attribute */
            if (Orientation == PP_Landscape)        attrType.AttrSSchema = TtaGetDocumentSSchema (doc);
              TtaSetPrintSchema (TEXT("TextFilePL"));        if (textFile)
            else          attrType.AttrTypeNum = TextFile_ATTR_PrintURL;
              TtaSetPrintSchema (TEXT("TextFilePP"));        else
           }          attrType.AttrTypeNum = HTML_ATTR_PrintURL;
         else        el =  TtaGetMainRoot (doc);
           {        attr = TtaGetAttribute (el, attrType);
            if (Orientation == PP_Landscape)        if (!attr && PrintURL)
              TtaSetPrintSchema (TEXT("TextFileUSL"));          {
            else            attr = TtaNewAttribute (attrType);
              TtaSetPrintSchema (TEXT("TextFilePPUS"));            TtaAttachAttribute (el, attr, doc);
           }          }
      }        if (attr && !PrintURL)
    else if (NumberLinks)          TtaRemoveAttribute (el, attr, doc);
      /* display numbered links */      }
      {    
        /* associate an attribute InternalLink with all anchors refering    /* get the path dir where css files have to be stored */
           a target in the same document.  This allows P schemas to work    if (DocumentTypes[doc] == docHTML && !IgnoreCSS)
           properly */      {
        SetInternalLinks (DocPrint);        TtaGetPrintNames (&files, &dir);
        if (PageSize == PP_A4)        /* store css files and get the list of names */
          {        files = CssToPrint (doc, dir);
            if (Orientation == PP_Landscape)      }
              TtaSetPrintSchema (TEXT("HTMLPLL"));    else
            else      files = NULL;
              TtaSetPrintSchema (TEXT("HTMLPLP"));    TtaPrint (DocPrint, viewsToPrint, files);
          }    if (files)
        else      TtaFreeMemory (files);
          {    if (!status)
            if (Orientation == PP_Landscape)      TtaSetDocumentUnmodified (doc);
              TtaSetPrintSchema (TEXT("HTMLUSLL"));  
            else  
              TtaSetPrintSchema (TEXT("HTMLPLPUS"));  
          }  
        ustrcat (viewsToPrint, TEXT("Links_view "));  
      }  
    else if (PageSize == PP_A4)  
      {  
            if (Orientation == PP_Landscape)  
              TtaSetPrintSchema (TEXT("HTMLPL"));  
            else  
              TtaSetPrintSchema (TEXT("HTMLPP"));  
      }  
    else  
      {  
            if (Orientation == PP_Landscape)  
              TtaSetPrintSchema (TEXT("HTMLUSL"));  
            else  
              TtaSetPrintSchema (TEXT("HTMLPPUS"));  
      }      
      
    /* post or remove the PrintURL attribute */  
    el =  TtaGetMainRoot (doc);  
    status = TtaIsDocumentModified (doc);  
    attrType.AttrSSchema = TtaGetDocumentSSchema (doc);  
    if (textFile)  
      attrType.AttrTypeNum = TextFile_ATTR_PrintURL;  
    else  
      attrType.AttrTypeNum = HTML_ATTR_PrintURL;  
    attr = TtaGetAttribute (el, attrType);  
    if (attr == 0 && PrintURL)  
      {  
         attr = TtaNewAttribute (attrType);  
         TtaAttachAttribute (el, attr, doc);  
      }  
   
    if (attr != 0 && !PrintURL)  
      TtaRemoveAttribute (el, attr, doc);  
    /* get the path dir where css files have to be stored */  
    if (textFile || IgnoreCSS)  
      files = NULL;  
    else  
      {  
        TtaGetPrintNames (&files, &dir);  
        /* store css files and get the list of names */  
        files = CssToPrint (doc, dir);  
      }  
    TtaPrint (DocPrint, viewsToPrint, files);  
    TtaFreeMemory (files);  
    if (!status)  
      TtaSetDocumentUnmodified (doc);  
 }  }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------

Removed from v.1.74  
changed lines
  Added in v.1.75


Webmaster