Quantcast
Channel: PDFsharp - A .NET library for processing PDF
Viewing all 46 articles
Browse latest View live

Created Unassigned: Apostrophe causes error in Renderer [17635]

$
0
0
Some variations of apostrophes cause the renderer to issue a 'Raw string contains invalid character' exception.
The failing character when cast to an int returns 8217.
The normal apostrophe when cast to an int returns 39.

document.Info.Subject = subject..Replace("’", "'") is a workaround.

Commented Unassigned: Apostrophe causes error in Renderer [17635]

$
0
0
Some variations of apostrophes cause the renderer to issue a 'Raw string contains invalid character' exception.
The failing character when cast to an int returns 8217.
The normal apostrophe when cast to an int returns 39.

document.Info.Subject = subject..Replace("’", "'") is a workaround.
Comments: ** Comment from web user: petert1401 **

Forgot to mention, this is Migradoc v1.50 Beta 3b.

Commented Unassigned: Apostrophe causes error in Renderer [17635]

$
0
0
Some variations of apostrophes cause the renderer to issue a 'Raw string contains invalid character' exception.
The failing character when cast to an int returns 8217.
The normal apostrophe when cast to an int returns 39.

document.Info.Subject = subject..Replace("’", "'") is a workaround.
Comments: ** Comment from web user: petert1401 **

This is the unicode 'Right Single Quote character, and I guess the left single quote has the same issue.
See [TEXT](http://www.fileformat.info/info/unicode/char/2019/index.htm)

New Post: The recommended place for discussions about PDFsharp ...

Commented Issue: Symbol font rendering to PDF issue [15954]

$
0
0
Rendering a character to a PDF using a symbol font has an issue if you send 16 bit unicode character with the high bits already set. It works fine when rendering the same thing to GDI+, but fails for PDFs. I tracked it down to a couple lines that look like this:

glyphID = (int)ch + (descriptor.fontData.os2.usFirstCharIndex & 0xFF00);

It's adding the first symbol character index to the character to get its index, but if the character already includes the index, it shouldn't be adding it. It should be performing a bitwise "or" | instead of an "add" +. Just a 1 byte patch. The line should look like this instead:

glyphID = (int)ch | (descriptor.fontData.os2.usFirstCharIndex & 0xFF00);

There are two similar lines which need to be fixed:
PdfSharp.Drawing.Pdf\XGraphicsPdfRenderer.cs line 523
PdfSharp.Fonts\CMapInfo.cs line 71
Comments: ** Comment from web user: dalqamouny **

I tried the above fix over an Arabic writting, and it showed disconnected charecters with reversed directions
appreciated your help

Created Unassigned: Arabic Charecters in PDF Generation from HTML [17651]

$
0
0
I'm trying to generate a pdf from html content, where it is working fine with english charecters, but when it comes to Arabic charecters, it is being parsed reversed and disconnected.

I'm using thie line of code
var pdfFile= TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator.GeneratePdf(html, PdfSharp.PageSize.A4);

appreciated your help on this

thanks

Created Unassigned: Rotate to landscape (90 or 270) then setting orientation doesn't work. [17663]

$
0
0
After rotating a PDF to 90 degrees then saving the file the width and height are flipped incorrectly and the image isn't properly rotated.

1. Using the attached file create a test case with the following code.

public void Rotate_With90DegreeRotation_WillRevertToPortraitAfterSaving()
{
var originalDocument = PdfReader.Open("0_degrees.pdf");
var page = originalDocument.Pages[0];
page.Rotate = 90;
page.Orientation = PageOrientation.Landscape;
originalDocument.Save("90_degrees.pdf");
originalDocument.Close();
originalDocument.Dispose();

// read the file again to check orienation
var rotatedDocument = PdfReader.Open("90_degrees.pdf");
var rotatedPage = rotatedDocument.Pages[0];
var rotatedHeight = rotatedPage.Height;
var rotatedWidth = rotatedPage.Width;
var rotatedOrientation = rotatedPage.Orientation;
rotatedDocument.Close();
rotatedDocument.Dispose();

Assert.IsTrue(rotatedWidth > rotatedHeight); // test fails here
}

2. See result of test.

It appears that the save is doing something with the Media Box dimensions that may be causing this issue. I've implemented a work around in my code to make all 90 and 270 degree rotations set to a "Portrait" orientation before saving. This seem to fix the issue, but definitely a HACK.

Here's my work around code:c

page.Rotate = 90;
if (pageToRotate.Rotate == 90)
{
// HACK to fix bug with PDF Sharp; setting Orientation will flip the Height and Width, but loading the image again will be incorrect
pageToRotate.Height = originalWidth;
pageToRotate.Width = originalHeight;
// END HACK

pageToRotate.Orientation = PageOrientation.Landscape;

}
else
{
pageToRotate.Orientation = PageOrientation.Portrait;

}

Created Unassigned: TextureBrush support. [17674]

$
0
0
How can I draw a polygon filled with a hatch pattern or an image texture like with a texture brush in GDI+?

Commented Unassigned: Rotate to landscape (90) then save reverses width and height. [17663]

$
0
0
After rotating a PDF to 90 degrees then saving the file the width and height are flipped incorrectly and the image isn't properly rotated.

1. Using the attached file create a test case with the following code.

public void Rotate_With90DegreeRotation_WillRevertToPortraitAfterSaving()
{
var originalDocument = PdfReader.Open("0_degrees.pdf");
var page = originalDocument.Pages[0];
page.Rotate = 90;
page.Orientation = PageOrientation.Landscape;
originalDocument.Save("90_degrees.pdf");
originalDocument.Close();
originalDocument.Dispose();

// read the file again to check orienation
var rotatedDocument = PdfReader.Open("90_degrees.pdf");
var rotatedPage = rotatedDocument.Pages[0];
var rotatedHeight = rotatedPage.Height;
var rotatedWidth = rotatedPage.Width;
var rotatedOrientation = rotatedPage.Orientation;
rotatedDocument.Close();
rotatedDocument.Dispose();

Assert.IsTrue(rotatedWidth > rotatedHeight); // test fails here
}

2. See result of test.

It appears that the save is doing something with the Media Box dimensions that may be causing this issue. I've implemented a work around in my code to make all 90 and 270 degree rotations set to a "Portrait" orientation before saving. This seem to fix the issue, but definitely a HACK.

Here's my work around code:c

page.Rotate = 90;
if (pageToRotate.Rotate == 90)
{
// HACK to fix bug with PDF Sharp; setting Orientation will flip the Height and Width, but loading the image again will be incorrect
pageToRotate.Height = originalWidth;
pageToRotate.Width = originalHeight;
// END HACK

pageToRotate.Orientation = PageOrientation.Landscape;

}
else
{
pageToRotate.Orientation = PageOrientation.Portrait;

}
Comments: ** Comment from web user: ThomasHoevel **

Fixed in the internal builds using the change documented in the forum:
http://forum.pdfsharp.net/viewtopic.php?p=9591#p9591

Closed Unassigned: Rotate to landscape (90) then save reverses width and height. [17663]

$
0
0
After rotating a PDF to 90 degrees then saving the file the width and height are flipped incorrectly and the image isn't properly rotated.

1. Using the attached file create a test case with the following code.

public void Rotate_With90DegreeRotation_WillRevertToPortraitAfterSaving()
{
var originalDocument = PdfReader.Open("0_degrees.pdf");
var page = originalDocument.Pages[0];
page.Rotate = 90;
page.Orientation = PageOrientation.Landscape;
originalDocument.Save("90_degrees.pdf");
originalDocument.Close();
originalDocument.Dispose();

// read the file again to check orienation
var rotatedDocument = PdfReader.Open("90_degrees.pdf");
var rotatedPage = rotatedDocument.Pages[0];
var rotatedHeight = rotatedPage.Height;
var rotatedWidth = rotatedPage.Width;
var rotatedOrientation = rotatedPage.Orientation;
rotatedDocument.Close();
rotatedDocument.Dispose();

Assert.IsTrue(rotatedWidth > rotatedHeight); // test fails here
}

2. See result of test.

It appears that the save is doing something with the Media Box dimensions that may be causing this issue. I've implemented a work around in my code to make all 90 and 270 degree rotations set to a "Portrait" orientation before saving. This seem to fix the issue, but definitely a HACK.

Here's my work around code:c

page.Rotate = 90;
if (pageToRotate.Rotate == 90)
{
// HACK to fix bug with PDF Sharp; setting Orientation will flip the Height and Width, but loading the image again will be incorrect
pageToRotate.Height = originalWidth;
pageToRotate.Width = originalHeight;
// END HACK

pageToRotate.Orientation = PageOrientation.Landscape;

}
else
{
pageToRotate.Orientation = PageOrientation.Portrait;

}

Commented Unassigned: Apostrophe causes error in Renderer [17635]

$
0
0
Some variations of apostrophes cause the renderer to issue a 'Raw string contains invalid character' exception.
The failing character when cast to an int returns 8217.
The normal apostrophe when cast to an int returns 39.

document.Info.Subject = subject..Replace("’", "'") is a workaround.
Comments: ** Comment from web user: ThomasHoevel **

With current internal build, Unicode characters can be used here (including apostrophes).

For older versions, the hack shown in the forum can be used:
http://forum.pdfsharp.net/viewtopic.php?p=9523#p9523

Closed Unassigned: Apostrophe causes error in Renderer [17635]

$
0
0
Some variations of apostrophes cause the renderer to issue a 'Raw string contains invalid character' exception.
The failing character when cast to an int returns 8217.
The normal apostrophe when cast to an int returns 39.

document.Info.Subject = subject..Replace("’", "'") is a workaround.

Commented Unassigned: Outlined watermark not work [17614]

$
0
0
Hello to all.

It seems that in 1.50.4000-beta3b version, the XGraphicsPath AddText function with outlined or transparent text not working. I verified in the example code. With 1.32.3057 stable version, it's ok, but not is in 1.50.4000-beta3b.

See page 2, 3 and 5 and 6 of the attached file.
Comments: ** Comment from web user: ThomasHoevel **

Not reproducible.

Please note that the Watermark sample was updated for version 1.50 beta 3 or so.

Closed Unassigned: Outlined watermark not work [17614]

$
0
0
Hello to all.

It seems that in 1.50.4000-beta3b version, the XGraphicsPath AddText function with outlined or transparent text not working. I verified in the example code. With 1.32.3057 stable version, it's ok, but not is in 1.50.4000-beta3b.

See page 2, 3 and 5 and 6 of the attached file.
Comments: Check the StringFormat when calling AddText for a path.

Commented Unassigned: New version not working with Windows 2012 server [17589]

$
0
0
If I deploy in Windows 2012 server, the new version is not working. Can you please get me, why? and do we have any solution?
Comments: ** Comment from web user: ThomasHoevel **

Not reproducible.

Maybe you have to implement IFontResolver or grant additional permissions on the server.


Closed Unassigned: New version not working with Windows 2012 server [17589]

$
0
0
If I deploy in Windows 2012 server, the new version is not working. Can you please get me, why? and do we have any solution?
Comments: Not reproducible.

New Post: Adobe 6.x format

$
0
0
Hello,

Thank you for this fixe.

We are using the stable nuget package version '1.32.3057'
Today, The latest package version '1.50.4000-beta3b' from 15/12/2015.

We can't update to this beta version on our production environnement,

When you can you deploy a stable package on nuget ?

Best regards
Jd

Reviewed: PDFsharp 1.50 beta 3b (十月 13, 2016)

$
0
0
Rated 5 Stars (out of 5) - I cannot build the project. The .cs Files are not in UTF-8 Encoding and I do not know what encoding it is. Some special characters are not able to be shown in Visual Studio. For example, SoftHyphen and Currency in PdfSharp.Pdf.IO.Chars I will be very happy if I could download the dll.

Reviewed: PDFsharp 1.50 beta 3b (十月 13, 2016)

$
0
0
Rated 5 Stars (out of 5) - I cannot build the project. The .cs Files are not in UTF-8 Encoding and I do not know what encoding it is. Some special characters are not able to be shown in Visual Studio. For example, SoftHyphen and Currency in PdfSharp.Pdf.IO.Chars. I will be very happy if I could download the dll.

Created Unassigned: Blank pages when opening with Adobe reader [17759]

$
0
0
I have generated a PDF 28 page document and it works grate, but will not open with the 2015.023.20070 release of Adobe Reader. It displays the first 8 pages then every page is blank.

My version of PDFSharp is 1.32.
Viewing all 46 articles
Browse latest View live