英文:
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:
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"提取器来插入相同数量的空白条,
但只需要快速查找和替换即可在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,
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论