feature/barcode feedback sought ...

Michael Meeks michael.meeks at collabora.com
Tue Jan 27 03:56:17 PST 2015


Hi there,

On Tue, 2015-01-27 at 00:50 +0100, Thorsten Behrens wrote:
> > and also serializing their rendered state as an OLE-style preview to
> > the XML.
> > 
> Maybe not that easily. And are you storing the original bits (that
> then get rendered into QR) somewhere already?

	Sure - that's the draw:data stuff - the QR code is ~trivial to
re-generate from the raw data; so in this case:

   draw:engine="org.libreoffice.draw.barcode"
   draw:data="this is the QR code content">

	=)

> > 	Of course - I'd love to have some feedback on my sanity - quite
> > possibly this is utterly crazy; quite possibly there are 3x easier &
> > better ways to achieve the same thing (?) =)
> > 
> Yeah, why not sticking in a png or an svg directly into the document?

	The custom-shape looks like it has a cached representation of itself as
a polygon (it seems):

     <draw:enhanced-geometry svg:viewBox="0 0 21600 21600"
draw:glue-points="10800 0 3163 3163 0 10800 3163 18437 10800 21600 18437
18437 21600 10800 18437 3163" draw:text-areas="3163 3163 18437 18437"
draw:type="smiley" draw:modifiers="18520" draw:enhanced-path="U 10800
10800 10800 10800 0 360 Z N U 7305 7515 1000 1865 0 360 Z N U 14295 7515
1000 1865 0 360 Z N M 4870 ?f1 C 8680 ?f2 12920 ?f2 16730 ?f1 F N">

	I suspect that a bitmap doesn't fit in the enhanced-path thing there -
but (of course) perhaps I'm completely mis-understanding what that is.

> But also not prohibitively expensive - or how large are those QR codes
> getting these days? Your example seems 40x40 pixel.

	http://en.wikipedia.org/wiki/QR_code#Storage

	quite big =)

> > 	* bar-code specifications:
> > 		+ some of the spec's are a bit strict: "no less
> > 		  than 2mm between X and Y"
> > 		+ that gives some UI / rendering / unit constraints
> > 		+ currently not captured.
> > 
> Lock resizing on the XShape?

	I guess so =)

> > 	* ODF / back-compatibility - we re-export the original (in my
> > 	  case smiley) custom-shape which shows up as an unhelpful
> > 	  fallback for older LibreOffice'n.
>  
> That one is a bummer. You'd want to add a preview image into some
> wrapped draw frame then (like e.g. the svg import did it).

	Ah ok; hmm. I should look at the svg import/export I guess to see how
that is done.

> See above - I might miss the broader picture, but I think easiest
> would be direct embedding of the graphic. Would also solve your bitmap
> question.

	Fair cop. Of course the problem is really a bit larger than this
though: we want to be able to have 'field' or other equivalent
functionality that lets people easily automate / populate QR codes via
scripting / database'y bits (I guess).

	It'd also be rather ideal to be able to eg. render the page-number
field using python in some arbitrary / fun way =) [ growing flowers or
whatever ].

	So the question is mostly - which foundation to try to build that thing
on =)

	Does the CustomShape stuff look like a sensible foundation on which to
build that ? I guess I'd really like some custom field-like
functionality too ;-)

	ATB,

		Michael.

-- 
 michael.meeks at collabora.com  <><, Pseudo Engineer, itinerant idiot



More information about the LibreOffice mailing list