Comments (3)
This seems to have been fixed in recent LibreOffice version. Which version are you using ??
from jodconverter.
Well, after some digging, you seem to be hitting this issue, which is not resolved.
So according to the suggestions, your best bet would be to remove programatically the header/footer.
Here's how you could do it, with this post as an inspiration. Please modify the function as you see fit.
private static void convertCsvToPdfRemovingHeaderFotter(final OfficeManager manager) throws OfficeException {
final File inputFile = new File("C:\\tmp\\jodc\\test.csv");
final File outputFile = new File("C:\\tmp\\jodc\\test.pdf");
LocalConverter
.builder()
.officeManager(manager)
.filterChain((context, document, chain) -> {
if (Calc.isCalc(document)) {
// Remove header/footer from default page style.
// Access the 'PageStyles' Family
final XStyleFamiliesSupplier xSupplier = Lo.qi(XStyleFamiliesSupplier.class, document);
final XNameContainer xFamily = Lo.qi(XNameContainer.class, xSupplier.getStyleFamilies().getByName("PageStyles"));
// Now acess the Default PageStyle
final XStyle xStyle = Lo.qi(XStyle.class, xFamily.getByName("Default"));
// Turn off header and footer
final XPropertySet xStyleProps = Lo.qi(XPropertySet.class, xStyle);
xStyleProps.setPropertyValue("HeaderIsOn", false);
xStyleProps.setPropertyValue("FooterIsOn", false);
}
// Invoke the next filter in the chain.
chain.doFilter(context, document);
})
.build()
.convert(inputFile)
.to(outputFile)
.execute();
}
from jodconverter.
Thank you for the answer, this works for me
from jodconverter.
Related Issues (20)
- Started process; pid = -2
- Error when converting Excel to PDF HOT 3
- The program running on Docker keeps generating zombie processes.
- Not working with quartz? HOT 13
- I have a question about conversion options (password, page size ,etc) HOT 10
- Xslx SparkLine HOT 1
- Decimal number, from comma to dot HOT 17
- Information about supported properties and their meaning HOT 2
- LocalOfficeManager not killing existing process on the same port HOT 4
- jodconverter-local 4.4.3 or later causes the service to fail to end. HOT 7
- org.jodconverter.core.office.OfficeException: Task was cancelled: LocalConversionTask HOT 6
- Please remove unnecessary `@ConfigurationPropertiesScan` on `JodConverterLocalProperties` and `JodConverterRemoteProperties` HOT 3
- Coversion of HTMLs(generated out of emls) to PDF is taking almost 9 minutes HOT 1
- Why does my document conversion fail when I use jodconverter-local-lo, but it succeeds when I use jodconverter-local?
- How to use jodconverter-remote ??
- Kill timeout on server start?
- Scanner bug HOT 1
- Task keeps hanging when using Remote JodConverter
- how to define the properties make the excel to pdf more beautiful
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jodconverter.