Home   
   Domini   
   Siti   
   Indicizzazione   
   Contatto   
   Specials   
   Games   

 


 
Grafica 3D in PDF con ASP Grafica 3D in PDF con ASP NET Convertire JPEG in PDF con ASP Convertire JPEG in PDF con ASP NET Creare PDF con ASP Proprietà PDF a nuovo PDF Creare PDF con ASP via HTTP Aggiungere commento a PDF con ASP
Creare PDF con Form via ASP Gestire PDF via ASP Aggiungere grafica a PDF con ASP HTML da file TXT via ASP Importare da URL in PDF con ASP PDF Bookmark con ASP Da PDF in JPEG via ASP Lettura MDB con PDF via ASP
Moduli PDF via ASP Creare PDF con ASP NET Creare PDF con ASP NET via HTTP Aggiungere commento a PDF con ASP NET Creare PDF con Form via ASP NET Gestire PDF via ASP NET HTML da file TXT via ASP NET Importare da URL in PDF con ASP NET
Maschera PDF con ASP NET Creare PDF con ASP NET e MDB Da PDF a PNG via ASP NET Estrarre testo da PDF via ASP NET Unire documenti PDF via ASP NET Da PDF a PNG via ASP Estrarre testo da PDF via ASP Unire documenti PDF via ASP
Inserire commento in PDF Maschera PDF con ASP PDF Bookmark con ASP NET Convertire TIFF in PDF con ASP Compilare PDF con Form via ASP Creare PDF con ASP e MDB Lettura MDB con PDF via ASP NET Convertire TIFF in PDF con ASP NET

Generare PDF da codice HTML contenuto in file di testo [*.TXT] attraverso asp

nota bene: lo script nella versione "copia e incolla" che segue, presuppone permessi di scrittura lato server .. in paritcolare, è la root o cartella di destinazione del nuovo documento PDF che deve possedere i permessi di scrittura [chmod "666" - "777"] ..e l' utilizzo è di assoluta facilità: copia inclolla e salva come *.asp
RICHIEDE FILE TXT

CODICE:

<%
Set Pdf = Server.CreateObject("Persits.Pdf")

Set Doc = Pdf.CreateDocument

' Small pages - to demonstrate text spanning
Set page = Doc.Pages.Add( 300, 300 )

' Use Arial font
Set Font = Doc.Fonts("Arial")

' Load string from file
Text = Pdf.LoadTextFromFile(Server.MapPath("html.txt") )

' Parameters: X, Y of upper-left corner of text box, Height, Width, HTML=true
Set param = pdf.CreateParam("x=10; y=290; width=280; height=280; html=true")

Do While Len(Text) > 0
CharsPrinted = Page.Canvas.DrawText(Text, param, Font )

' Save HTML tag generated by DrawText to reflect current font state
HtmlTag = Page.Canvas.HtmlTag

' We printed the entire string. Exit loop.
if CharsPrinted = Len(Text) Then Exit Do

' Otherwise print remaining text on next page
Set Page = Page.NextPage

Text = HtmlTag & Right( Text, Len(Text) - CharsPrinted)
Loop

' Save document, the Save method returns generated file name
Filename = Doc.Save( Server.MapPath("/public/html-asp.pdf"), False )

Response.Write "fatto!, file pdf generato da html, scarica <A HREF=/public/" & Filename & ">qui</A>"
%>

 





fonte accreditata aruba.it