PDF Image tags

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

PDF Image tags

Rick Draper
Hi All,

I have been using data held in blob fields for some time to display
images within web pages, but am trying to insert an image from a blob
into a pdf and having some trouble with the syntax.

When I am displaying the image inline on a web page I use the following

$Current_Image = Image(-Binary = Field('File_Data'));
File_Serve($Current_Image->data, -Type='image/jpeg', -inline,
-File=$Image_Ref+'.jpg');

If I include an image from a file in a PDF I do as follows...

Var('Current_Image') = PDF_Image(-File='/photos/BBGHNVNF.jpg',
-Height=$imgheight, -Width=$imgheight);
$template -> add($Current_Image,-left = $left,-top = $top);
 
The language guide and help suggest that the -Raw parameter is used to
draw the image from a raw string of bits representing the image... But
none of the following seems to work (where Field('File_Data') is a MySQL
blob).

PDF_Image(-Raw = Field('File_Data'), -Height=$imgheight,
-Width=$imgheight);

PDF_Image(-Raw = Image(-Binary = Field('File_Data')),
-Height=$imgheight, -Width=$imgheight);


Can anyone point me in the right direction??

Thanks and very best regards,
 
Rick

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/


Reply | Threaded
Open this post in threaded view
|

Re: PDF Image tags

CoMedia
Rick Draper wrote
Can anyone point me in the right direction??
Rick, did you read the guide Jolle presented during LDC 2008? It has some great pointers for understanding the tag syntax.

http://download.lassosoft.com/pub/LDC2008/

-- Alfred
Reply | Threaded
Open this post in threaded view
|

Re: PDF Image tags

list
In reply to this post by Rick Draper
30 mar 2009 kl. 09.28 skrev CoMedia:

> Rick Draper wrote:
>> Can anyone point me in the right direction??
>>
> Rick, did you read the guide Jolle presented during LDC 2008? It has  
> some
> great pointers for understanding the tag syntax.
>
> http://download.lassosoft.com/pub/LDC2008/

I'm flattered for the recommendation and I'm sure Rick will find a lot  
of my suggestions and solutions workable. :-)
Unfortunately they won't help Rick in this issue. I have not done any  
pdf work involving blob stored images and my guides doesn't cover  
that. They only uses images actually stored on the server as a file.

I'm interested in the correct solution as well.

HDB
Jolle

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/


Reply | Threaded
Open this post in threaded view
|

Re: PDF Image tags

stevepiercy
In reply to this post by Rick Draper
On Monday, March 30, 2009, [hidden email] (Rick Draper) pronounced:

>Hi All,
>
>I have been using data held in blob fields for some time to display
>images within web pages, but am trying to insert an image from a blob
>into a pdf and having some trouble with the syntax.
>
>When I am displaying the image inline on a web page I use the following
>
>$Current_Image = Image(-Binary = Field('File_Data'));
>File_Serve($Current_Image->data, -Type='image/jpeg', -inline,
>-File=$Image_Ref+'.jpg');
>
>If I include an image from a file in a PDF I do as follows...
>
>Var('Current_Image') = PDF_Image(-File='/photos/BBGHNVNF.jpg',
>-Height=$imgheight, -Width=$imgheight);
>$template -> add($Current_Image,-left = $left,-top = $top);
>
>The language guide and help suggest that the -Raw parameter is used to
>draw the image from a raw string of bits representing the image... But
>none of the following seems to work (where Field('File_Data') is a MySQL
>blob).
>
>PDF_Image(-Raw = Field('File_Data'), -Height=$imgheight,
>-Width=$imgheight);
>
>PDF_Image(-Raw = Image(-Binary = Field('File_Data')),
>-Height=$imgheight, -Width=$imgheight);

How about this?

    PDF_Image(
        -Raw = (Field('File_Data'), -binary),
        -Height=$imgheight,
        -Width=$imgheight
    );

If that works, then it could be a workaround for a possible bug.  According to the Language Guide:

    The [Bytes] type is often referred to as a byte-stream or binary
    data.  Lasso tags return data in the [Bytes] type in the
    following situations.

    * The [Field] tag returns a byte stream from MySQL BLOB fields.

In other words, I would expect what you expected, specifically that this should work:

    PDF_Image(
        -Raw = Field('File_Data'),
        -Height=$imgheight,
        -Width=$imgheight
    );
   
