Results 1 to 10 of 10

Thread: Creating PDF files from HTLM files

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    90

    Creating PDF files from HTLM files

    Is there a free tool somewhere that will take a HTML file and create PDF files? Thanks!

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    oh btw , this place only for code . You could've asked in General Software forum .

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Jul 2003
    Posts
    90
    Thanks, but actually I was looking for a tool that I could use in VB.Net code. Some kind of API or OCX? Any recommendations?

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Well , you could've mentioned that in your first question . Anyways , I've seen couple of threads dicussing this issue . Also , Acrobat site has some APIs with documentation . If you couldn't find them , let me know .

  6. #6
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    there's at sourceforge an .net wrapper for pdf

    look it there
    \m/\m/

  7. #7

  8. #8
    Lively Member
    Join Date
    May 2002
    Posts
    94
    I just got done writting a program that takes a html and converts it to a PDF file then faxes or emails it to the recipeient, I can't post the code due to company regulations but heres what process I envoked...


    Code:
    I used adobe 5.0 PDF Writer...
    
    use the navigate2 function to load the file into the browser..
    
    use the readystate to see if it is loaded
    
    set the adobe writer as the default printer if not already set.
    
    set the reg settings for the adobe writer located here:
    current user\Software\Adobe\Acrobat PDFWriter
    
    the settings to add are these
    bDocInfo = 0
    bExecViewer = 0
    PDFFileName = "c:\myfilelocation\myfile.pdf"
    
    
    call the browsers ExecWB function to print the params are
    OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER
    
    then do a loop until a file is created.
    this will print the browser without any user interaction, once the pdf writer has created your document the reg setting for the filename will dissaprear.

    good luck

    sorry that its not actually code, but it should help you get started. and this way you could write it in vb7, my code is in vb6

  9. #9
    New Member
    Join Date
    Dec 2005
    Posts
    2

    Re: Creating PDF files from HTLM files

    Evad, this is brilliant, however does not work with later versions of Distiller. For those users out there on the pain-staking search for how to do it and came accross this thread only to find it describing Acrobat 5, here:

    Assuming you have a handy-dandy function called:
    "SetRegValue (KeyRoot, Path, sKey, NewValue)"

    VB Code:
    1. Dim sPath As String, sKey As String, sValue As String
    2.     sPath = "Software\Adobe\Acrobat Distiller\PrinterJobControl"
    3.     sKey = App.Path & "\" & App.EXEName & ".exe"
    4.     sValue = "C:\temp\test.pdf"
    5.     createAcroKey = SetRegValue(HKEY_CURRENT_USER, sPath, sKey, sValue)

    Basically the registry folder specified includes a list of key names that specify location of EXEs that, when run from distiller, will use the specified key value (a filePath which can include a specific PDF file) as the default path -- once printed, the key is removed.

    If the path can't be found, it will try to get as close as it can but will eventually give up and go to the desktop I think. Don't bother looking at the registry values in the directory, they're very misleading and if used in the format as the keys in there, you can specify the directory, but not filename...

    Good luck to any and all
    -Tyler

    oh, one more thing... the registry values in:
    HKEY_CURRENT_USER\Software\Adobe\Acrobat\PDFMaker\7.0\Global\Settings
    - ViewPDFFile
    - PromptForPDFFilename
    - ConvertDocInfo
    ...don't seem to do anything, strangely enough. I haven't figured that out yet

  10. #10
    Lively Member
    Join Date
    May 2002
    Posts
    94

    Re: Creating PDF files from HTLM files

    Yeah this was the quickest way that I could get a process up and running. And were still using this process at work. I do need to (when i find the time) move this process into .net.

    Thanks for the feed back
    If your post is resolved, mark it as such using the thread tools, Keep the forums tidy.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width