[jira] [Commented] (PDFBOX-4645) impossible to use own TrueTypeFonts in acroForm (and font also not embedded)

2019-09-07 Thread Tilman Hausherr (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4645?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16924841#comment-16924841
 ] 

Tilman Hausherr commented on PDFBOX-4645:
-

I have improved the javadoc, although the examples on stackoverflow and in the 
source code example mention that the font should not be subset (However they do 
not mention what terrible things may happen if you do subset)

> impossible to use own TrueTypeFonts in acroForm (and font also not embedded)
> 
>
> Key: PDFBOX-4645
> URL: https://issues.apache.org/jira/browse/PDFBOX-4645
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm, PDModel
>Affects Versions: 2.0.12, 2.0.13, 2.0.14, 2.0.15, 2.0.16
>Reporter: André Hertwig
>Priority: Major
>
> Hi
> I have a PDF form and want to add additional fonts, because the default fonts 
> does not allow cyrillic or greek chars for example.
> I add the font as following (LiberationSans-Regular):
> {code}
> PDResources formResources = acroForm.getDefaultResources();
> try (InputStream defaultTTFont1 = new FileInputStream(myFontFile)){
>   
>   PDFont font2 = PDType0Font.load(pdfDocument, defaultTTFont1, true);
>   COSName fontName = formResources.add(font2);
> }
> acroForm.setDefaultResources(formResources);
> {code}
> I debugged it, the valiable ttf is set.
> When filling a text field with for example cyrillic letters an exception 
> occurs, than I change the defaultAppereance of that field using the initially 
> added font.
> But the original TTF will not really used, instead there wil be created new 
> font classes with a TTF of null, so it seems to be impossible to use a 
> different TTF.
> Furthermore the font will not be embedded in the resulting PDF.
> {code}
> PDCIDFontType2.(COSDictionary, PDType0Font, TrueTypeFont) line: 75  
> <- initialized with TrueTypeFont = null
> PDCIDFontType2.(COSDictionary, PDType0Font) line: 62
> PDFontFactory.createDescendantFont(COSDictionary, PDType0Font) line: 139  
> PDType0Font.(COSDictionary) line: 192   
> PDFontFactory.createFont(COSDictionary, ResourceCache) line: 97   
> PDResources.getFont(COSName) line: 146
> PDDefaultAppearanceString.processSetFont(List) line: 173 
> PDDefaultAppearanceString.processOperator(Operator, List) line: 132  
> PDDefaultAppearanceString.processAppearanceStringOperators(byte[]) line: 108  
> PDDefaultAppearanceString.(COSString, PDResources) line: 86 
> PDTextField(PDVariableText).getDefaultAppearanceString() line: 93 
> AppearanceGeneratorHelper.(PDVariableText) line: 100
> PDTextField.constructAppearances() line: 263  
> PDTextField(PDTerminalField).applyChange() line: 228  
> PDTextField.setValue(String) line: 219
> {code}
> As a result of this behavoir I get the following warning:
> {code}
> WARN  org.apache.pdfbox.pdmodel.font.PDCIDFontType2 - Using fallback font 
> LiberationSans for CID-keyed TrueType font LiberationSans-Regular
> {code}
> When opening the PDF afterwards, I will get an error from AcrobatReader, that 
> the font "LiberationSans-Regular" could be found, because the font is not 
> embedded... like my own fonts..
> I tried it back to version 2.0.12 - always the same behavior.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4071) Improve code quality (3)

2019-09-07 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16924836#comment-16924836
 ] 

ASF subversion and git services commented on PDFBOX-4071:
-

Commit 1866552 from Tilman Hausherr in branch 'pdfbox/branches/issue45'
[ https://svn.apache.org/r1866552 ]

PDFBOX-4071: improve javadoc

> Improve code quality (3)
> 
>
> Key: PDFBOX-4071
> URL: https://issues.apache.org/jira/browse/PDFBOX-4071
> Project: PDFBox
>  Issue Type: Task
>Affects Versions: 2.0.8
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: pdfbox-screenshot-bad.png, pdfbox-screenshot-good.png
>
>
> This is a longterm issue for the task to improve code quality, by using the 
> [SonarQube 
> report|https://analysis.apache.org/dashboard/index/org.apache.pdfbox:pdfbox-reactor],
>  hints in different IDEs, the FindBugs tool and other code quality tools.
> This is a follow-up of PDFBOX-2852, which was getting too long.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4071) Improve code quality (3)

2019-09-07 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16924837#comment-16924837
 ] 

ASF subversion and git services commented on PDFBOX-4071:
-

Commit 1866553 from Tilman Hausherr in branch 'pdfbox/branches/issue4569'
[ https://svn.apache.org/r1866553 ]

PDFBOX-4071: improve javadoc

> Improve code quality (3)
> 
>
> Key: PDFBOX-4071
> URL: https://issues.apache.org/jira/browse/PDFBOX-4071
> Project: PDFBox
>  Issue Type: Task
>Affects Versions: 2.0.8
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: pdfbox-screenshot-bad.png, pdfbox-screenshot-good.png
>
>
> This is a longterm issue for the task to improve code quality, by using the 
> [SonarQube 
> report|https://analysis.apache.org/dashboard/index/org.apache.pdfbox:pdfbox-reactor],
>  hints in different IDEs, the FindBugs tool and other code quality tools.
> This is a follow-up of PDFBOX-2852, which was getting too long.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4071) Improve code quality (3)

2019-09-07 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16924835#comment-16924835
 ] 

ASF subversion and git services commented on PDFBOX-4071:
-

Commit 1866551 from Tilman Hausherr in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1866551 ]

PDFBOX-4071: improve javadoc

> Improve code quality (3)
> 
>
> Key: PDFBOX-4071
> URL: https://issues.apache.org/jira/browse/PDFBOX-4071
> Project: PDFBox
>  Issue Type: Task
>Affects Versions: 2.0.8
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: pdfbox-screenshot-bad.png, pdfbox-screenshot-good.png
>
>
> This is a longterm issue for the task to improve code quality, by using the 
> [SonarQube 
> report|https://analysis.apache.org/dashboard/index/org.apache.pdfbox:pdfbox-reactor],
>  hints in different IDEs, the FindBugs tool and other code quality tools.
> This is a follow-up of PDFBOX-2852, which was getting too long.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-4071) Improve code quality (3)

2019-09-07 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/PDFBOX-4071?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16924834#comment-16924834
 ] 

ASF subversion and git services commented on PDFBOX-4071:
-

Commit 1866550 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1866550 ]

PDFBOX-4071: improve javadoc

> Improve code quality (3)
> 
>
> Key: PDFBOX-4071
> URL: https://issues.apache.org/jira/browse/PDFBOX-4071
> Project: PDFBox
>  Issue Type: Task
>Affects Versions: 2.0.8
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: pdfbox-screenshot-bad.png, pdfbox-screenshot-good.png
>
>
> This is a longterm issue for the task to improve code quality, by using the 
> [SonarQube 
> report|https://analysis.apache.org/dashboard/index/org.apache.pdfbox:pdfbox-reactor],
>  hints in different IDEs, the FindBugs tool and other code quality tools.
> This is a follow-up of PDFBOX-2852, which was getting too long.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org