我无法从PDF文件中复制完全相同数量的空格。

huangapple go评论73阅读模式
英文:

I can't copy exact amount of whitespaces from a pdf file

问题

Code from pdf:

System.out.println("j\tK--A--F--V--Ş--V--F--A--K");
System.out.println(" \t| | | |\\ | /| | | |");
System.out.println("i\t-------------------------");
System.out.println(" \t| | | |/ | \\| | | |");
System.out.println("h\t---T-----------------T---");
System.println(" \t| | | | | | | | |");
System.out.println("g\tE-----E-----E-----E-----E");
System.out.println(" \t| | | | | | | | |");
System.out.println("f\t-------------------------");
System.out.println(" \t| |");
System.out.println("e\t-------------------------");
System.out.println(" \t| | | | | | | | |");
System.out.println("d\te-----e-----e-----e-----e");
System.out.println(" \t| | | | | | | | |");
System.out.println("c\t---t-----------------t---");
System.out.println(" \t| | | |/ | \\| | | |");
System.out.println("b\t-------------------------");
System.out.println(" \t| | | |\\ | /| | | |");
System.out.println("a\tk--a--f--v--ş--v--f--a--k");
System.out.println();
System.out.println(" \t1--2--3--4--5--6--7--8--9");

Code after copy-paste:

System.out.println("j\tK--A--F--V--Ş--V--F--A--K");
System.out.println(" \t| | | |\\ | /| | | |");
System.out.println("i\t-------------------------");
System.out.println(" \t| | | |/ | \\| | | |");
System.out.println("h\t---T-----------------T---");
System.println(" \t| | | | | | | | |");
System.out.println("g\tE-----E-----E-----E-----E");
System.out.println(" \t| | | | | | | | |");
System.out.println("f\t-------------------------");
System.out.println(" \t| |");
System.out.println("e\t-------------------------");
System.out.println(" \t| | | | | | | | |");
System.out.println("d\te-----e-----e-----e-----e");
System.out.println(" \t| | | | | | | | |");
System.out.println("c\t---t-----------------t---");
System.out.println(" \t| | | |/ | \\| | | |");
System.out.println("b\t-------------------------");
System.out.println(" \t| | | |\\ | /| | | |");
System.out.println("a\tk--a--f--v--ş--v--f--a--k");
System.out.println();
System.out.println(" \t1--2--3--4--5--6--7--8--9");
英文:

For homework, I need to copy this template from pdf but I can't get exact amount of whitespaces from copy pasting. How can I solve that?

Code from pdf:

我无法从PDF文件中复制完全相同数量的空格。

Code after copy-paste:

System.out.println("j\tK--A--F--V--Ş--V--F--A--K");
System.out.println(" \t| | | |\\ | /| | | |");
System.out.println("i\t-------------------------");
System.out.println(" \t| | | |/ | \\| | | |");
System.out.println("h\t---T-----------------T---");
System.out.println(" \t| | | | | | | | |");
System.out.println("g\tE-----E-----E-----E-----E");
System.out.println(" \t| | | | | | | | |");
System.out.println("f\t-------------------------");
System.out.println(" \t| |");
System.out.println("e\t-------------------------");
System.out.println(" \t| | | | | | | | |");
System.out.println("d\te-----e-----e-----e-----e");
System.out.println(" \t| | | | | | | | |");
System.out.println("c\t---t-----------------t---");
System.out.println(" \t| | | |/ | \\| | | |");
System.out.println("b\t-------------------------");
System.out.println(" \t| | | |\\ | /| | | |");
System.out.println("a\tk--a--f--v--ş--v--f--a--k");
System.out.println();
System.out.println(" \t1--2--3--4--5--6--7--8--9");

答案1

得分: 0

使用一个pdftotext修复宽度"-LAYOUT"提取器来插入相同数量的空白条,
我无法从PDF文件中复制完全相同数量的空格。 但只需要快速查找和替换即可在15秒内更正,因此比编写一行代码并测试它更快!

System.out.println("j\tK--A--F--V--Ş--V--F--A--K");
System.out.println(" \t|  |  |  |\\| /|  |  |  |");
System.out.println("i\t-------------------------");
System.out.println(" \t|  |  |  |/ |\\|  |  |  |");
System.out.println("h\t---T-----------------T---");
System.out.println(" \t|  |  |  |  |  |  |  |  |");
System.out.println("g\tE-----E-----E-----E-----E");
System.out.println(" \t|  |  |  |  |  |  |  |  |");
System.out.println("f\t-------------------------");
System.out.println(" \t|                       |");
System.out.println("e\t-------------------------");
System.out.println(" \t|  |  |  |  |  |  |  |  |");
System.out.println("d\te-----e-----e-----e-----e");
System.out.println(" \t|  |  |  |  |  |  |  |  |");
System.out.println("c\t---t-----------------t---");
System.out.println(" \t|  |  |  |/ |\\|  |  |  |");
System.out.println("b\t-------------------------");
System.out.println(" \t|  |  |  |\\| /|  |  |  |");
System.out.println("a\tk--a--f--v--ş--v--f--a--k");
System.out.println();
System.out.println(" \t1--2--3--4--5--6--7--8--9");

但你需要检查空格是否被提取器正确导出为非比例的"Typewriter"字体,比如历史上的Courier。

英文:

Use a pdftotext fixed width "-LAYOUT" extractor to inject the same amount of whitespace bars,
我无法从PDF文件中复制完全相同数量的空格。 However, it only takes a fast find and replace to correct in 15 seconds, thus faster than write a line of code and test it !

System.out.println("j\tK--A--F--V--Ş--V--F--A--K");
System.out.println(" \t|  |  |  |\\| /|  |  |  |");
System.out.println("i\t-------------------------");
System.out.println(" \t|  |  |  |/ |\\|  |  |  |");
System.out.println("h\t---T-----------------T---");
System.out.println(" \t|  |  |  |  |  |  |  |  |");
System.out.println("g\tE-----E-----E-----E-----E");
System.out.println(" \t|  |  |  |  |  |  |  |  |");
System.out.println("f\t-------------------------");
System.out.println(" \t|                       |");
System.out.println("e\t-------------------------");
System.out.println(" \t|  |  |  |  |  |  |  |  |");
System.out.println("d\te-----e-----e-----e-----e");
System.out.println(" \t|  |  |  |  |  |  |  |  |");
System.out.println("c\t---t-----------------t---");
System.out.println(" \t|  |  |  |/ |\\|  |  |  |");
System.out.println("b\t-------------------------");
System.out.println(" \t|  |  |  |\\| /|  |  |  |");
System.out.println("a\tk--a--f--v--ş--v--f--a--k");
System.out.println();
System.out.println(" \t1--2--3--4--5--6--7--8--9");

But you need to check if the spaces are correctly exported by the extractor as a Non-proportional "Typewriter" font such as historic Courier

huangapple
  • 本文由 发表于 2023年2月26日 21:19:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/75572256.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定