-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,578 changed files
with
30,649 additions
and
2,978 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
src/main/java/com/itextpdf/html2pdf/attach/impl/tags/DisplayGridTagWorker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
This file is part of the iText (R) project. | ||
Copyright (c) 1998-2024 Apryse Group NV | ||
Authors: Apryse Software. | ||
This program is offered under a commercial and under the AGPL license. | ||
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. | ||
AGPL licensing: | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
package com.itextpdf.html2pdf.attach.impl.tags; | ||
|
||
import com.itextpdf.html2pdf.attach.ITagWorker; | ||
import com.itextpdf.html2pdf.attach.ProcessorContext; | ||
import com.itextpdf.layout.IPropertyContainer; | ||
import com.itextpdf.layout.element.GridContainer; | ||
import com.itextpdf.layout.element.IElement; | ||
import com.itextpdf.styledxmlparser.node.IElementNode; | ||
|
||
/** | ||
* {@link ITagWorker} implementation for elements with {@code display: grid}. | ||
*/ | ||
public class DisplayGridTagWorker extends DivTagWorker { | ||
|
||
/** | ||
* Creates a new {@link DisplayGridTagWorker} instance. | ||
* | ||
* @param element the element | ||
* @param context the context | ||
*/ | ||
public DisplayGridTagWorker(IElementNode element, ProcessorContext context) { | ||
super(element, context, new GridContainer()); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public boolean processTagChild(ITagWorker childTagWorker, ProcessorContext context) { | ||
final IPropertyContainer element = childTagWorker.getElementResult(); | ||
if (childTagWorker instanceof BrTagWorker) { | ||
return super.processTagChild(childTagWorker, context); | ||
} else { | ||
return addBlockChild((IElement) element); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/main/java/com/itextpdf/html2pdf/css/apply/impl/DisplayGridTagCssApplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
This file is part of the iText (R) project. | ||
Copyright (c) 1998-2024 Apryse Group NV | ||
Authors: Apryse Software. | ||
This program is offered under a commercial and under the AGPL license. | ||
For commercial licensing, contact us at https://itextpdf.com/sales. For AGPL licensing, see below. | ||
AGPL licensing: | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
package com.itextpdf.html2pdf.css.apply.impl; | ||
|
||
import com.itextpdf.html2pdf.attach.ITagWorker; | ||
import com.itextpdf.html2pdf.attach.ProcessorContext; | ||
import com.itextpdf.html2pdf.css.apply.ICssApplier; | ||
import com.itextpdf.html2pdf.css.apply.util.GridApplierUtil; | ||
import com.itextpdf.layout.IPropertyContainer; | ||
import com.itextpdf.styledxmlparser.node.IStylesContainer; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* {@link ICssApplier} implementation for elements with display grid. | ||
*/ | ||
public class DisplayGridTagCssApplier extends BlockCssApplier { | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public void apply(ProcessorContext context, IStylesContainer stylesContainer, ITagWorker tagWorker) { | ||
super.apply(context, stylesContainer, tagWorker); | ||
final IPropertyContainer container = tagWorker.getElementResult(); | ||
if (container != null) { | ||
Map<String, String> cssProps = stylesContainer.getStyles(); | ||
GridApplierUtil.applyGridContainerProperties(cssProps, container, context); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.