Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

pdflib · PDFlib users

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 3733
  • Category: Cyberculture
  • Founded: Jun 28, 1999
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 21389 - 21438 of 21927   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#21389 From: Rainer Plöckl <rp@...>
Date: Fri Jul 29, 2011 9:59 am
Subject: Re: pdflib Blocks fill_pdfblock function
ruebennase_de
Send Email Send Email
 
Stefan,

Am 27.07.2011 17:31, schrieb stefan.decuypere:
> I am scratching my head on how to use the "PDF" Blocks type (as opposed to
text or image block types).
> In the design, the user creates a block of type PdfBlock and gives it a name
"externalpage"
> When merging the pdfblocks input file with the variable data, I have to
somehow be able to get two data items for this field to be filled (with anything
other than the default pdf and pagenumber)
> One dataitem is the pdf filename, the other one is the pagenumber.
>
> This seems to preclude a one to one mapping of PDFBlocks and data items.
> To be explicit: when I iterate over the pdfblock, and I encounter field
"externalpage", I have to correlate two data items with this: externalfilename,
externalpagenumber

yes and this is necessary, because only with this two information,
you can address a PDF page.

To address the page, you have to open the document first and then
open the page and apply this page handle to the block.

I do not see here any problem. How do you expect to address a Page
in a PDF with only one data?

Rainer

--
Rainer Plöckl        rp@...        http://www.pdflib.com
   PDFlib GmbH, Franziska-Bilek-Weg 9, 80339 München,  Germany
   Amtsgericht München HRB 129497, Geschäftsführer Thomas Merz
---------------------------------------------------------------
  PDFlib 8: Complex script shaping and bidirectional formatting
for Arabic, Hebrew, Thai, Hindi, and many other writing systems
_______PDFlib - a library for generating PDF on the fly________

#21390 From: Rainer Plöckl <rp@...>
Date: Fri Jul 29, 2011 11:03 am
Subject: Re: pdflib blocks Design question on blocks positioned according to contents
ruebennase_de
Send Email Send Email
 
Stefan,

> I have a question regarding the cookbook example: linked textblock
> How would one handle the case where I want the text "Visit us at our Web site
at www. kraxi.com!" to come below the body text, which is  variable and may be
from 1 to 6 blocks long?
> If I am not mistaken, the bottom text is now always in a fixed position, so
there could be a huge gap between the body text and the "Visit us... " line.
>
> Another case where this may happen is after a variable length body text, where
you would put: "Sincerly Yours, ... "
> Another case is an address that has one or two address lines, but if the
second one is empty you want to move up the town and zip fields so that there is
no empty space.

when I understand you correct, there is a simple way to get all
this information.
Similar as you retrieve the error reason for a textflow block,
you can use info_textflow() to determine the end positions of
the placed text. Based on this information, you can place the
"Visit us..." or the "Sincerly Yours, ...." in the following
process.

Rainer
--
Rainer Plöckl        rp@...        http://www.pdflib.com
   PDFlib GmbH, Franziska-Bilek-Weg 9, 80339 München,  Germany
   Amtsgericht München HRB 129497, Geschäftsführer Thomas Merz
---------------------------------------------------------------
  PDFlib 8: Complex script shaping and bidirectional formatting
for Arabic, Hebrew, Thai, Hindi, and many other writing systems
_______PDFlib - a library for generating PDF on the fly________

#21399 From: BSM | Barry Downes <barry.downes@...>
Date: Mon Aug 1, 2011 6:50 am
Subject: errorpolicy=return and void functions
barry.downes@...
Send Email Send Email
 
I have been working on some C code using PDFlib.
I have set errorpolicy to "return", and have been using function return
values to detect errors.

I have recently encountered error conditions in functions returning
void, which appear to use the PDFlib exception mechanism regardless of
the errorpolicy parameter.  Of course this isn't a big surprise, since
these functions have no other means to report errors.

I have attached a short program demonstrating this.  So far I have
noticed this kind of error with PDF_set_parameter and PDF_begin_page_ext.

If no PDF_TRY/PDF_CATCH block is used, the program will be terminated
with a non-zero exit status and an error message to standard error.

My question is:
If I wish my program to handle these errors differently, do I have any
options other than using the PDF_TRY/PDF_CATCH exception mechanism?

1 of 1 File(s)


#21400 From: Thomas Merz <tm@...>
Date: Mon Aug 1, 2011 7:51 am
Subject: Re: errorpolicy=return and void functions [1 Attachment]
thomasmerz1
Send Email Send Email
 
On 01.08.2011 08:50, BSM | Barry Downes wrote:

> If I wish my program to handle these errors differently, do I have any
> options other than using the PDF_TRY/PDF_CATCH exception mechanism?

No. Actually, it is a severe programming error to
call PDFlib API functions without a corresponding
TRY/CATCH clause. PDFlib detects this case and as a last
resort emits a message to stdout before exiting, but
this is only to tell the API user that something is
severely wrong in his program.

Functions without any return value generally don't fail
if used correctly. When designing the API we followed the
paradigm "an exception is an exception": for example, running
out of memory is considered an exceptional situation which
happens rarely, and cannot be recovered by the client.
As another example, if you have a typo in a parameter or
option name an exception will be thrown so that you can see
early in the development cycle that something is severely
wrong.

On the other hand, some operations may fail more often,
e.g. involving disk files: if you load a font or image
from file, the file may be unavailable, damaged or
of unsuitable type for the intended purpose. This kind
of error can be detected with an error return value,
and details are available with PDF_get_errmsg().

Thomas

_______________________________________________________________
Thomas Merz             tm@...            www.pdflib.com
    PDFlib GmbH, Franziska-Bilek-Weg 9, 80339 München,  Germany
    Amtsgericht München HRB 129497, Geschäftsführer Thomas Merz
