Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Can't write formatted text to PDF
  FAQ FAQ  Forum Search   Register Register  Login Login

Can't write formatted text to PDF

 Post Reply Post Reply
Author
Message
Cefeg View Drop Down
Beginner
Beginner
Avatar

Joined: 16 Feb 16
Location: California
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote Cefeg Quote  Post ReplyReply Direct Link To This Post Topic: Can't write formatted text to PDF
    Posted: 31 Mar 21 at 2:22AM
Using VB.Net, QuickPDF Library v16 DLL.  Objective is to convert a one page text file formatted mostly as separate lines without word wrap to a PDF.  Looking at forum and KB I could not code for this requirement.

After reading the text file with StreamReader (either ReadLine and appending vbCRLF or reading the text file into one string) the following code gives me a PDF with only one line across the top with no line breaks.
  qp.SetOrigin(1)                   ' origin at top left
  qp.DrawText(30, 50, sText)  ' write text after top left margin
  qp.SaveToFile(sPDFname)    ' save to pdf document 

Same result using: 
  Dim hFile = fs.SafeFileHandle.DangerousGetHandle()
  qp.DASaveAsFile(hFile, sPDFname)    where hFile is the file handle to the formatted text file.

In all cases the CR + LF do not work.

How can I effectively convert a plain formatted text file to PDF so it appears similar?

Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 31 Mar 21 at 10:50PM
Hi,

i've done a quick search in the online reference...
DrawMultiLineText should feed your needs:
https://www.debenu.com/docs/pdf_library_reference/DrawMultiLineText.php

Cheers,
Ingo

Back to Top
cefegdev View Drop Down
Beginner
Beginner


Joined: 15 Jun 19
Location: So. California
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote cefegdev Quote  Post ReplyReply Direct Link To This Post Posted: 01 Apr 21 at 12:18AM
Smile  
Ingo,

Thanks for that. It works perfectly.

Clark
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store