--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/


Reply | Threaded
Open this post in threaded view
|

Re: PDF Image tags

Rick Draper
Thanks, Steve.

Thanks for the suggestions - Unfortunately the
Field('File_Data',-Binary) and variations thereof also failed to deliver
the desired result.

In this case I am luck to have a fall back position of a path to a real
file, but I would like to know how to get the tags working the way one
would expect them to.

I know the data in the blob field is correctly formatted because I can
display it happily in non-pdf applications... Hopefully it is something
that others have experienced.

For the record, this is Lasso 8.5.5 on W2K3.


Very best regards,
 
Rick
 

-----Original Message-----
From: Lasso Talk [mailto:[hidden email]] On Behalf Of Steve
Piercy - Web Site Builder
Sent: Monday, 30 March 2009 5:38 PM
To: Lasso Talk
Subject: Re: PDF Image tags

On Monday, March 30, 2009, [hidden email] (Rick Draper)
pronounced:

How about this?

    PDF_Image(
        -Raw = (Field('File_Data'), -binary),
        -Height=$imgheight,
        -Width=$imgheight
    );

If that works, then it could be a workaround for a possible bug.
According to the Language Guide:

    The [Bytes] type is often referred to as a byte-stream or binary
    data.  Lasso tags return data in the [Bytes] type in the
    following situations.

    * The [Field] tag returns a byte stream from MySQL BLOB fields.

In other words, I would expect what you expected, specifically that this
should work:

    PDF_Image(
        -Raw = Field('File_Data'),
        -Height=$imgheight,
        -Width=$imgheight
    );
   
--steve



--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/


Reply | Threaded
Open this post in threaded view
|

Lasso 6 on redhat

stephane-15
Hello,

I would like to reinstall my Lasso 6 licence on a new redhat server.

It is difficult now to set up a redhat 7.3 server. Would someone know if
Lasso 6 can be installed on a recent redhat distribution ?

Thank you for your help.

Stephane Bezpalko



--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/


Reply | Threaded
Open this post in threaded view
|

Re: PDF Image tags

stevepiercy
In reply to this post by Rick Draper
Oops.  My () were off.  Try this:

   PDF_Image(
       -Raw     = Field('File_Data', -binary),
       -Height  = $imgheight,
       -Width   = $imgheight
   );

Another attempt:

    var('myimage' = image(-binary=field('File_Data')));
    PDF_Image(
        -Raw    = $myimage,
        -Height = $imgheight,
        -Width  = $imgheight
    );

As a sanity check, it might not be a bad idea to save the BLOB value to the file system to ensure there is nothing funky going on, possibly with encoding.

--steve


On Monday, March 30, 2009, [hidden email] (Rick Draper) pronounced:

>Thanks, Steve.
>
>Thanks for the suggestions - Unfortunately the
>Field('File_Data',-Binary) and variations thereof also failed to deliver
>the desired result.
>
>In this case I am luck to have a fall back position of a path to a real
>file, but I would like to know how to get the tags working the way one
>would expect them to.
>
>I know the data in the blob field is correctly formatted because I can
>display it happily in non-pdf applications... Hopefully it is something
>that others have experienced.
>
>For the record, this is Lasso 8.5.5 on W2K3.
>
>
>Very best regards,
>
>Rick
>
>
>-----Original Message-----
>From: Lasso Talk [mailto:[hidden email]] On Behalf Of Steve
>Piercy - Web Site Builder
>Sent: Monday, 30 March 2009 5:38 PM
>To: Lasso Talk
>Subject: Re: PDF Image tags
>
>On Monday, March 30, 2009, [hidden email] (Rick Draper)
>pronounced:
>
>How about this?
>
>    PDF_Image(
>        -Raw = (Field('File_Data'), -binary),
>        -Height=$imgheight,
>        -Width=$imgheight
>    );
>
>If that works, then it could be a workaround for a possible bug.
>According to the Language Guide:
>
>    The [Bytes] type is often referred to as a byte-stream or binary
>    data.  Lasso tags return data in the [Bytes] type in the
>    following situations.
>
>    * The [Field] tag returns a byte stream from MySQL BLOB fields.
>
>In other words, I would expect what you expected, specifically that this
>should work:
>
>    PDF_Image(
>        -Raw = Field('File_Data'),
>        -Height=$imgheight,
>        -Width=$imgheight
>    );
>    
>--steve
>
>
>
>--
>This list is a free service of LassoSoft: http://www.LassoSoft.com/
>Search the list archives: http://www.ListSearch.com/Lasso/Browse/
>Manage your subscription: http://www.ListSearch.com/Lasso/
>
>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy               Web Site Builder               Soquel, CA
<[hidden email]>                  <http://www.StevePiercy.com/>

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/


