Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$section -> addLine generates empty textline #1556

Open
2 tasks
basementmedia2 opened this issue Jan 23, 2019 · 6 comments
Open
2 tasks

$section -> addLine generates empty textline #1556

basementmedia2 opened this issue Jan 23, 2019 · 6 comments

Comments

@basementmedia2
Copy link

basementmedia2 commented Jan 23, 2019

This is:

Expected Behavior

I want to insert a line which acts as fold mark (in a letter template). The line should be positioned at left 0 and center of page.

Current Behavior

The line is positioned correctly but an empty text line is generated also in the section (which i think is the place of the line's anchor)

Failure Information

Is it possible to generate a line having the anchor not in the text (in the paragraph)

How to Reproduce

Please provide a code sample that reproduces the issue.

<?php
require __DIR__ . '/vendor/autoload.php';

$phpWord = new \PhpOffice\PhpWord\PhpWord();
$section = $phpWord->addSection();
// +++++++++++++++++++++++++++++++++++ Hole mark of letter
// 
$section->addLine(
    array(
        'width'            => \PhpOffice\PhpWord\Shared\Converter::cmToPixel(0.5),
        'height'           => \PhpOffice\PhpWord\Shared\Converter::cmToPixel(0),
        'positioning'      => 'absolute',
	'posHorizontal' => 'left',
        'posVertical'   => 'center',
        'posHorizontalRel' => 'left-margin-area',
        'posVerticalRel'   => 'page',
        'marginLeft'       => \PhpOffice\PhpWord\Shared\Converter::cmToPixel(0),
        'marginTop'        => \PhpOffice\PhpWord\Shared\Converter::cmToPixel(0),
        'wrappingStyle'    => \PhpOffice\PhpWord\Style\Image::WRAPPING_STYLE_SQUARE,
        'color'            => 'blue',
		'weight'		   => 2
    )
);

Context

  • PHP version:
  • PHPWord version: 0.14
@mantoze
Copy link

mantoze commented Apr 27, 2019

The same problem.
How to remove generated empty textline?

@ZhangJiaBa
Copy link

同样的问题。
如何删除生成的空文本行?

@basementmedia2
Copy link
Author

basementmedia2 commented May 25, 2020 via email

@ZhangJiaBa
Copy link

The same problem.
How to remove generated empty textline?

@basementmedia2
Copy link
Author

basementmedia2 commented May 26, 2020 via email

@Hessuss
Copy link

Hessuss commented Jan 20, 2021

Hi, same problem, someone resolved this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants