Skip to content
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.

Using pdf2htmlEx within vb net webapplication #696

Open
rolero opened this issue Nov 5, 2016 · 0 comments
Open

Using pdf2htmlEx within vb net webapplication #696

rolero opened this issue Nov 5, 2016 · 0 comments

Comments

@rolero
Copy link

rolero commented Nov 5, 2016

I am trying to run the pdf2htmlEx within a vbhtml web application. It is running on IIS 8.0 (Windows 2012 server 64bit). Using the cmd line on the same server, I can easily convert the selected PDF file. If I run the EXE within .NET something strange happens. I don't get any errors and some files are actually generated but all are empty. Like somewhere in the process something goes wrong. In the eventlog there is nothing to see. No errors and no warnings.

I already checked if the application has sufficient access to the pdf2htmlEx.exe and the folder that it needs to access to get the pdf and write the html files (Full control DefaultAppPool). After 6 hours of investigating, I am a little lost and hope someone can help me. Any C# or VB code is welcome. I only can guess there is still a accessibility issue.

The output folder is generated and it only contains the following files:

  • fileiuid-1.html (empty)
  • fileiuid.css
  • fileiuid.outline

Part of the code I am using.

@Imports System.IO
@Imports System.Diagnostics
@Code
  ......
    Dim inputfile As FileInfo = New FileInfo(Server.MapPath("~/files/"  & filerc.filename) )
    Dim convertargs As String  = "--tmp-dir " & Server.MapPath("~/templateshtml/tmp/") &  " --embed cfijo --dest-dir " & fileiuid.tostring & " --split-pages 1 --page-filename " &  fileiuid.tostring & "-%d.html " & Server.MapPath("~/templateshtml/tmp/" &  filerc.filename)
            
    Dim convertproc As Process = new Process()
    convertproc.StartInfo.WorkingDirectory = Server.MapPath("~/templateshtml/")
    convertproc.StartInfo.FileName = Server.MapPath("~/templateshtml/pdf2htmlEX.exe")
    convertproc.StartInfo.Arguments = convertargs
    convertproc.StartInfo.UseShellExecute = false
    convertproc.StartInfo.CreateNoWindow = false
    convertproc.StartInfo.RedirectStandardOutput = false
    convertproc.Start()             
    convertproc.WaitForExit()
    convertproc.Close() 
......
End Code

Input var:

  • fileiuid = 68C74B8C-1372-4077-9441-A351E5DB1429 (guid)
  • filaname = test.pdf (string)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant