TinyButStrong - the PHP Template Engine
Categories > OpenTBS with XLSX >

addpic or changepic workaround on xlsx

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: jovani
Date: 2012-07-06
Time: 09:14

addpic or changepic workaround on xlsx

Hi,

It was noted that changepic will not work on xlsx. But is there a way to add pic (if not change) on a spreadsheet?

Thanks!
By: Skrol29
Date: 2012-07-08
Time: 02:13

Re: addpic or changepic workaround on xlsx

Hi Jovani,

"changepic" does not work with Ms Excel yet. This is because pictures are not saved in the sheet when using Ms ExceL
But it will be possible with OpenTBS 1.8.0 which is currently in beta version.


If you're interested, I can send the beta version to you.
By: jovani
Date: 2012-07-08
Time: 02:27

Re: addpic or changepic workaround on xlsx

Hi Skrol29,

Yes, kindly send me the beta version. Thanks so much!

Actually, what i have done so far as a workaround was to modify the archive. Initially i place images on the sheet as placeholders and also place some ope=addpic. I modified drawing1.xml.rels replacing the image filenames with those generated for the ope=addpic. It works but got a limitation of not being able to adjust the image dimension on the fly. :)

Thanks!

Jovani
By: jovani
Date: 2012-07-08
Time: 03:03

Re: addpic or changepic workaround on xlsx

btw, my email is vojalf [at] gmail [dot] com . thanks! :)
By: Skrol29
Date: 2012-07-09
Time: 00:33

Re: addpic or changepic workaround on xlsx

Hi Jovani,

The beta is available here :
  http://www.tinybutstrong.com/dl.php?f=tbs_plugin_opentbs_beta.zip&s=2

You can use parameter "changepic" with the new "search=forward" (detailed in the manual). This enables you to put the TBS tag inside the picture properties, such as Title or Description.
This is nice, but you still have to open the "xl/drawings/drawing1.xml" in order to have the [onshow] or [onload] TBS tag merged.
(in Ms Excel files, picture are not saved in the sheet but in a sub files such as "xl/drawings/drawing1.xml")

By: jovani
Date: 2012-07-09
Time: 01:00

Re: addpic or changepic workaround on xlsx

Thanks so much!

Will try this out.
By: jovani
Date: 2012-07-12
Time: 13:58

Re: addpic or changepic workaround on xlsx

Hi Skrol29,

I was not able to make it work with "ope=changepic" on xlsx. I got that error "...  has failed to found the picture".

"This is nice, but you still have to open the "xl/drawings/drawing1.xml" in order to have the [onshow] or [onload] TBS tag merged." --> do you mean to open manually that file in editor? no idea really. :)

Thanks!

Jovani
By: Skrol29
Date: 2012-07-12
Time: 22:25

Re: addpic or changepic workaround on xlsx

Hi,

No, I mean to load it with $TBS->LoadTemplate('#xl/drawings/drawing1.xml');

I you can wait 1 or 2 days, I'm adding a new OpenTBS command to scann and merges all "drawing1.xml" files.
By: jovani
Date: 2012-07-12
Time: 23:29

Re: addpic or changepic workaround on xlsx

Sure. That would be great. Thanks! :)
By: Skrol29
Date: 2012-07-15
Time: 21:47

Re: addpic or changepic workaround on xlsx

Hi Jovani,

The is a new beta version available for download.
Thinks are much more easy for changing picture in an MS Excel workbook.
There is an example in the 2th sheet of the XLSX template provided with the beta version.

You need two new features for merging images in Ms Excel:
- new parameter "tagpos=inside"
- new command OPENTBS_MERGE_SPECIAL_ITEMS

Download the beta version:
http://www.tinybutstrong.com/dl.php?f=tbs_plugin_opentbs_beta.zip&s=2
By: jovani
Date: 2012-07-16
Time: 08:40

Re: addpic or changepic workaround on xlsx

Thanks Skrol29! It is working now. :)

BTW, i do notice height (preserving aspect ratio of new pic) is not adjusted even if i used adjust=samewidth.
By: jovani
Date: 2012-07-24
Time: 12:01

Re: addpic or changepic workaround on xlsx

Hi Skrol29,

Will you include the pic adjustment (for xlsx) in your next release? Badly needed that feature. :)

Thanks!
By: Skrol29
Date: 2012-07-24
Time: 14:48

Re: addpic or changepic workaround on xlsx

Hi Jovani,

I'm working on it.
For now it seems doable, but there is still problems.
By: Skrol29
Date: 2012-07-25
Time: 12:12

Re: addpic or changepic workaround on xlsx

The size of the picture is defined totally differently in Ms Excel file and in Word or PowerPoint.
OpenXML is a nightmare compared to ODF.

Nevertheless I think it will be possible to make parameter "adjust" working in Excel. Soon.
By: jovani
Date: 2012-07-25
Time: 12:24

Re: addpic or changepic workaround on xlsx

Great! Thanks! :)
By: jovani
Date: 2012-07-26
Time: 08:13

Re: addpic or changepic workaround on xlsx

Hi Skrol29,

I just noticed while debugging within TbsPicAdjust function, the tbs field of the first picture (i got 5 in a sheet) is not yet merged. The second time it goes in to the function for the second picture, the tbs field of the first picture only got merged while the current (2nd pic) was not. I think this cause it to merge the dimensions from previous pic into the current pic.

Thanks!
By: Skrol29
Date: 2012-07-27
Time: 00:06

Re: addpic or changepic workaround on xlsx


Ok, I'll check that. I didn't tried with several pictures yet.
Is this with the beta version ?
By: jovani
Date: 2012-07-27
Time: 00:58

Re: addpic or changepic workaround on xlsx

Yes, with the beta version (1.8.0-beta-2012-07-15). Thanks!
By: Skrol29
Date: 2012-07-27
Time: 01:38

Re: addpic or changepic workaround on xlsx

Hi Jovani,

There is a new beta version available.
It should fix the problem of image resizing in XLSX.
You're welcome to send feedback.

By: jovani
Date: 2012-07-29
Time: 16:27

Re: addpic or changepic workaround on xlsx

Hi Skrol29,

Had just tested it and verified working great! Awesome!

Thanks!