• Das Erstellen neuer Accounts wurde ausgesetzt. Bei berechtigtem Interesse bitte Kontaktaufnahme über die üblichen Wege. Beste Grüße der Admin

IE Templateprinter ??

Comet

Administrator
Wer hat schon was damit gemacht??

Hab folgendes Snippet von MS und bekomms nicht zum Laufen:

Code:
<HTML XMLNS:IE>
<HEAD>
<?IMPORT NAMESPACE="IE" IMPLEMENTATION="#default">
<STYLE TYPE="text/css">
.lorstyle
{
    width:5.5in;
    height:8in;
    margin:1in;
    background:white;   
    border:1 dashed gray;
}
.pagestyle
{ 
    background:white;
    border-left:1 solid black;
    border-top:1 solid black;
    border-right:4 solid black;
    border-bottom:4 solid black;
    width:8.5in;
    height:11in;
    margin:10px;
    overflow:hidden;
}
.headerstyle
{
    position:absolute;
    top:.25in;
    width:5.5in;
    left:1in;
}
.footerstyle
{
    position:absolute;
    top:10.5in;
    width:5.5in;
    left:1in;
}
</STYLE>
<SCRIPT LANGUAGE="JScript">
var iNextPageToCreate = 1;

function AddFirstPage()
{
    newHTML  = "<IE: DEVICERECT ID='page1' MEDIA='print' CLASS='pagestyle'>";
    newHTML += "<IE:LAYOUTRECT ID='layoutrect1' CONTENTSRC='index.php' ONLAYOUTCOMPLETE='OnRectComplete()' NEXTRECT='layoutrect2' CLASS='lorstyle'/>";
    newHTML += "</IE: DEVICERECT>";

    pagecontainer.insertAdjacentHTML("afterBegin", newHTML);

    headfoot.textHead = printer.header;
    headfoot.textFoot = printer.footer;
    headfoot.url = dialogArguments.__IE_BrowseDocument.URL;
    headfoot.title = dialogArguments.__IE_BrowseDocument.title;
    headfoot.page = 1;
    AddHeaderAndFooterToPage(1);

    iNextPageToCreate = 2;
}

function OnRectComplete()
{
    if (event.contentOverflow == true)
        AddNewPage();
    else
    {
        headfoot.pageTotal = document.all.tags("DEVICERECT").length;
        
        for (i = 1; i <= headfoot.pageTotal; i++)
            AddPageTotalToPages(i);
    }
}

function AddNewPage()
{
    document.all("layoutrect" + (iNextPageToCreate - 1)).onlayoutcomplete = null;
    headfoot.page = iNextPageToCreate;
    
    newHTML  = "<IE: DEVICERECT ID='page" + iNextPageToCreate +  "' MEDIA='print' CLASS='pagestyle'>";
    newHTML += "<IE:LAYOUTRECT ID='layoutrect" + iNextPageToCreate + "' ONLAYOUTCOMPLETE='OnRectComplete()' NEXTRECT='layoutrect" + (iNextPageToCreate + 1) + "'  CLASS='lorstyle'/>";
    newHTML += "</IE: DEVICERECT>";

    pagecontainer.insertAdjacentHTML("beforeEnd", newHTML);
    AddHeaderAndFooterToPage(iNextPageToCreate);
    iNextPageToCreate++;
}

function AddHeaderAndFooterToPage(pageNum)
{
    newHeader = "<DIV CLASS='headerstyle'>" + headfoot.htmlHead + "</DIV>";
    newFooter = "<DIV CLASS='footerstyle'>" +headfoot.htmlFoot + "</DIV>";
    
    document.all("page" + pageNum).insertAdjacentHTML("afterBegin", newHeader); 
    document.all("page" + pageNum).insertAdjacentHTML("beforeEnd", newFooter);
}

function AddPageTotalToPages()
{
    oSpanCollection = document.all.tags("span");
    for (i = 0; i < oSpanCollection.length; i++)
    {
        if (oSpanCollection[i].className == "hfPageTotal")
            oSpanCollection[i].innerText = headfoot.pageTotal;
    }
}
</SCRIPT>
</HEAD>

<BODY ONLOAD="AddFirstPage()">

<IE:TEMPLATEPRINTER ID="printer"/>
<IE:HEADERFOOTER ID="headfoot"/>

<DIV ID="pagecontainer">
<!-- Dynamically created pages go here. -->
</DIV>

</BODY>
</HTML>

Unter anderem ist dem IE (Ver.6.0) das Objekt dialogArguments unbekannt obwohl das Skript ja von MS selbst stammt :rolleyes:

Vielleicht weiß ja jemand bescheid.

Danke
 
Zurück
Oben