Go Back   MarcomCentral (PTI) and FusionPro User Communities > Support > Issues, Questions, Etc.


Thread Tools Search this Thread Display Modes
Old February 18th, 2015, 09:00 AM
jorgenbackus jorgenbackus is offline
Forum n00b
Join Date: Feb 2015
Posts: 3
Question how to center (or align right) table in textframe? (also QR-question)


For a customer I have to create a business card with a QR-code with a logo in it. The background color of the business card itself is 20% green, but the QR-code which is 100% green must have a white background.

My proposed solution was creating a table with background color white, where the table width is measured by content (found this solution here: http://forums.pti.com/showthread.php?t=3233). This works fine.

If I could position this table exact in the middle of my text frame, I could place a graphic frame in the same dimensions exact above it. In this graphic frame I would place the logo exact in the middle. Result should be a QR-code with white background and the company logo in the middle.

Somehow I don't manage to align the table into the textframe.

This is my code:

var Text = Rule("getQRcode2"); 
var PointSize = 7; 
var Font = "Helvetica";
var Color = "white";

var tm = new FusionProTextMeasure;
tm.pointSize = PointSize * 100;
tm.font = Font;

var myTable = new FPTable;
myTable.AddColumns(tm.textWidth + 100);
var theCell = myTable.AddRow().Cells[0];
theCell.PointSize = PointSize;
theCell.Font = Font;
theCell.ShadeColor = Color;
theCell.ShadePct = 100;
theCell.Content = Text;
theCell.Margins = { Top: 0, Bottom: -68, Left: 0, Right: 0 };

var X=myTable.MakeTags();
X += "<p leading=1> ";
return X;
Next step would be aligning the table rght-top, but with logo still in the middle of the QR-code.

Anybody a clue how to realize this? Thanks!
Reply With Quote
Old February 18th, 2015, 09:56 AM
step's Avatar
step step is offline
Senior Contributor
Join Date: Jan 2010
Location: Charlotte, NC
Posts: 957
Default Re: how to center (or align right) table in textframe? (also QR-question)

Referencing this comment, you could do something like this to align the table to the center:
var X = myTable.MakeTags().replace(/^\<table/, "<table alignment=center");
On a side note, leading is measured in 10th's of a point so if you're wanting the paragraph tag to have a leading of 1 point, it should be altered to be:
X += "<p leading=10> ";
Ste Pennell
FusionPro VDP Creator 9.3.15
Adobe Acrobat X 10.1.1
Mac OS X 10.12

Reply With Quote
Old February 19th, 2015, 07:06 AM
jorgenbackus jorgenbackus is offline
Forum n00b
Join Date: Feb 2015
Posts: 3
Default Re: how to center (or align right) table in textframe? (also QR-question)

Thanks! This did the trick. Now I also managed to align from the right top, putting a logo exact in the middle above the QR-code.

I copied the complete rule I used to align the QR-code, changed the input into a graphic resource. I calculated the margin-top by measuring the height of the QR-code / 2 minus the height of the logo / 2. Last step was aligning horizontally. I'm happy with these offline results. My phones can read these QR-codes perfectly.

Now I created a DSF template and uploaded it. Somehow DSF renders the QR-code in a different way, because when I create a business card online, the QR-code is not recognized by my phones. I'll create a separate thread for this one.
Reply With Quote

alignment, highlighted text, qr-code, table

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 05:52 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.