Visualizzazione dei risultati da 1 a 5 su 5

Discussione: jpg dentro file rtf

  1. #1

    jpg dentro file rtf

    ciao a tutti,
    un cortesia vorrei poter inserire un jpg dentro un file RTF di word nel posto che voglio io:

    ho trovato questo codice ma non mi da la possibilità di specificare dove inserire jpg in piu vorrei che il file non viene salvato ma aperto prima poi dicedo io se salvare o meno:

    qui sotto il codice... grazie per ogni risposta

    <%
    Function ZeroPad(vItem, nLen)
    ZeroPad = vItem
    Do While Len(ZeroPad) < nLen
    ZeroPad = "0" & ZeroPad
    Loop
    End Function

    Set oFS = Server.CreateObject("Scripting.FileSystemObject")
    Set oRTF = oFS.CreateTextFile(Server.MapPath(".") & "\test.rtf", True)

    oRTF.WriteLine("{\rtf1")

    'Write the font table
    sRTF = "{\fonttbl {\f0\froman\fcharset0 Times New Roman;}" & _
    "{\f1\froman\fcharset0 Times New Roman;}" & _
    "{\f2\fmodern\fcharset0 Courier New;}}"
    oRTF.WriteLine sRTF

    'Write the title and author for the document properties
    oRTF.WriteLine "{\info{\title Output to RTF}{\author SomeGuy}}"

    oRTF.WriteLine "this is a jpeg>>>"

    'JPEG Header thing
    oRTF.WriteLine "{\*\shppict{\pict\jpegblip"

    'Our JPEG file to read
    Set oPic = oFS.OpenTextFile(Server.MapPath(".") & "\test.jpg", 1, False)

    'Transform binary to a BLIP
    sData = ""
    Do While Not oPic.AtEndOfStream
    sData = sData & LCase(ZeroPad(Hex(Asc(oPic.Read(1))),2))
    If Len(sData) Mod 128 = 0 Then
    oRTF.WriteLine sData
    sData = ""
    End If
    Loop

    If Len(sData) > 0 Then
    oRTF.WriteLine sData
    End If

    'End of JPEG Header
    oRTF.WriteLine "}}"

    oRTF.WriteLine "<<<"
    oRTF.WriteLine "}"

    %>

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Crea un RTF mettici dentro la jpg dove vuoi tu e poi guarda il codice.

    Roby

  3. #3
    non è quello che voglio. ma il jpg cambia in base all'utente che usa il gestionale. in pochi parole è una firma dell'utente che deve apparire sul file rtf ogni volta che l'utente compila una domanda quindi un jpg che varia.

    grazie di aiutarmi.

  4. #4
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Questo era evidente...
    Ma se non riesci a crearlo prima in maniera "statica" non potrai mai farlo diventare "dinamico".

    Roby

  5. #5
    in maniera statica sono riuscito a farne diversi report... attualmente con i report rtf l'unico problema che non riesco ancora a sviluppare e quello di immagine in modo dinamico.

    se sai come se fa mi fareste un piacere.


    grazie

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.