---------------------------------------------------------------
   PDFlib 8: Complex script shaping and bidirectional formatting
for Arabic, Hebrew, Thai, Hindi, and many other writing systems
_______PDFlib - a library for generating PDF on the fly________

#21401 From: BSM | Barry Downes <barry.downes@...>
Date: Tue Aug 2, 2011 1:34 am
Subject: Re: errorpolicy=return and void functions
barry.downes@...
Send Email Send Email
 
Thanks for the explanation.
If I have errorpolicy=return, and I'm calling a non-void function, is it
possible there are error conditions for which it will throw a PDFlib
exception rather than returning an error code?

I was previously unsure whether errorpolicy=return would allow me to
avoid the exception system entirely. It seems it won't.
As the code I am working on is a library with a number of functions, I
won't have the option to simply wrap the entire program with a single
try/catch block. Probably I'll wrap most PDFlib calls individually.

On 2011-08-01 17:51, Thomas Merz wrote:
>
> On 01.08.2011 08:50, BSM | Barry Downes wrote:
>
> > If I wish my program to handle these errors differently, do I have any
> > options other than using the PDF_TRY/PDF_CATCH exception mechanism?
>
> No. Actually, it is a severe programming error to
> call PDFlib API functions without a corresponding
> TRY/CATCH clause. PDFlib detects this case and as a last
> resort emits a message to stdout before exiting, but
> this is only to tell the API user that something is
> severely wrong in his program.
>
> Functions without any return value generally don't fail
> if used correctly. When designing the API we followed the
> paradigm "an exception is an exception": for example, running
> out of memory is considered an exceptional situation which
> happens rarely, and cannot be recovered by the client.
> As another example, if you have a typo in a parameter or
> option name an exception will be thrown so that you can see
> early in the development cycle that something is severely
> wrong.
>
> On the other hand, some operations may fail more often,
> e.g. involving disk files: if you load a font or image
> from file, the file may be unavailable, damaged or
> of unsuitable type for the intended purpose. This kind
> of error can be detected with an error return value,
> and details are available with PDF_get_errmsg().
>
> Thomas
>
> __________________________________________________________
> Thomas Merz tm@... <mailto:tm%40pdflib.com> www.pdflib.com
> PDFlib GmbH, Franziska-Bilek-Weg 9, 80339 München, Germany
> Amtsgericht München HRB 129497, Geschäftsführer Thomas Merz
> ----------------------------------------------------------
> PDFlib 8: Complex script shaping and bidirectional formatting
> for Arabic, Hebrew, Thai, Hindi, and many other writing systems
> _______PDFlib - a library for generating PDF on the fly________
>
>

#21402 From: Thomas Merz <tm@...>
Date: Tue Aug 2, 2011 8:55 am
Subject: Re: errorpolicy=return and void functions
thomasmerz1
Send Email Send Email
 
On 02.08.2011 03:34, BSM | Barry Downes wrote:
> If I have errorpolicy=return, and I'm calling a non-void function, is it
> possible there are error conditions for which it will throw a PDFlib
> exception rather than returning an error code?

Yes.

> I was previously unsure whether errorpolicy=return would allow me to
> avoid the exception system entirely. It seems it won't.

No. Keep in mind that some error situations cannot be rectified,
neither inside PDFlib nor in client code. Think of out-of-memory,
disk full, and other fatal problems. In such situations PDFlib
will throw an exception regardless of the errorpolicy.

> As the code I am working on is a library with a number of functions, I
> won't have the option to simply wrap the entire program with a single
> try/catch block. Probably I'll wrap most PDFlib calls individually.

Keep in mind that after an exception the current PDF document
is lost; you cannot continue the same document after an
exception but must give it up.

Thomas

_______________________________________________________________
Thomas Merz             tm@...            www.pdflib.com
    PDFlib GmbH, Franziska-Bilek-Weg 9, 80339 München,  Germany
    Amtsgericht München HRB 129497, Geschäftsführer Thomas Merz
---------------------------------------------------------------
   PDFlib 8: Complex script shaping and bidirectional formatting
for Arabic, Hebrew, Thai, Hindi, and many other writing systems
_______PDFlib - a library for generating PDF on the fly________

#21403 From: "stefan.decuypere" <stefan.decuypere@...>
Date: Wed Aug 3, 2011 8:49 pm
Subject: preview issue with pdfblocks
stefan.decuy...
Send Email Send Email
 
This is not a bug but more a limitation of the pdfblock v4.3 plugin:

There is no way to see the difference in the preview between a block filled in
from the defaultxxx attribute and a real datavalue, as it would come from a
database and replaced with fill_XXX call.

To be more specific: I have a text block called firstname that has a default
value "Stefan"
If the text block has status active, the preview will show "Stefan"
If the text block has status static, the preview will show "Stefan"
If the text block has status ignore, the preview will be empty.
If the text block has status ignoredefault, the preview will be empty

Would it make sense to add new text attribute previewtext to textblock and
textline blocks,
a new imageblock attribute previewimage and
2 new pdfblock attributes previewpdf previewpdfpage ?

if the block status is ignoredefault, then the preview would take the field
value from these attributes instead of from the default attribute. if the block
status is active, the preview would be a combination of the preview and default
attributes
This has the advantage that one can simulate more accurately the actual output.


To reuse my example from above, if the text block firstname has previewtext
"John" then:
If the text block has status active, the preview will show "John/Stefan"
If the text block has status static, the preview will show "Stefan"
If the text block has status ignore, the preview will not show anything.
If the text block has status ignoredefault, the preview will show "John"


As an alternative to the above suggestion but still trying to achieve the same
result:
when the status of the block is active could the preview maybe show in some way
that the filled in value came from defaultxxx field? [ different
color/underlined/.. whatever ]

