Export PDF to PNG

  • Hello i just wrote my script to export PDF to PNG it works fine, but only if i have a TForm, - i would like to export it in a Service Application


    My probem is that if i exprt it with

    Code
    1. View : TWPViewPDF; p : integer;begin View := TWPViewPDF.Create(self); View.Parent := self; View.LoadFromFile('c:\test.pdf'); for p:=1 to View.PageCount do begin View.WritePNG('c:\test'+IntToStr(p)+'.png', p, 72, wp256Color); end; View.Free;


    - i have to set the parent that it works.


    If i export it with

    Code
    1. wpview_pdfMakeJPEG('c:\test.pdf'
    2. , nil
    3. , '----'
    4. , '----'
    5. , 0
    6. , 'c:t\test_%d.png'
    7. , 1
    8. , 99
    9. , 72);


    i get an access violation


    What i do wrong?