Jump to content

Sell Customised PDF files


Recommended Posts

I am not aware of one, I had one customer inquire about it, but development cost was too high for her.

 

It does not seem like there is much demand for it, which would explain why there are no modules for it (at least not that I'm aware of, but you may want to try the addons store).

Link to comment
Share on other sites

There used to be a way in 1.4.xx that let you charge shipping for virtual products which let me sell a product (i.e. a kit for something) and then the customer would get an email to download the PDF instructions after purchase.

That worked really well for me but I haven't been able to get it to work in 1.5.2.

Link to comment
Share on other sites

Hi - thank guys - I will give it a go - I did build an online pdf customisation-tool for a client 6 years ago using the open-source php-pdf library - but it took a couple of weeks -

It seems Presta-shops deafult pdf templates are all written up in old-school tables - no block-element objects (eg: <div style="position:absolute;left:10px..........." - etc..) - I want to move the order number onto a graphic - but no background print support - I actually want to sell a gift voucher that you can print out with your unique number printed on top of a nice 9x55cm card.

 

With standard css easy - also with postscript - but not with tables and inline styles

 

I will tell you what my outcome was

Link to comment
Share on other sites

It seems Presta-shops deafult pdf templates are all written up in old-school tables - no block-element objects (eg: <div style="position:absolute;left:10px..........." - etc..) - I want to move the order number onto a graphic - but no background print support - I actually want to sell a gift voucher that you can print out with your unique number printed on top of a nice 9x55cm card.

Exactly. Background image/watermark support. Pure <DIV> layout. Here is a small example of "Labels A4 105x48 mm 12x margin" template for M4 PDF Extensions module:

 

<!--
   name="{l s='Labels A4 105x48 mm 12x margin'}"
   data="order+detail"
-->
{assign var='sheetWidth' value='210'}		 {* in mm *}
{assign var='sheetHeight' value='297'}	    {* in mm *}
{assign var='leftRightMargin' value='0'}	  {* in mm *}
{assign var='topBottomMargin' value='4'}	  {* in mm *}
{assign var='labelsHorizontal' value='2'}
{assign var='labelsVertical' value='6'}
<head>
{literal}
   <style>
    @page {
	  sheet-size: 210mm 297mm;
	  margin: 0;
	  margin-header: 0;
	  margin-footer: 0;
    }
    body {
	    margin: 0;
	    padding: 0;
    }
    body, p, div {
	    font-size: 12px;
	    font-family: arial, sans-serif;
	    font-weight: normal;
	    overflow: hidden;
    }

    .cell {
	    position: absolute;
	    overflow: hidden;
	    padding: 6mm 10mm 6mm 10mm;
	    vertical-align: top;
	    /* uncomment for displaying label borders */
	    /* border: 0.1mm solid black; */
    }
    .align-left {text-align: left;}
    .align-center {text-align: center;}
    .align-right {text-align: right;}
    .clear {clear: both;}
    .zero {margin: 0; padding: 0;}
    .bold {font-weight: bold;}
    .italic {font-style: italic;}
    .smaller {font-size: 80%;}
    .bigger {font-size: 120%;}
   </style>
{/literal}
</head>
<body>
{math equation="(sw - 2 * lrm) / lh" sw=$sheetWidth lrm=$leftRightMargin lh=$labelsHorizontal assign='cellWidth'}
{math equation="(sh - 2 * tbm) / lv" sh=$sheetHeight tbm=$topBottomMargin lv=$labelsVertical assign='cellHeight'}
{section name=orders loop=$order}
   {assign var="index" value="`$smarty.section.orders.index`"}
   {math equation="floor(i/lh) % lv" i=$index lh=$labelsHorizontal lv=$labelsVertical assign='row'}
   {assign var="column" value="`$index%$labelsHorizontal`"}
   {assign var="columnRight" value="`$labelsHorizontal-$column-1`"}
   {assign var="rowBottom" value="`$labelsVertical-$row-1`"}

   {math equation="lrm + c * cw" lrm=$leftRightMargin c=$column cw=$cellWidth assign='left'}
   {math equation="lrm + cr * cw" lrm=$leftRightMargin cr=$columnRight cw=$cellWidth assign='right'}
   {math equation="tbm + r * ch" tbm=$topBottomMargin r=$row ch=$cellHeight assign='top'}
   {math equation="tbm + rb * ch" tbm=$topBottomMargin rb=$rowBottom ch=$cellHeight assign='bottom'}
   {if $index != 0 && $index%($labelsHorizontal*$labelsVertical) == 0}<pagebreak />{/if}
   <div class="cell" style="left: {$left}mm; right: {$right}mm; top: {$top}mm; bottom: {$bottom}mm;">
    {if $order[orders].address_delivery.company}{$order[orders].address_delivery.company|escape:'htmlall':'UTF-8'}<br />{/if}
    {$order[orders].address_delivery.firstname|escape:'htmlall':'UTF-8'} {$order[orders].address_delivery.lastname|escape:'htmlall':'UTF-8'}<br />
    {$order[orders].address_delivery.address1|escape:'htmlall':'UTF-8'}<br />
    {if $order[orders].address_delivery.address2}{$order[orders].address_delivery.address2|escape:'htmlall':'UTF-8'}<br />{/if}
    {$order[orders].address_delivery.postcode|escape:'htmlall':'UTF-8'} {$order[orders].address_delivery.city|escape:'htmlall':'UTF-8'}<br />
    {if $conf.country_default != $order[orders].address_delivery.country.id_country}{$order[orders].address_delivery.country.name|escape:'htmlall':'UTF-8'}{/if}
    {if $order[orders].address_delivery.state.name && $conf.country_default != $order[orders].address_delivery.country.id_country} - {/if}
    {if $order[orders].address_delivery.state.name}{$order[orders].address_delivery.state.name|escape:'htmlall':'UTF-8'}{/if}
   </div> 
{sectionelse}
   <div>{l s='no orders'}</div>
{/section}
</body>

Link to comment
Share on other sites

×
×
  • Create New...