Thanks for considering this,
Stefan  Decuypere

#21404 From: "khaleel" <khaleel_rashid2000@...>
Date: Fri Aug 5, 2011 4:03 am
Subject: Does Pdflib supports Html
khaleel_rash...
Send Email Send Email
 
I would like to know does Pdflib supports HTML. I have used the <h1> and other
html tags but none of them is supported. Please tell me the sample file in which
it has been used.

Waiting for your earliest response.

#21405 From: Rainer Plöckl <rp@...>
Date: Fri Aug 5, 2011 8:12 am
Subject: Re: Does Pdflib supports Html
ruebennase_de
Send Email Send Email
 
Hello,

Am 05.08.2011 06:03, schrieb khaleel:
> I would like to know does Pdflib supports HTML. I have used the <h1> and other
html tags but none of them is supported. Please tell me the sample file in which
it has been used.

no, PDFlib is not a converter and so you can't apply HTML tags
directly.
When working with textflow, you can specify macros, so you might
do inline formatting in a similar way as you know it from HTML.
Please see PDFlib 8 Tutorial, chapter 8.2 (8.2.3 ) for further
details.

Rainer
--
Rainer Plöckl        rp@...        http://www.pdflib.com
   PDFlib GmbH, Franziska-Bilek-Weg 9, 80339 München,  Germany
   Amtsgericht München HRB 129497, Geschäftsführer Thomas Merz
---------------------------------------------------------------
  PDFlib 8: Complex script shaping and bidirectional formatting
for Arabic, Hebrew, Thai, Hindi, and many other writing systems
_______PDFlib - a library for generating PDF on the fly________

#21406 From: BSM | Barry Downes <barry.downes@...>
Date: Fri Aug 5, 2011 9:51 am
Subject: annotations with "usematchbox" and tranformations
barry.downes@...
Send Email Send Email
 
When I was experimenting with creating hyperlinks with PDFlib, I found
something weird.
Based on my understanding from what I read, I thought it was a
limitation of PDF that the box for an annotation would always be a
rectangle with sides parallel to the page edges.  If the "usematchbox"
option were used to specify the annotation area, I expected it would use
the smallest such rectangle that enclosed the matchbox.

But in my experiments with diagonal hyperlinks, I found that sometimes
the hyperlink area exactly enclosed the diagonal link.  This was nice,
but unfortunately it didn't always work like that.  Small and
apparently-insignificant changes in the transformation matrix could
affect whether the hyperlink area was precise or used an axis-aligned
rectangle.

It's probably best explained with the attached sample code in C.
It outputs 2 pages with the same hyperlinked text, differing only in the
transformations applied.
For me, the link on the first page was "precise", but the one on the
second page was "imprecise".  By moving my mouse cursor around the
hyperlink and seeing it change, I can see that the link on the second
page is bounded with an axis-aligned rectangle.

If possible, I'd like them to always work like on the first page, but I
have no idea what really causes the difference.

1 of 1 File(s)


#21407 From: Kurt Stützer <kurt@...>
Date: Fri Aug 5, 2011 5:14 pm
Subject: Re: annotations with "usematchbox" and tranformations [1 Attachment]
kurt@...
Send Email Send Email
 
Hi Barry,

Sorry, but this is a bug in Acrobat :-(
The bug has nothing to do with the page where the annotation was
created. You can verify this to create single documents with 1 page
and with different translation values. Documents with translation
values < 150 approximately show the desired behavior: The sensitive
area for the link is the matchbox's rectangle. In the case of values
  >= 150, the sensitve area is the bounding box of matchbox's rectangle.
I didn't examine the precise threshold value. The single documents
differ only in the - correct - coordinates of the annotation's
rectangle and the sensitive area, expressed by a so-called QuadPoints
entry. Incredibly, but it is the truth.

Kurt

On 05.08.2011 11:51, BSM | Barry Downes wrote:
>
> [Attachment(s) <#TopText> from BSM | Barry Downes included below]
>
> When I was experimenting with creating hyperlinks with PDFlib, I found
> something weird.
> Based on my understanding from what I read, I thought it was a
> limitation of PDF that the box for an annotation would always be a
> rectangle with sides parallel to the page edges. If the "usematchbox"
> option were used to specify the annotation area, I expected it would use
> the smallest such rectangle that enclosed the matchbox.
>
> But in my experiments with diagonal hyperlinks, I found that sometimes
> the hyperlink area exactly enclosed the diagonal link. This was nice,
> but unfortunately it didn't always work like that. Small and
> apparently-insignificant changes in the transformation matrix could
> affect whether the hyperlink area was precise or used an axis-aligned
> rectangle.
>
> It's probably best explained with the attached sample code in C.
> It outputs 2 pages with the same hyperlinked text, differing only in the
> transformations applied.
> For me, the link on the first page was "precise", but the one on the
> second page was "imprecise". By moving my mouse cursor around the
> hyperlink and seeing it change, I can see that the link on the second
> page is bounded with an axis-aligned rectangle.
>
> If possible, I'd like them to always work like on the first page, but I
> have no idea what really causes the difference.
>
>

--
_______________________________________________________________
Kurt Stützer           kurt@...           www.pdflib.com
       phone +49 89 452 33 84-15      fax +49 89 452 33 84-99
    PDFlib GmbH, Franziska-Bilek-Weg 9, 80339 München,  Germany
         Court of registry/Amtsgericht München HRB 129497
   Managing Directors/Geschäftsführer: Thomas Merz, Petra Porst
---------------------------------------------------------------
   PDFlib 8: Complex script shaping and bidirectional formatting
for Arabic, Hebrew, Thai, Hindi, and many other writing systems
_______PDFlib - a library for generating PDF on the fly________

#21408 From: BSM | Barry Downes <barry.downes@...>
Date: Mon Aug 8, 2011 12:55 am
Subject: Re: annotations with "usematchbox" and tranformations
barry.downes@...
Send Email Send Email
 
Thanks Kurt.

Based on your feedback I tried the document in Foxit Reader, and found
the sensitive area to be the matchbox rectangle in both cases.  It's
nice to know that it's not a limitation in the PDF format itself.

I probably should have made it clear that the 2 pages were just a way of
demonstrating the 2 cases in a single document, created after I'd
already determined various changes that could trigger the problem.  I
initially triggered it with a rotation, but used the translation in my
example because I found it more suprising, and more likely to result in
a properly-considered response.

On 2011-08-06 03:14, Kurt Stützer wrote:
> Hi Barry,
>
> Sorry, but this is a bug in Acrobat :-(
> The bug has nothing to do with the page where the annotation was
> created. You can verify this to create single documents with 1 page
> and with different translation values. Documents with translation
> values<  150 approximately show the desired behavior: The sensitive
> area for the link is the matchbox's rectangle. In the case of values
>   >= 150, the sensitve area is the bounding box of matchbox's rectangle.
> I didn't examine the precise threshold value. The single documents
> differ only in the - correct - coordinates of the annotation's
> rectangle and the sensitive area, expressed by a so-called QuadPoints
> entry. Incredibly, but it is the truth.
>
> Kurt
>
> On 05.08.2011 11:51, BSM | Barry Downes wrote:
>> [Attachment(s)<#TopText>  from BSM | Barry Downes included below]
>>
>> When I was experimenting with creating hyperlinks with PDFlib, I found
>> something weird.
>> Based on my understanding from what I read, I thought it was a
>> limitation of PDF that the box for an annotation would always be a
>> rectangle with sides parallel to the page edges. If the "usematchbox"
>> option were used to specify the annotation area, I expected it would use
>> the smallest such rectangle that enclosed the matchbox.
>>
>> But in my experiments with diagonal hyperlinks, I found that sometimes
>> the hyperlink area exactly enclosed the diagonal link. This was nice,
>> but unfortunately it didn't always work like that. Small and
>> apparently-insignificant changes in the transformation matrix could
>> affect whether the hyperlink area was precise or used an axis-aligned
>> rectangle.
>>
>> It's probably best explained with the attached sample code in C.
>> It outputs 2 pages with the same hyperlinked text, differing only in the
>> transformations applied.
>> For me, the link on the first page was "precise", but the one on the
>> second page was "imprecise". By moving my mouse cursor around the
>> hyperlink and seeing it change, I can see that the link on the second
>> page is bounded with an axis-aligned rectangle.
>>
>> If possible, I'd like them to always work like on the first page, but I
>> have no idea what really causes the difference.
>>
>>

#21417 From: BSM | Barry Downes <barry.downes@...>
Date: Mon Aug 22, 2011 2:28 am
Subject: exception fetching pCOS /Info keys
barry.downes@...
Send Email Send Email
 
Hi,

I attached some C code where I attempt to fetch a pCOS path that does
not exist.  Specifically, it's a document info field, though I think the
question here applies similarly to any pCOS path that is not guaranteed
to be present.

Ideally I would like to grab a value from the path if it exists, or
receive some indication that it doesn't exist, if it doesn't.

As far as I can tell, I have an option of fetching the value by name, in
which case an invalid path (ie. a missing document info field) will be
signalled by a PDFlib exception.  (This seems to be the case based on my
testing - I don't think the API documentation actually makes this clear.)
Or I may choose to enumerate the keys under "/Info".  This will allow me
to determine the presence of the desired key without risk of an
exception, but doesn't seem the ideal way to obtain a specific set of
keys I'm interested in.

I'd like to go with fetching the value by name, and would be happy
enough to receive the missing path indication as an exception.  For
functions like PDF_pcos_get_number, which have no out-of-band value
suitable for signalling errors reliably, this makes a lot of sense.  But
I gather that after an exception, an output PDF will be unusable and the
entire PDF generation must be aborted.
Is this true even for pCOS functions?
What about if I am composing an output document with the same PDF * handle?
And if I'm not composing an output document, but just using the PDF *
for pCOS input functions?
Am I forced to enumerate the /Info keys (accessing them by number) to
obtain the values safely?

- Barry

1 of 1 File(s)


#21419 From: "zjljlj" <zjljlj@...>
Date: Thu Aug 25, 2011 7:56 am
Subject: the chinese bookmark
zjljlj
Send Email Send Email
 
As I want to create a chinese bookmark with the function create_bookmark(),but
the chinese cannot be displayed in the right way. When I input "µÚ1Ò³"
,"¦Ì¨²1¨°3" is displayed.
    Can you give me an example how to solve the  problem?

#21420 From: Vedat Aral <vedat.a@...>
Date: Thu Aug 25, 2011 4:10 pm
Subject: Append
vedataral
Send Email Send Email
 
Hello All,

Is there a way to insert/append a pdf file onto existing pdf file?

It is easy to create a new file with begin_document() and add pages from two other files but It is not what I'm looking for.

Thank you in advance.
--

Thank you,

Vedat Aral
| Director, Information Technology
infosend
      Bill Print. eBills. Delivered.

Office
714.993.2690 x 303 E-mail vedat.a@...
Locations Orange County, CA | Chicago, IL

Notice: Our headquarters address has changed. Please update your records.

InfoSend Headquarters
4240 E. La Palma Ave.
Anaheim, CA 92807

This message may contain information that is confidential and/or
protected by law. If you have received this communication in error,
please contact the sender immediately and delete the message.

#21421 From: Lance Cotton <lcotton+pdflib@...>
Date: Thu Aug 25, 2011 4:18 pm
Subject: Re: Append
jose_can_u_c
Send Email Send Email
 
On 8/25/2011 11:10 AM, Vedat Aral wrote:
> Is there a way to insert/append a pdf file onto *existing* pdf file?
>
> It is easy to create a new file with begin_document() and add pages from
> two other files but It is not what I'm looking for.

Not with PDFlib.

-Lance

#21422 From: "vedataral" <vedat.a@...>
Date: Thu Aug 25, 2011 4:36 pm
Subject: Re: Append
vedataral
Send Email Send Email
 
Thank you Lance,

Do you know if there is a plan to implement it in future versions?


--- In pdflib@yahoogroups.com, Lance Cotton <lcotton+pdflib@...> wrote:
>
> On 8/25/2011 11:10 AM, Vedat Aral wrote:
> > Is there a way to insert/append a pdf file onto *existing* pdf file?
> >
> > It is easy to create a new file with begin_document() and add pages from
> > two other files but It is not what I'm looking for.
>
> Not with PDFlib.
>
> -Lance
>

#21423 From: Kurt Stützer <kurt@...>
Date: Thu Aug 25, 2011 4:54 pm
Subject: Re: the chinese bookmark
kurt@...
Send Email Send Email
 
Hi,

please show us a small program snippet by which we can see what you are
doing.

Kurt

On 25.08.2011 09:56, zjljlj wrote:
>
>
> As I want to create a chinese bookmark with the function
> create_bookmark(),but the chinese cannot be displayed in the right way.
> When I input "µÚ1Ò³" ,"¦Ì¨²1¨°3" is displayed.
> Can you give me an example how to solve the problem?
>
>

--
_______________________________________________________________
Kurt Stützer           kurt@...           www.pdflib.com
       phone +49 89 452 33 84-15      fax +49 89 452 33 84-99
    PDFlib GmbH, Franziska-Bilek-Weg 9, 80339 München,  Germany
         Court of registry/Amtsgericht München HRB 129497
   Managing Directors/Geschäftsführer: Thomas Merz, Petra Porst
---------------------------------------------------------------
   PDFlib 8: Complex script shaping and bidirectional formatting
for Arabic, Hebrew, Thai, Hindi, and many other writing systems
_______PDFlib - a library for generating PDF on the fly________

#21424 From: venki chedella <chvenkat_mca@...>
Date: Fri Aug 26, 2011 12:59 pm
Subject: Inserting 2d barcode using PDFLib and Perl
chvenkat_mca
Send Email Send Email
 
Hello,

     While using PDFLib { in PERL } to insert a datamatrix barcode into a pdf document I used ' IDAutomationDMatrix ' font in   PDF_load_font function. I believe latest version of PDFLib version (8.0.3) supports for barcodes.       
   
    Following is the code i used to render the barcode.

      my $optlist = "barcode={symbology=DataMatrix dataprep=0 ecc=0 xsymwidth=10 } "
                  . " font=" . $id_automation_font_handle;     
     
      $p->create_field( 50,
                        70,
                        100,
                        110,
                        "0000000 Test"
,
                        "textfield",
                        $optlist );

    But some reason barcode is not rendered on the pdf. Does create_field function require encrypted string to place the DataMatix barcode? Can anybody provide perl code for rendering barcode on pdf?


#21425 From: Rainer Plöckl <rp@...>
Date: Fri Aug 26, 2011 1:15 pm
Subject: Re: Inserting 2d barcode using PDFLib and Perl
ruebennase_de
Send Email Send Email
 
Hello,


>     Following is the code i used to render the barcode.
>
>       my $optlist = "barcode={symbology=DataMatrix dataprep=0 ecc=0
xsymwidth=10 } "
>                   . " font=" . $id_automation_font_handle;
>
>       $p->create_field( 50,
>                         70,
>                         100,
>                         110,
>                         "0000000 Test",
>                         "textfield",
>                         $optlist );
>
>     But some reason barcode is not rendered on the pdf. Does create_field
function require encrypted string to place the DataMatix barcode? Can anybody
provide perl code for rendering barcode on pdf?
>

do you really want to place the barcode within a form field?
Displaying and printing the barcode fields will only work with
full Acrobat version 9 or newer, but not with Adobe Reader.

When you have an IDAutomationDMatrix font, I think you will
simple place the code as text.

Similar to our (Java) cookbook example:
http://www.pdflib.com/pdflib-cookbook/fonts/barcode-font/

- load the font with $p->load_font()
- place the text with $p->fit_textline():
   $p->fit_textline("*ABC123*", 10, 75, "font=" .
       $id_automation_font_handle ." fontsize=20");

kind regards,
Rainer

--
_______________________________________________________________
Rainer Plöckl        rp@...        http://www.pdflib.com
   PDFlib GmbH, Franziska-Bilek-Weg 9, 80339 München,  Germany
        Court of registry/Amtsgericht München HRB 129497
  Managing Directors/Geschäftsführer: Thomas Merz, Petra Porst
---------------------------------------------------------------
     PDFlib: powerful toolkits for PDF developers since 1997
_______ See www.pdflib.com/products for product details________

#21426 From: "venki" <chvenkat_mca@...>
Date: Sat Aug 27, 2011 10:10 am
Subject: Re: Inserting 2d barcode using PDFLib and Perl
chvenkat_mca
Send Email Send Email
 

--- In pdflib@yahoogroups.com, Rainer Plöckl <rp@...> wrote:
>
> Hello,
>
>
> > Following is the code i used to render the barcode.
> >
> > my $optlist = "barcode={symbology=DataMatrix dataprep=0 ecc=0 xsymwidth=10 } "
> > . " font=" . $id_automation_font_handle;
> >
> > $p->create_field( 50,
> > 70,
> > 100,
> > 110,
> > "0000000 Test",
> > "textfield",
> > $optlist );
> >
> > But some reason barcode is not rendered on the pdf. Does create_field function require encrypted string to place the DataMatix barcode? Can anybody provide perl code for rendering barcode on pdf?
> >
>
> do you really want to place the barcode within a form field?
> Displaying and printing the barcode fields will only work with
> full Acrobat version 9 or newer, but not with Adobe Reader.
>
> When you have an IDAutomationDMatrix font, I think you will
> simple place the code as text.
>
> Similar to our (Java) cookbook example:
> http://www.pdflib.com/pdflib-cookbook/fonts/barcode-font/
>
> - load the font with $p->load_font()
> - place the text with $p->fit_textline():
> $p->fit_textline("*ABC123*", 10, 75, "font=" .
> $id_automation_font_handle ." fontsize=20");
>
> kind regards,
> Rainer

       Rainer,

                Thanks for your code. The above function fit_textline working fine for 3of9barcode bur for  DataMatrix barcode the function  fit_textline showing text instead of barcode. Please see the my perl code and output of the program

use strict;
use warnings;
 
use PDFlib;

   my $resource_path = "D:\\resources";
   my $output_file   = "D:\\2DBarcode.pdf";
   my $p;
   eval {

      $p = new PDFlib::PDFlib;
      $p->set_parameter("errorpolicy" , "exception");
      $p->set_parameter("textformat"  , "utf8");
      $p->set_parameter("searchpath"  , "$resource_path");
      $p->set_parameter("compatibility", "1.7" );
     
      if ( $p->begin_document($output_file , "" ) == -1 ) {
     
         print "Error: $p->get_errmsg()";
         exit;
      }
     
      my $barcode_font_handle = $p->load_font("IDAutomationDMatrix", "unicode", "embedding");
     
      if ( $barcode_font_handle == -1 ) {
      
         print "Error loading font : IDAutomationDMatrix";
         exit;
      }
     
      my $barcode_options = join("",
                                 "font = $barcode_font_handle " ,
                                 "fontsize = 20" );
     
      $p->begin_page_ext (0, 0, "width=a4.width height=a4.height" );
      $p->fit_textline("*00000001 Test*",
                        10,
                        275,
                        $barcode_options );
                       
      $p->end_page_ext("");
      $p->end_document("");     
     
   };

   if ( $@ ) {
  
      print "Error initializing PDFLib functions";
      print "PDFLib error: $@";
      print $p->get_errmsg();
      exit;
   }

   output is :

>
> --  Am i doing something wrong here? please let me know if there is anything wrong?
Thanks,
Venkat.
> _______________________________________________________________
> Rainer Plöckl rp@... http://www.pdflib.com
> PDFlib GmbH, Franziska-Bilek-Weg 9, 80339 München, Germany
> Court of registry/Amtsgericht München HRB 129497
> Managing Directors/Geschäftsführer: Thomas Merz, Petra Porst
> ---------------------------------------------------------------
> PDFlib: powerful toolkits for PDF developers since 1997
> _______ See www.pdflib.com/products for product details________
>

#21428 From: Lance Cotton <lcotton+pdflib@...>
Date: Mon Aug 29, 2011 2:40 pm
Subject: Re: Re: Inserting 2d barcode using PDFLib and Perl
jose_can_u_c
Send Email Send Email
 
On 8/27/2011 5:10 AM, venki wrote:
> Thanks for your code. The above function fit_textline working fine for
> 3of9barcode bur for DataMatrix barcode the function fit_textline showing
> text instead of barcode. Please see the my perl code and output of the
> program
[...]
> my $barcode_font_handle = $p->load_font("IDAutomationDMatrix",
> "unicode", "embedding");
[...]
> $p->begin_page_ext (0, 0, "width=a4.width height=a4.height" );
> $p->fit_textline("*00000001 Test*",
> 10,
> 275,
> $barcode_options );

DataMatrix barcodes that use a font have to be "encoded", so you can't
simply place the text that you want to encode in the barcode with the
font. What usually accompanies DataMatrix fonts is a program or plug-in
tool that transforms your desired plaintext into a series of characters
that map to the right glyphs in the DataMatrix font.

Typically, a DM font will have only 16 real barcode glyphs, arranged as
the 16 permutations of on/off for a 4x4 grid.

Since a DM code is 2-d, you won't be able to fit_textline() because the
encoding tool returns multiple lines so that the barcode is a square or
whatever 2-D shape you have configured it to be.

-Lance

#21431 From: Rainer Plöckl <rp@...>
Date: Tue Aug 30, 2011 11:38 am
Subject: Re: PDFlib 7.0 & Visual Studio 2010
ruebennase_de
Send Email Send Email
 
> Am I able to use PDFLib 7.0 with Visual Studio 2010?

there are no know problems with this combination. When you
open the C/C++ project files with Visual Studio 2010, the
projects will be adjusted and then you can compile the examples.

Rainer

--
_______________________________________________________________
Rainer Plöckl        rp@...        http://www.pdflib.com
   PDFlib GmbH, Franziska-Bilek-Weg 9, 80339 München,  Germany
        Court of registry/Amtsgericht München HRB 129497
  Managing Directors/Geschäftsführer: Thomas Merz, Petra Porst
---------------------------------------------------------------
     PDFlib: powerful toolkits for PDF developers since 1997
_______ See www.pdflib.com/products for product details________

#21432 From: "lwgracie" <lukegracie@...>
Date: Tue Aug 30, 2011 2:42 pm
Subject: Re: PDFlib 7.0 & Visual Studio 2010
lwgracie
Send Email Send Email
 
Great news - thank you Rainer.

Can I assume this would be true for .NET with vb & c#, also?

:luke

--- In pdflib@yahoogroups.com, Rainer Plöckl <rp@...> wrote:
>
> > Am I able to use PDFLib 7.0 with Visual Studio 2010?
>
> there are no know problems with this combination. When you
> open the C/C++ project files with Visual Studio 2010, the
> projects will be adjusted and then you can compile the examples.
>
> Rainer
>

#21433 From: "lwgracie" <lukegracie@...>
Date: Tue Aug 30, 2011 3:03 pm
Subject: Re: PDFlib 7.0 & Visual Studio 2010
lwgracie
Send Email Send Email
 
I should have also included/asked:

Will it work with ASP.NET and C# or VB coding?

Sorry about that.

Thank you,

:luke

--- In pdflib@yahoogroups.com, "lwgracie" <lukegracie@...> wrote:
>
> Great news - thank you Rainer.
>
> Can I assume this would be true for .NET with vb & c#, also?
>
> :luke
>
> --- In pdflib@yahoogroups.com, Rainer Plöckl <rp@> wrote:
> >
> > > Am I able to use PDFLib 7.0 with Visual Studio 2010?
> >
> > there are no know problems with this combination. When you
> > open the C/C++ project files with Visual Studio 2010, the
> > projects will be adjusted and then you can compile the examples.
> >
> > Rainer
> >
>

#21434 From: Rainer Plöckl <rp@...>
Date: Tue Aug 30, 2011 3:07 pm
Subject: Re: Re: PDFlib 7.0 & Visual Studio 2010
ruebennase_de
Send Email Send Email
 
Hello,

Am 30.08.2011 17:03, schrieb lwgracie:
> I should have also included/asked:
>
> Will it work with ASP.NET and C# or VB coding?

sure, just check the .NET package to get the related projects.

One additional note, when you now start with PDFlib coding, please
do not start with PDFlib 7. PDFlib 7 will reach end of life time
end of October 2011, and will not longer supported.
http://www.pdflib.com/support-policy/product-lifetime/

So it's highly recommended to use the latest version for new
projects.

kind regards,
Rainer


--
_______________________________________________________________
Rainer Plöckl        rp@...        http://www.pdflib.com
   PDFlib GmbH, Franziska-Bilek-Weg 9, 80339 München,  Germany
        Court of registry/Amtsgericht München HRB 129497
  Managing Directors/Geschäftsführer: Thomas Merz, Petra Porst
---------------------------------------------------------------
     PDFlib: powerful toolkits for PDF developers since 1997
_______ See www.pdflib.com/products for product details________

#21435 From: Zhang Jianliang <zjljlj@...>
Date: Wed Aug 31, 2011 2:54 am
Subject: Re: the chinese bookmark
zjljlj
Send Email Send Email
 
Hi,
  I'm using the pdflib8.0.3.Using the demo chartab.c,I want to create a chinese bookmark,and write some chinese in the paper.
the program is:
------------------------------------------------------------------------
 
void main(){
const char *fontname ="STSong-Light"; //"LuciduxSans-Oblique";

    /* This is where font/image/PDF input files live. Adjust as necessary. */
    const char *searchpath = "C:\WINDOWS\Fonts";

    /* list of encodings to use */
    const char *encodings[] = { "iso8859-1", "iso8859-2", "iso8859-15" };

    /* whether or not to embed the font */
    int embed = 1;

#define ENCODINGS ((int) ((sizeof(encodings)/sizeof(encodings[0]))))

    char buf[256];
    PDF *p;
    int row, font, page;

#define FONTSIZE        16
#define TOP             700
#define LEFT            50
#define YINCR           2*FONTSIZE
#define XINCR           2*FONTSIZE

    /* create a new PDFlib object */
    if ((p = PDF_new()) == (PDF *) 0)
    {
        AfxMessageBox("Couldn't create PDFlib object (out of memory)!");
    
    }

    PDF_TRY(p)
    {
/* This means we must check return values of load_font() etc. */
PDF_set_parameter(p, "errorpolicy", "return");
PDF_set_parameter(p, "hypertextencoding", "host");
        if (PDF_begin_document(p, "bookmark.pdf", 0,
                "destination {type fitwindow page 1}") == -1)
        {
            AfxMessageBox(PDF_get_errmsg(p));
PDF_delete(p);
            
        }

      //  PDF_set_parameter(p, "SearchPath", searchpath);

        /* This line is required to avoid problems on Japanese systems */
    // PDF_set_parameter(p,"FontOutline", "aaa=SIMSUN.TTC");
        PDF_set_info(p, "Creator", "zjl");
        PDF_set_info(p, "Author", "zjl");
        PDF_set_info(p, "Title", "Bookmark (C++)");

        /* loop over all encodings */
        for (page = 0; page < ENCODINGS; page++)
        {
            PDF_begin_page_ext(p, a4_width, a4_height, "");

            /* print the heading and generate the bookmark */
            /* Change "host" encoding to "winansi" or whatever you need! */
            font = PDF_load_font(p, "Helvetica", 0, "host", "");
   if (font == -1) {
AfxMessageBox(PDF_get_errmsg(p));
PDF_delete(p);
   }

            PDF_setfont(p, font, FONTSIZE);
            sprintf(buf, "第%s (%s) %s embedded",
                fontname, encodings[page], embed ? "" : "not ");

            PDF_show_xy(p, buf, LEFT - XINCR, TOP + 3 * YINCR);
            (void) PDF_create_bookmark(p, buf, 0, "");//Why “第†cannot be displayed in a right way?

            /* print the row and column captions */
            PDF_setfont(p, font, 2 * FONTSIZE/3);

            for (row = 0; row < 16; row++)
            {
                sprintf(buf, "x%X", row);
                PDF_show_xy(p, buf, LEFT + row*XINCR, TOP + YINCR);

                sprintf(buf, "%Xx", row);
                PDF_show_xy(p, buf, LEFT - XINCR, TOP - row * YINCR);
            }
int font_song = PDF_load_font(p,"Times New Roman",0,"winansi",""); 
  PDF_setfont(p,font_song, 24);
PDF_continue_text(p,"2010-6-3 12:12:00");

font_song = PDF_load_font(p,"STSong-Light",0,"GB-EUC-H",""); //If i insert this ,the pdf cannot be generated rightly.
   PDF_setfont(p,font_song, 24);
  PDF_continue_text(p,"中国北京");//cannot be displayed rightly,too.
            PDF_end_page_ext(p, "");
        }

        PDF_end_document(p, "");
    }
    PDF_CATCH(p)
    {
        printf("PDFlib exception occurred in the sample:\n");
        printf("[%d] %s: %s\n",
            PDF_get_errnum(p), PDF_get_apiname(p), PDF_get_errmsg(p));
        PDF_delete(p);
       
    }
    PDF_delete(p);
}

-------------------------------------------------------------------------

the problem is that,if I want to write some chinese and create a chinese bookmark,how to set the font and encoding?
    thank youï¼
              Jianliang.Zhang

From: Kurt Stützer <kurt@...>
To: pdflib@yahoogroups.com
Sent: Friday, August 26, 2011 12:54 AM
Subject: Re: [pdflib] the chinese bookmark

Hi,

please show us a small program snippet by which we can see what you are
doing.

Kurt

On 25.08.2011 09:56, zjljlj wrote:
>
>
> As I want to create a chinese bookmark with the function
> create_bookmark(),but the chinese cannot be displayed in the right way.
> When I input "µÚ1Ò³" ,"¦Ì¨²1¨°3" is displayed.
> Can you give me an example how to solve the problem?
>
>

--
_______________________________________________________________
Kurt Stützer          kurt@...          www.pdflib.com
      phone +49 89 452 33 84-15      fax +49 89 452 33 84-99
  PDFlib GmbH, Franziska-Bilek-Weg 9, 80339 München,  Germany
        Court of registry/Amtsgericht München HRB 129497
  Managing Directors/Geschäftsführer: Thomas Merz, Petra Porst
---------------------------------------------------------------
  PDFlib 8: Complex script shaping and bidirectional formatting
for Arabic, Hebrew, Thai, Hindi, and many other writing systems
_______PDFlib - a library for generating PDF on the fly________


------------------------------------

------------------------------------------
Please see our cookbooks for sample code:
http://www.pdflib.com/pdflib-cookbook/
------------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/pdflib/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/pdflib/join
    (Yahoo! ID required)

<*> To change settings via email:
    pdflib-digest@yahoogroups.com
    pdflib-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    pdflib-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/




#21436 From: "stefan.decuypere" <stefan.decuypere@...>
Date: Wed Aug 31, 2011 9:01 am
Subject: Bug in Windows UNC path handling
stefan.decuy...
Send Email Send Email
 
When you call
p.set_parameter("logging", "filename
={\\\\vboxsrv\SharedDocuments\temp\pdflib.log} remove");
you get the error
Error '1012' Call PDF_set_parameter: Couldn't open log file
'\vboxsrv\SharedDocuments\temp\pdflib.log' for writing

Pdflib does not recognize UNC pathnames \\server\volume\pathname as an absolute
path (like x:\temp\pdflib.log)

To check that a filename is absolute in windows, it starts with either x:\ or \\

I have not verified other path-related calls, but I know that p.begin_document
works for unc filenames


Stefan Decuypere

#21437 From: Rainer Plöckl <rp@...>
Date: Wed Aug 31, 2011 9:08 am
Subject: Re: Bug in Windows UNC path handling
ruebennase_de
Send Email Send Email
 
Stefan,

> p.set_parameter("logging", "filename
={\\\\vboxsrv\SharedDocuments\temp\pdflib.log} remove");
> you get the error
> Error '1012' Call PDF_set_parameter: Couldn't open log file
'\vboxsrv\SharedDocuments\temp\pdflib.log' for writing
>
> Pdflib does not recognize UNC pathnames \\server\volume\pathname as an
absolute path (like x:\temp\pdflib.log)
>
> To check that a filename is absolute in windows, it starts with either x:\ or
\\

might it be possible, that you do not work with the last PDFlib
version? In PDFlib 8.0.3 we fixed a bug, which is related to the
description you sent:
[snip]
- 2011-03-29 (bug #3282)
   An even number of consecutive backslash characters in option lists was
   not treated correctly: one of the backslashes was missing after
   optlist parsing.
[snip]

When you think, you have a different problem, please open a support
case: http://www.pdflib.com/en/support-policy/opening-a-support-case/
add the exact used PDFlib version you use as well an example code
to reproduce the issue.

Rainer

--
_______________________________________________________________
Rainer Plöckl        rp@...        http://www.pdflib.com
   PDFlib GmbH, Franziska-Bilek-Weg 9, 80339 München,  Germany
        Court of registry/Amtsgericht München HRB 129497
  Managing Directors/Geschäftsführer: Thomas Merz, Petra Porst
---------------------------------------------------------------
     PDFlib: powerful toolkits for PDF developers since 1997
_______ See www.pdflib.com/products for product details________

#21438 From: "stefan.decuypere" <stefan.decuypere@...>
Date: Wed Aug 31, 2011 1:41 pm
Subject: Re: Bug in Windows UNC path handling
stefan.decuy...
Send Email Send Email
 
Yup, I was using 8.0.1
I will upgrade
Stefan

Messages 21389 - 21438 of 21927   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help