Categories > OpenTBS with DOCX >

* OPENTBS DEBUG MODE [SOLVED]

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Alexandros
Date: 2013-04-30
Time: 17:48

* OPENTBS DEBUG MODE [SOLVED]

first of all congratulations for a job well done.

I was setting up my application for the marge, starting the debug mode I get this, and (*) is not the first character.


* OPENTBS DEBUG MODE: if the star, (*) on the left before the word OPENTBS, is not the very first character of this page, then your
merged Document will be corrupted when you use the OPENTBS_DOWNLOAD option. If there is a PHP error message, then you have to fix it.
If they are blank spaces, line beaks, or other unexpected characters, then you have to check your code in order to avoid them.

-----------------------------------
INFORMATION
-----------------------------------
* Debug command: OPENTBS_DEBUG_INFO
* OpenTBS version: 1.7.6
* TinyButStrong version: 3.8.1
* PHP version: 5.3.3-7+squeeze15
* Opened document: file/documento.docx
* Activated features for document type: openxml/docx

Charts inside the document:
---------------------------
  - (none)

compared with the example I have a blank line at the top

In fact, if I download the document from corroto me, even if it is opened correctly

My php page is as follows

require_once('classes/tbs_us/tbs_class.php');

require_once('classes/tbs_plugin_opentbs.php');


require_once('.......');
require_once('.......');
require_once('.......');

if (isset($_POST['no'])) {$numeroOrdine = $_POST['no'];}
if (isset($_POST['ao'])) {$annoOrdine = $_POST['ao'];}
if (isset($_POST['az'])) {$azienda = $_POST['az'];}
if (isset($_POST['debug'])) { $debug = $_POST['debug'];}

$TBS = new clsTinyButStrong; // new instance of TBS
$TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN); // load OpenTBS plugin

$TBS->SetOption('noerr', true);

$template = "file/Documento.docx";

$TBS->LoadTemplate($template);

$TBS->MergeBlock('a', $a);
$TBS->MergeBlock('b', $b);
$TBS->MergeBlock('c', $c);
$TBS->MergeBlock('d', $d);

$TBS->PlugIn(OPENTBS_DELETE_COMMENTS); // cancella i commenti

if ($debug==2) { // debug mode 2
    $TBS->Plugin(OPENTBS_DEBUG_XML_CURRENT);
    exit;
} elseif ($debug==1) { // debug mode 1
    $TBS->Plugin(OPENTBS_DEBUG_INFO);
    exit;
} elseif ($debug==3) { // debug mode 3
    $TBS->Plugin(OPENTBS_DEBUG_XML_SHOW);
}

//if ($suffix==='') {
    if ($debug==0) {
    // download
    //$file_name = str_replace('.','_'.date('Y-m-d').'.',$template);
    $file_name = str_replace(' ','_',trim($testatadata['ragsoc'])).'_'.$data['numero'].'-'.date('d-m-Y').'.docx';
    // $TBS->Show();
    $TBS->Show(OPENTBS_DOWNLOAD, $file_name);
     //$TBS->Show(OPENTBS_FILE, $filename);
} else {
    // save as file
    $file_name = str_replace('.','_'.$suffix.'.',$file_name);
    $TBS->Show(OPENTBS_FILE+TBS_EXIT, $file_name);
}



By: Alexandros
Date: 2013-04-30
Time: 18:07

Re: * OPENTBS DEBUG MODE

ok, I solved ....

on a library's includes there was a blank line before the <?php ...
I solved it by deleting the blank line ...

sorry and thanks
By: Sarah Kemp
Date: 2013-04-30
Time: 18:08

Re: * OPENTBS DEBUG MODE

Where are your open and close tags? <?php and ?>? If there is whitespace outside of those that could be your problem. You also must ensure all of the files you include do not contain whitespace.