Reply | Threaded
Open this post in threaded view
|

Re: PDF Image tags

Bil Corry-3
In reply to this post by Rick Draper
Rick Draper wrote on 3/30/2009 1:47 AM:
> PDF_Image(-Raw = Field('File_Data'), -Height=$imgheight,
> -Width=$imgheight);

The -raw parameter doesn't work.  You'll have to write it to disk first, then import it.


- Bil


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/


Reply | Threaded
Open this post in threaded view
|

Re: PDF Image tags

list
30 mar 2009 kl. 14.19 skrev Bil Corry:

>
> Rick Draper wrote on 3/30/2009 1:47 AM:
>> PDF_Image(-Raw = Field('File_Data'), -Height=$imgheight,
>> -Width=$imgheight);
>
> The -raw parameter doesn't work.  You'll have to write it to disk  
> first, then import it.

One could be tempted to say something negative almost abusive about  
that. But one won't.

Writing to disk is not so fun if it's hundreds of images we talk about  
for each pdf.

Yet another pdf tag that promises one thing in the docs and performs  
something completely different.

HDB
Jolle

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/


Reply | Threaded
Open this post in threaded view
|

Re: PDF Image tags

Bil Corry-3
Jolle Carlestam wrote on 3/30/2009 8:35 AM:

> 30 mar 2009 kl. 14.19 skrev Bil Corry:
>> Rick Draper wrote on 3/30/2009 1:47 AM:
>>> PDF_Image(-Raw = Field('File_Data'), -Height=$imgheight,
>>> -Width=$imgheight);
>>
>> The -raw parameter doesn't work.  You'll have to write it to disk
>> first, then import it.
>
> One could be tempted to say something negative almost abusive about
> that. But one won't.
>
> Writing to disk is not so fun if it's hundreds of images we talk about
> for each pdf.
>
> Yet another pdf tag that promises one thing in the docs and performs
> something completely different.

FWIW, I tried like crazy last year to make it work, but I couldn't get LJAPI to reliably provide an array of bytes in Java from the bytes type in Lasso.  I did send my findings to LassoSoft, but I haven't followed up so I don't know what actions they took based on it.  Given that this feature has never worked in the PDF tags and appears to come up only once a year, it probably doesn't have the highest priority in their bug queue.


- Bil


--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/


Reply | Threaded
Open this post in threaded view
|

Re: PDF Image tags

Rick Draper
Thanks for the insight Bil,

I have to admit to not having seen it come up as an issue previously and
have based a solution around drawing data from blob fields using the
tag.  Heavy sighs of disappointment.


Very best regards,
 
Rick
 

-----Original Message-----
From: Lasso Talk [mailto:[hidden email]] On Behalf Of Bil
Corry
Sent: Tuesday, 31 March 2009 2:11 AM
To: Lasso Talk
Subject: Re: PDF Image tags

Jolle Carlestam wrote on 3/30/2009 8:35 AM:

> 30 mar 2009 kl. 14.19 skrev Bil Corry:
>> Rick Draper wrote on 3/30/2009 1:47 AM:
>>> PDF_Image(-Raw = Field('File_Data'), -Height=$imgheight,
>>> -Width=$imgheight);
>>
>> The -raw parameter doesn't work.  You'll have to write it to disk
>> first, then import it.
>
> One could be tempted to say something negative almost abusive about
> that. But one won't.
>
> Writing to disk is not so fun if it's hundreds of images we talk about

> for each pdf.
>
> Yet another pdf tag that promises one thing in the docs and performs
> something completely different.

FWIW, I tried like crazy last year to make it work, but I couldn't get
LJAPI to reliably provide an array of bytes in Java from the bytes type
in Lasso.  I did send my findings to LassoSoft, but I haven't followed
up so I don't know what actions they took based on it.  Given that this
feature has never worked in the PDF tags and appears to come up only
once a year, it probably doesn't have the highest priority in their bug
queue.


- Bil




--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/