Print Page | Close Window

Read Textbox Alignment from pdf?

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3689
Printed Date: 27 Apr 24 at 9:34AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Read Textbox Alignment from pdf?
Posted By: sko
Subject: Read Textbox Alignment from pdf?
Date Posted: 27 Mar 19 at 11:14AM
Hi,

i can read formfields with

  for i := 1 to PDFLibrary.FormFieldCount do
  begin
     x := PDFLibrary.GetFormFieldBound(i, 0);
    y := PDFLibrary.GetFormFieldBound(i, 1);
    w := PDFLibrary.GetFormFieldBound(i, 2);
    h := PDFLibrary.GetFormFieldBound(i, 3);
    s := PDFLibrary.GetFormFieldTextSize(i);
    a := PDFLibrary.GetFormFieldAlignment(i);
...
and i get also the alignment of this field in a.

now i want to read textblocks (written with align center or right)

    for f := 1 to PDFLibrary.GetTextBlockCount(id) do
    begin
      s := PDFLibrary.GetTextBlockFontSize(id, f);
      fn := PDFLibrary.GetTextBlockFontName(id, f);
      for j := 1 to 8 do
      begin
        box[j] := PDFLibrary.GetTextBlockBound(id, f, j);
      end;

but here are all textblocks minimized to there content, i can't get the original size and alignment!

Is there a way to do it?

Ciao
Stefan



Replies:
Posted By: Ingo
Date Posted: 27 Mar 19 at 9:05PM
Hi Stefan,

you won't get a value for a block-align 'cause inside the block different aligns are possible i think.
In this sample you'll see what'spossible:
https://www.debenu.com/kb/extract-text-from-pdfs-as-a-text-block-list/



-------------
Cheers,
Ingo



Posted By: sko
Date Posted: 28 Mar 19 at 5:37AM
thank you!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk