# WkHtmlToPdf DLL prototype

**URL:** <https://clarionhub.com/t/wkhtmltopdf-dll-prototype/7881>\
**Category:** questions\
**Tags:** dll, pdf\
**Created:** [January 31, 2025, 7:58am UTC](https://clarionhub.com/t/wkhtmltopdf-dll-prototype/7881 "2025-01-31T07:58:35Z")\
**Posts on this page:** 2\
**Page:** 3

<div class="post-metadata">

**Author:** ![Dirk1](https://clarionhub.com/letter_avatar_proxy/v4/letter/d/977dab/32.png) [@Dirk1](https://clarionhub.com/u/Dirk1)\
**Post date:** [March 13, 2025, 7:57am UTC](https://clarionhub.com/t/wkhtmltopdf-dll-prototype/7881/41 "2025-03-13T07:57:26Z")

</div>

Aha thx so now it is

```clarion
          fname.SetValue(filename)
          fName.replace('/','\')  
          recs = fName.count('..\') 
          Rootfolder=glo:uncmap&'\HTML_MERGEFILES'
          loop recs times 
            Rootfolder=removelastdir(Rootfolder)
            fName.replace('..\','')  
          end        
          if img.loadfile(rootfolder&'\'&fname.GetVal())
            if img.len() > 0 
              img.base64Encode(st:noWrap)
              replaces=st.replace(tagContents[tagStart+1:tagEnd - 1],'data:image/'&fName.extensionOnly()&';base64,'&img.getValue())
            end
          end

Procedure removelastdir(IFilePath)

 I=Instring('\',IFilePath,-1,Len(IFilePath))
 if I>0 ! if there is a \
  IFilePath=IFilePath[1:(I-1)] 
 end
 if Instring('\',IFilePath,-1,Len(IFilePath))=0
  IFilePath=CLIP(IFilePath) & '\'
 end
 Return clip(IFilePath)

```

---

<div class="post-metadata">

**Author:** ![Mark\_Sarson](https://clarionhub.com/user_avatar/clarionhub.com/mark_sarson/32/6132_2.png) [@Mark\_Sarson](https://clarionhub.com/u/Mark_Sarson)\
**Post date:** [March 13, 2025, 11:04am UTC](https://clarionhub.com/t/wkhtmltopdf-dll-prototype/7881/42 "2025-03-13T11:04:14Z")

</div>

Just posting this here for syntax highlighting instructions: [New Clarion Syntax Highlighting on ClarionHub! - Announcements - ClarionHub](https://clarionhub.com/t/new-clarion-syntax-highlighting-on-clarionhub/7481)

[Previous page](https://clarionhub.com/t/wkhtmltopdf-dll-prototype/7881.md?page=2)
