iText 7 java.lang.NoSuchMethodError(iText 7 java.lang.NoSuchMethodError)
我刚开始开发一个将HTML页面转换为PDF的新功能。 我使用iText 7.按照这里的说明进行操作!
现在我
Exception in thread "main" java.lang.NoSuchMethodError: com.itextpdf.layout.font.FontSet.getFonts()Ljava/util/Set;
得到错误Exception in thread "main" java.lang.NoSuchMethodError: com.itextpdf.layout.font.FontSet.getFonts()Ljava/util/Set;
我按照这里的说明创建了pom.xml! 但仍然收到同样的错误。
我用eclipse。 我将pom.xml放在WebContent文件夹中并收到错误。 将pom.xml移动到WEB-INF文件夹时的结果相同。
pom.xml的目录是错误的吗?
我在这里经历过这个问题! 而且在这里 ! 但仍然无法正常工作
请指教。
I just started developing a new function to convert HTML page to PDF. I use iText 7. Followed the instruction here!.
And now i get the error
Exception in thread "main" java.lang.NoSuchMethodError: com.itextpdf.layout.font.FontSet.getFonts()Ljava/util/Set;
I have created pom.xml following the instruction here! but still received the same error.
I use eclipse. I put the pom.xml in the WebContent folder and received the error. Same result when moved the pom.xml into the WEB-INF folder.
Is the directory for the pom.xml wrong?
I've gone through the question here! and also here! but still doesn't work
Please advice.
原文:https://stackoverflow.com/questions/45051518
最满意答案
只需更改您的代码:
if( isset($_POST['submit']) ){ $name = $_POST['name']; $age = $_POST['age']; $address = $_POST['address']; $file = fopen("student.txt","a"); fwrite($file,$name.PHP_EOL); fwrite($file,$age.PHP_EOL); fwrite($file,$address.PHP_EOL); fclose($file); echo "Adding student successfully"; }
我希望这个对你有用。 :)
Just change your code:
if( isset($_POST['submit']) ){ $name = $_POST['name']; $age = $_POST['age']; $address = $_POST['address']; $file = fopen("student.txt","a"); fwrite($file,$name.PHP_EOL); fwrite($file,$age.PHP_EOL); fwrite($file,$address.PHP_EOL); fclose($file); echo "Adding student successfully"; }
I hope it works for you. :)
相关问答
更多-
对于文本文件的最基本读取,请使用open 例: Dim FileNum As Integer Dim DataLine As String FileNum = FreeFile() Open "Filename" For Input As #FileNum While Not EOF(FileNum) Line Input #FileNum, DataLine ' read in data 1 line at a time ' decide what to do with datalin ...
-
我已经设法自己找到答案。 谢谢您的帮助。 // READ FILE public async void ReadFile() { // settings var path = @"MyFolder\MyFile.txt"; var folder = Windows.ApplicationModel.Package.Current.InstalledLocation; // acquire file v ...
-
您可以使用fopen()来为您的文件创建资源。 然后用fseek()操作资源到你想要读/写的位置,然后用fgets()和fputs()你想要对文件的那一部分做什么。 这仅适用于更改和附加数据。 如果要从文件中删除数据,则必须从要删除的点重写整个文件。 You can use fopen() which will create a resource to your file. Then manipulate the resource with fseek() to where you want to read ...
-
只需更改您的代码: if( isset($_POST['submit']) ){ $name = $_POST['name']; $age = $_POST['age']; $address = $_POST['address']; $file = fopen("student.txt","a"); ...
-
以下内容通过文件读取,每个时钟周期1行:预期数据格式为每行一个十进制数。 integer data_file ; // file handler integer scan_file ; // file handler logic signed [21:0] captured_data; `define NULL 0 initial begin data_file = $fopen("data_file.dat", "r") ...
-
您可以使用stripslashes函数从字符串中删除转义斜杠。 所以在你的情况下,你想要使用fwrite($mechat,stripslashes($_POST['mechat'])); 代替。 这样,当你有需要转义的字符时,stripslashes函数会为你做这个,它应该输出正常。 You can remove escape slashes from strings using the stripslashes function. So in your case, you'd want to use fw ...
-
如何从Excel中读取数据并将其逐行写入文本文件?(How to read data from Excel and write it to text file line by line?)[2022-06-05]
您应该使用append mode 打开 output.txt文件: file = open("Output.txt", "a") 此外,您应该在进入循环之前执行此操作,并且应该在该循环之后关闭它。 更新 : 在像这样的情况下,你可以使用with而不是在最后关闭文件句柄。 还包括@Josh在他自己的回答中提出的好建议,代码可以是这样的: import xlrd import os.path wb = xlrd.open_workbook(os.path.join('D:\TRB 2014 Data','S ... -
我不知道为什么你需要fileinput模块, open也可以处理这种情况。 你的for循环遍历所有行并用新行覆盖 new_str 。 最后一行没有下一行,因此不会被覆盖,因此它是唯一可以保存的行。 import re test_f = open('test.txt') result_f = open('result.txt', 'a') for line in test_f: new_str = re.sub('[^a-zA-Z0-9\n\.]'," ", line) result_f.wr ...
-
这应该适合你: (这里我只用file()得到所有文件行。然后我用array_map()遍历每一行并在最后连接一个逗号。之后我用file_put_contents()保存带有新内容的文件。
PHP写入文本文件(PHP Write To Text File)[2022-02-02]
添加\r\n应该有效 $file_Name = './textFilesData/Accounts_Deafult_Data.txt'; $current = file_get_contents($file_Name); $c = 0; while ( $c < 5 ) { $current .= 'Rafat'."\r\n"; ...相关文章
更多- hibernate的java.lang.NoSuchMethodError
- Solr4.2迁移到新项目下异常:java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.
- Itext显示中文的三大方案
- iText生成PDF入门实例
- jar 包 的用处 ,dozer、poi、itext 、jxl 、jbarcode 、itextrenderer jquery 效果
- java.lang.OutOfMemoryError: Java heap space 的解决方案
- Java错误:java.lang.OutOfMemoryError: Java heap space
- Hive新旧jar包冲突引起的错误java.lang.NoSuchFieldError: info
- java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute 的解决方案
- Hadoop运行报错: java.lang.ClassNotFoundException解决方法
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)